[mrtg] Ad: Re: CPU monitoring on Xylan switch....again.

Sevald-Olaf.Lund at gjensidige.no Sevald-Olaf.Lund at gjensidige.no
Fri Mar 17 15:01:28 MET 2000


Hi!
Thanks!!!
It worked perfectly!!





Here is the script.

It is fairly general and could be used for manipulating any OCTET String.
It
is written specifically for WinNT (cause that is what I use for MRTG) and
could easily be altered to include other OSes like Unix or Linux.  You will
need the SNMPUTIL from the WinNT 4.0 Resource Kit to use this script as is.
I suppose I could have used the SNMP perl routines with MRTG, but I was
pressed for time and wasn't sure if they could retrieve OCTET strings.

You can send MTRG your choice of the following for the Xylan Omni Switch 5x
or 9x.

 $cpu5sec = hex(@allvalues[0]);
 $cpu60sec= hex(@allvalues[1]);
 $cpu1hour= hex(@allvalues[2]);
 $cpu1hourmax= hex(@allvalues[3]);

By replacing the appropriate variable in the print statement.

print "$cpu5sec\n$cpu60sec\n";

By Default it will get the
       Octet 0: average cpu #1 utilization over the latest sample
period(percent)
       Octet 1: average cpu #1 utilization over the latest minute (percent)

***Sample Usage****

#---------------------------------------------------------------
# Target Switch - XYLAN
#---------------------------------------------------------------

Target[XYLAN.cpu]:
 `c:\perl\bin\perl.exe d:\mrtg-2.7.4\run\mrtg-xylan-cpu.pl
.1.3.6.1.4.1.800.2.18.1.11.0 public at hostname`
Directory[XYLAN.cpu]: XYLAN
RouterUptime[XYLAN.cpu]: public at DHAB0222-R611-01X.dha.aramco.com.sa
MaxBytes[XYLAN.cpu]: 100
Title[XYLAN.cpu]: CPU Utilization - XYLAN
PageTop[XYLAN.cpu]: <H1>CPU Utilization - XYLAN</H1>
ShortLegend[XYLAN.cpu]: %
YLegend[XYLAN.cpu]: CPU Utilization
Legend1[XYLAN.cpu]: 5 Sec CPU Utilization
Legend2[XYLAN.cpu]: 60 Sec CPU Utilization
Legend3[XYLAN.cpu]:
Legend4[XYLAN.cpu]:
LegendI[XYLAN.cpu]: &nbsp; 5 Sec: &nbsp;
LegendO[XYLAN.cpu]: &nbsp; 60 Sec: &nbsp;
Options[XYLAN.cpu]: gauge, growright

*********************************************
---
Mvh
Sevald O. Lund
Systemkonsulent
Merkantildata
MCSE, CCNA



--
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