[mrtg] Re: Ping an NT workstation

Milborrow Brett (RGC) Information Security Officer Brett.Milborrow at whippsx.nhs.uk
Mon Dec 15 15:17:35 MET 2003


Hi,

You will need to include gauge into the Options[uic_ping] section:

Options[uic_ping]: bits,unknaszero,gauge

This is because the values you are collecting do not increment, but are a
snap shot of the current value when you run the ping script. Think of a
thermometer for temperature. It is a gauge of the current temperature. Where
as the IfInOctects and IfOutOctects for a cisco router interface simply
keeps incrementing on the same counter. MRTG was written with the intention
that it would work out the 'average' of each counter using an algorithm.
This algorithm cannot be applied to gauge type counters.

I have also rewritten your perl script so that it is a bit neater as it
seemed to output different sets of data when pinging different devices I
have.

ping.pl ------START-----

$node = "$ARGV[0]";
$res   = `ping $node -n 1`;

if ($res =~ /\d{1,30}ms/g) {
$rest=$&;
}
$rest =~ s/ms//ig;

print "$rest\n";

-----END-----

Hope this helps!

Brett Milborrow

-----Original Message-----
From: bonnaud olivier [mailto:obonnaud at evc.net] 
Sent: 15 December 2003 09:33
To: mrtg at list.ee.ethz.ch
Subject: [mrtg] Ping an NT workstation

I try to trace the ping response time for a NT workstation that is not 
using SNMP.

Here are the script :
Target[uic_ping]: `d:\perl\bin\perl d:\mrtg\dev\pinguic.pl`
MaxBytes[uic_ping]: 100000000
Title[uic_ping]: Ping UIC
PageTop[uic_ping]: <H1>Ping UIC</H1>
Ysize[uic_ping]: 200
Ytics[uic_ping]: 10
YLegend[uic_ping]: Ping
LegendI[uic_ping]: Ping
Options[uic_ping]: bits,unknaszero

and the perl script pinguic.pl
$node = $ARGV[0];

$res   = `ping x.y.z.w -n 1`;

@number1 = split(/ /,$res);
$total = $number1[10];
$total =~ s/time//ig;
$total =~ s/<//ig;
$total =~ s/=//ig;
$total =~ s/ms//ig;

print "$total\n";

If i check the result of the file
1039944612 10 -1
1039944612 0 0 0 0
1039944582 0 0 0 0
1039944300 0 0 0 0
1039944000 0 0 0 0
1039943700 0 0 0 0
1039943400 0 0 0 0
1039943100 0 0 0 0
1039942800 0 0 0 0
1039942500 0 0 0 0
only the first line is updated. so i don't have the last result.
any idea ?

thanks for your help

--
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
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

--
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
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list