[hobbit] monitoring (cisco) routers

Daniel J McDonald dan.mcdonald at austinenergy.com
Fri Mar 25 15:36:38 CET 2005


On Thu, 2005-03-24 at 18:26 +0100, Marco Avvisano wrote:
> Someone have tried scripts to monitor cpu, memory and temperature for cisco
> routers, that work correctly in hobbit (also the rrd graphs)?

I do that using mrtg, and then run bbmrtg.pl to pull the stats into
hobbit.

Temperature monitoring has been flaky on Cisco for a long time - are you
using devices with good temperature reporting?


My cpu/memory template for mrtg:

$head_lines .= <<ECHO
#.....................................................................
# Router processor utilization.
#

ECHO
;
snmpMIB_to_OID("/usr/share/snmp/mibs/CISCO-SMI-V1SMI.my");
snmpMIB_to_OID("/usr/share/snmp/mibs/CISCO-TC-V1SMI.my");
snmpMIB_to_OID("/usr/share/snmp/mibs/CISCO-PROCESS-MIB-V1SMI.my");

my %cpu;
my (@temp) = snmpwalk($router_connect,'cpmCPUTotal5secRev');
foreach my $tempi(@temp) {
        $tempi =~ /(\d+):\d/;
        my $instance=$1;
        my $target_name=$router_name.".cpu".$instance;
        $cpu{$instance}++;
        $target_lines .= <<CPU
Target[$target_name]:
cpmCPUTotal5secRev.$instance&cpmCPUTotal1minRev.$instance:
$router_connect
MaxBytes[$target_name]: 100
routers.cgi*ShortDesc[$target_name]:  CPU # $instance
routers.cgi*Options[$target_name]: nototal
bb*host[$target_name]: $router_name
bb*svc[$target_name]: cpu
bb*red[$target_name]: 90
bb*yellow[$target_name]: 80
Options[$target_name]:  gauge, unknaszero
Directory[$target_name]: $directory_name
WithPeak[$target_name]: wmy
YLegend[$target_name]: % Utilization
ShortLegend[$target_name]: %
Legend1[$target_name]: 5 Second Load
Legend2[$target_name]: 1 Minute Load
LegendI[$target_name]:  5sec :
LegendO[$target_name]:  1min :
Title[$target_name]: $sysname
PageTop[$target_name]: <H1>$sysname Processor Load</H1>
 <TABLE>
   <TR><TD>System:</TD><TD>$sysname  </TD></TR>
   <TR><TD>Location:</TD><TD>$syslocation </TD></TR>
 </TABLE>
CPU
;
}

my (@temp) = snmpwalk($router_connect,'cpmCPUTotal5sec');
foreach my $tempi(@temp) {
        $tempi =~ /(\d+):\d/;
        my $instance=$1;
        next if exists $cpu{$instance};
        my $target_name=$router_name.".cpu".$instance;
        $cpu{$instance}++;
        $target_lines .= <<CPUOLD
Target[$target_name]:
cpmCPUTotal5sec.$instance&cpmCPUTotal1min.$instance:$route r_connect
MaxBytes[$target_name]: 100
routers.cgi*ShortDesc[$target_name]:  CPU # $instance
routers.cgi*Options[$target_name]: nototal
bb*host[$target_name]: $router_name
bb*svc[$target_name]: cpu
bb*red[$target_name]: 90
bb*yellow[$target_name]: 80
Options[$target_name]:  gauge, unknaszero
Directory[$target_name]: $directory_name
WithPeak[$target_name]: wmy
YLegend[$target_name]: % Utilization
ShortLegend[$target_name]: %
Legend1[$target_name]: 5 Second Load
Legend2[$target_name]: 1 Minute Load
LegendI[$target_name]:  5sec :
LegendO[$target_name]:  1min :
Title[$target_name]: $sysname
PageTop[$target_name]: <H1>$sysname Processor Load</H1>
 <TABLE>
   <TR><TD>System:</TD><TD>$sysname  </TD></TR>
   <TR><TD>Location:</TD><TD>$syslocation </TD></TR>
 </TABLE>
CPUOLD
;
}

snmpMIB_to_OID("/usr/share/snmp/mibs/CISCO-QOS-PIB-MIB-V1SMI.my");
snmpMIB_to_OID("/usr/share/snmp/mibs/CISCO-MEMORY-POOL-MIB-V1SMI.my");
my (@temp) = snmpwalk($router_connect,'ciscoMemoryPoolName');
foreach my $tempi(@temp) {
        $tempi =~ /(\d+):(.+)/;
        my $instance=$1;
        next if $2 !~ /Processor/;
        my ($used, $free) =
snmpget($router_connect,'ciscoMemoryPoolUsed.'.$instance,
'ciscoMemoryPoolFree.'.$instance);
        my $target_name=$router_name.".memory";
        my $maxsize = $used+$free;
        $target_lines .= <<DISK
#------------------------------------------------------------------------------- -------
# Memory Utilization

Target[$target_name]:
ciscoMemoryPoolFree.$instance&ciscoMemoryPoolLargestFree.$ instance:
$router_connect
YLegend[$target_name]: Bytes Free
Options[$target_name]: gauge, unknaszero
Directory[$target_name]: $directory_name
MaxBytes[$target_name]: $maxsize
ShortLegend[$target_name]: bytes
routers.cgi*ShortDesc[$target_name]: Memory
routers.cgi*Options[$target_name]: nototal
bb*host[$target_name]: $router_name
bb*svc[$target_name]: memory
bb*red[$target_name]: 5%:99%
bb*yellow[$target_name]: 7%:98%
Legend1[$target_name]: Free Mem
Legend2[$target_name]: Largest Block
LegendI[$target_name]: Free
LegendO[$target_name]: Block
WithPeak[$target_name]: ymw
Title[$target_name]: $sysname
PageTop[$target_name]: <H1>Memory on $sysname/H1>
 <TABLE>
   <TR><TD>System:</TD><TD>$sysname  </TD></TR>
   <TR><TD>Location:</TD><TD>$syslocation </TD></TR>
 </TABLE>
DISK
;
}

> 
> I'm tryng bb-xsnmp script, but i have some problems.
> 
> 
> 
> Marco
> 
> 
> To unsubscribe from the hobbit list, send an e-mail to
> hobbit-unsubscribe at hswn.dk
> 




More information about the Xymon mailing list