[comp.sys.next] NeXT "audio ping" for network debugging

sahayman@iuvax.cs.indiana.edu (Steve Hayman) (01/24/91)

The thinwire started messing up in the building where I
work yesterday;  I was scurrying around with an ethernet terminator
cutting off segments of the network to try to isolate where
the problem was.   I have a NeXT and a Sun on my desk,
and was trying to 'ping' the Sun from the NeXT.  Whether it
worked depended on where I cut the network off.

ping is a good tool for debugging but it sure is a pain to have
to run back to your office to see if any of the ping packets
are getting through.  So I came up with this quick hack.

1) Use "sndrecord ping.snd", hit return, say the word "PING" into the mike.
   hit return again.  Try to make the recording less than 1 second long.

2) Run this script

#!/bin/sh
# audio-ping host
# output of 'ping' looks like this:
#    # ping porbeagle
#    PING porbeagle.cs.indiana.edu: 56 data bytes
#    64 bytes from 129.79.254.138: icmp_seq=0. time=3. ms
#    64 bytes from 129.79.254.138: icmp_seq=1. time=3. ms
#          ...
# one line per second.  no output is produced if the packets
# aren't coming back.  
# This script plays a sound whenever it sees a line with "icmp_seq" on it.
#


ping $1 2>&1 | while read line; do
    case "$line" in
    *icmp_seq*)	
	    sndplay ping.snd
	    ;;
    esac
done


Now start this up.  Crank up the volume on your NeXT to the max.  You
can now wander through the building fiddling with the network,
unplugging different machines and so on; if it's working you'll hear
this voice saying PING ... PING ... PING; if it quits working the voice
will stop.

If you wanted to get really fancy you could play a different sound
for some of the other messages that ping might generate - sometimes
ping says "network is down", for instance.

This script helped me find a faulty tee-connector in just about
a minute.

OK it's a dumb hack.

Steve
-- 
Steve Hayman    Workstation Manager    Computer Science Department   Indiana U.
sahayman@iuvax.cs.indiana.edu                                    (812) 855-6984
NeXT Mail: sahayman@spurge.bloomington.in.us

waltrip@capd.jhuapl.edu (01/24/91)

In article <1991Jan23.211609.877@news.cs.indiana.edu>, sahayman@iuvax.cs.indiana.edu
 (Steve Hayman) writes:
	[...material deleted in which he gives a procedure for having the "ping"
	   program give periodic audio reports of network status...]
> OK it's a dumb hack.
	I love it...this sort of thing makes wading through newsgroups 
	addictive.

c.f.waltrip

Internet:  <waltrip@capd.jhuapl.edu>

Opinions expressed are my own.

abe@mace.cc.purdue.edu (Vic Abell) (01/24/91)

It aches the heart of this Purdue person to say it, but Indiana
University's Steve Hayman has a winner with his audio ping script.
If there were the equivalent of an Oscar for innovative use of
NeXT and Unix tools, I would nominate Steve.

Steve's creation deserves the ultimate compliment -- "Why didn't
I think of that?"

Thanks, Steve.

Vic Abell
Assistant Director
Purdue University Computing Center