Work on your own!
For this assignment, you will write a
perl script called
The purpose of this assignment is to have an easy way to verify that a
remote system is “up” (responds to pings). The command is designed so
that you can use it from
cron. It is not much more than a thin veneer
You give it a hostname, and it pings the host. It displays the hostname, followed by how many ping packets came back, followed by how many ping packets were sent.
The script takes two optional arguments and a mandatory single hostname:
-s: be silent. If all ping packets succeeded, display nothing.
-pcount: How many packets to send (see
In these sample runs, our computer
to pings, but
hp.com doesn’t. “
$” is my shell prompt:
$ ./up denver.cs.colostate.edu denver.cs.colostate.edu: 3/3 $ ./up -p1 denver.cs.colostate.edu denver.cs.colostate.edu: 1/1 $ ./up -p2 -s denver.cs.colostate.edu $ ./up hp.com hp.com: 0/3 $ ./up -s -p 10 hp.com hp.com: 0/10 $ ./up 192.0.2.12 192.0.2.12: 0/3
Wondering what the heck 192.0.2.12 is? Read https://wikipedia.org/wiki/Reserved_IP_addresses#IPv4.
If you encounter “STACK FRAME LINK OVERFLOW”, then try this:
-pand count is optional. However, nothing else can be between them.
pingcommand produced that; it’s not my fault."
Via web checkin, or:
~ct320/bin/checkin HW4 up
Turn in someone else’s work.