CT320: Network and System Administration

Fall 2019

HW 4

CT320 HW4: You up?

Individual Work

Work on your own!                 

Description

For this assignment, you will write a perl script called up.                 

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 around ping.                 

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.                 

Arguments

The script takes two optional arguments and a mandatory single hostname:                 

Examples

In these sample runs, our computer denver.cs.colostate.edu responds to pings, but hp.com doesn’t. “$” is my shell prompt:                 

    $ ./up denver.cs.colostate.edu
    denver.cs.colostate.edu 3/3
    $ ./up -n1 denver.cs.colostate.edu
    denver.cs.colostate.edu 1/1
    $ ./up -n2 -s denver.cs.colostate.edu
    $ ./up hp.com
    hp.com 0/3
    $ ./up -s -n 10 hp.com
    hp.com 0/10
    $ ./up 192.0.2.12
    192.0.2.12 0/3

Note

Wondering what the heck 192.0.2.12 is? Read https://wikipedia.org/wiki/Reserved_IP_addresses#IPv4.                 

Debugging

If you encounter “STACK FRAME LINK OVERFLOW”, then try this:

    export STACK_FRAME_LINK_OVERRIDE=ffff-ad921d60486366258809553a3db49a4a

Requirements

How to submit your homework:

Via web checkin, or:                 

    ~ct320/bin/checkin HW4 up

How to receive negative points:

Turn in someone else’s work.