[mrtg] (no subject) ADDED: External Monitoring Script..
Mark Tohill
Mark at u.tv
Fri Jun 13 16:03:47 CEST 2008
From
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch23_:_A
dvanced_MRTG_for_Linux
"You can use other mathematical operators, such as subtract (-),
multiply (*), and divide (%). Left and right parentheses are also valid.
There must be white spaces before and after all these operators for MRTG
to work correctly. If not, you'll get oddly shaded graphs."
I'll give it a go....
Thanks,
Mark
-----Original Message-----
From: Mark Tohill
Sent: 13 June 2008 13:59
To: 'Steve Shipway'
Cc: mrtg at lists.oetiker.ch
Subject: RE: [mrtg] (no subject) ADDED: External Monitoring Script..
Eric,Steve,
>>You may be able to achieve this with some of the strange pseudo-OID
>>configurations for specifying the Target. Not sure as you want the
last >>in the walk, it may only be possible to grab the first? There is
a >>SnMPWaLK magic token that I can't remember the syntax for.
Steve,Thanks. It might do what I need.
I have tried the following:
#UDP JITTER
Target[UDPJITTER-RTTLATEST]:.1.3.6.1.4.1.9.9.42.1.2.10.1.1.2&(WaLK1.1.3.
6.1.4.1.9.9.42.1.3.5.1.5/WaLK1.1.3.6.1.4.1.9.9.42.1.3.5.1.4):secret at 192.
168.10.1
Options[UDPJITTER-RTTLATEST]: integer, gauge
So I'm plotting the first value, and then performing a division on the
second 2 values, for the second value. I tested 'WaLKx' with the
following and it works!!
#UDP JITTER....Testing.....Just RTTSum and NumOfRTT.....
Target[UDPJITTER-RTTLATEST]:WaLK1.1.3.6.1.4.1.9.9.42.1.3.5.1.5&WaLK1.1.3
.6.1.4.1.9.9.42.1.3.5.1.4:cisco at 192.168.10.1
It's just the division on the second parameter I'm stuck on.
Thanks for your help.
-----Original Message-----
From: Steve Shipway [mailto:s.shipway at auckland.ac.nz]
Sent: 12 June 2008 23:36
To: Mark Tohill
Cc: mrtg at lists.oetiker.ch
Subject: RE: [mrtg] (no subject) ADDED: External Monitoring Script..
> Why does the script need to return 2 values? Can I not plot the same
> value twice i.e. name the script for both in and out?
Historical reasons. MRTG originally graphed just router interface
traffic, so there would always be an IN and an OUT. When it grew to
graph anything, it still had the requirement for there to be two
variables per Target, although one could be suppressed using NOO or NOI.
> [root]# snmpwalk 192.168.10.1 secret .1.3.6.1.4.1.9.9.42.1.3.5.1.2
> enterprises.9.9.42.1.3.5.1.2.2.17756118 = 60
> enterprises.9.9.42.1.3.5.1.2.2.18116118 = 35
>
> I simply wanted to grab the latest value i.e. for the past 1 hour, 35
in
> this case.
You may be able to achieve this with some of the strange pseudo-OID
configurations for specifying the Target. Not sure as you want the last
in the walk, it may only be possible to grab the first? There is a
SnMPWaLK magic token that I can't remember the syntax for.
> I hoped to plot that initially, and then plot an average for the
second
> line, same graph.
MRTG should be able to take care of the averaging for you. You can also
use the Factor[] directive to divide by 1000 if these are milliseconds,
if you want.
>
Target[UDPJITTER-RTTLATEST]:`/usr/local/mrtg-2.13.1/bin/RTTSumIn`&`/usr/
> local/mrtg-2.13.1/bin/RTTSumIn`:secret at 192.168.10.1
This is way wrong, you cannot have `external scripts` and SNMP. It's
one or the other. You'll just need to write your external script to do
all the work itself, and spit out the two numbers according to the MRTG
plugin protocol (IE, decimalnumber, newline, decimalnumber, newline,
optionaluptimestring, newline, optionaldescription, newline; then exit
with status 0)
Steve
More information about the mrtg
mailing list