[mrtg] mrtg-ping-probe --> how can I tell when a device goes down??

bob smith mrtgboy at hotmail.com
Fri Apr 7 23:21:34 MEST 2000


I'm running MRTG with mrtg-ping-probe on NT4. And I have a slight problem 
with mrtg-ping-probe (avail here):


When MRTG runs it runs all my config files... one of which runs ping-probe 
which in turn runs ping.exe which displays roundtrip time mins, maxes, and 
averages. (FYI I yanked ping.exe and ICMP.dll from a 2000 machine to replace 
the default ping since it doesn't display the stat goodness ping-probe needs 
to do it's thang). Anyway, it works just fine. HOWEVER, I'd really like to 
know when a machine goes down... I assumed that ping.exe would report a 
round-trip time of the timeout value (on which I would set a threshold 
value) when a machine becomes the dreaded "un-pingable"... but alas, it 
returns "0" for a dead box: the SAME value I get for half my other machines 
that are UP because we're all on the same big happy subnet.

So... I thought I could change the perl code of mrtg-ping-probe to look for 
"100% loss" in the output of the ping command which would tell me "box is 
dead" and thus throw MRTG a value that breaches a threshold... Sure that 
sounds fine and all until I realized I don't know much about perl... so 
here's the code that searches the output of the ping program (I think):

while (<PING>) {
		$ping_output .= $_;
		if (m|^round-trip(?: \(ms\) )? min/avg/max(?:/stddev)? = 
(\d+)(?:\.\d+)?/(\d+)(?:\.\d+)?/(\d+)(?:\.\d+)?|) {
			close(PING), return($1,$2,$3);
			close(PING), return($1,$3,$2);

I'm pretty sure this is it...

Anyway... if anyone can help me out I'd appreciate it... here's some sample 
output of the ping.exe program for a dead box:

Ping statistics for xxx.xxx.xxx.xxx:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum =  0ms, Average =  0ms

Thanks again!


Get Your Private, Free Email at http://www.hotmail.com

Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org

More information about the mrtg mailing list