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

Jeff Meisner jeff at meisner.com
Wed Mar 15 21:54:05 MET 2000


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

*********************************************
*  Jeff Meisner                             *
*  Network Management Group                 *
*  Saudi Arabian Oil Company (Saudi Aramco) *
*                                           *
*  Office: +966 (3) 876-2746                *
*  Mobile: +966 (5) 587-6604                *
*  Email: meisnedj at aramco.com.sa            *
*         jeff at meisner.com                  *
*********************************************


-- Attached file removed by Listar and put at URL below --
-- Type: application/octet-stream
-- Size: 2k (2049 bytes)
-- URL : http://www.ee.ethz.ch/~slist/pantomime/mrtg-xylan-cpu.pl


--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:mrtg-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/mrtg



More information about the mrtg mailing list