[mrtg] Cisco CSS1150x templates?
Daniel J McDonald
dan.mcdonald at austinenergy.com
Fri May 4 13:06:38 CEST 2007
On Thu, 2007-05-03 at 16:11 -0700, Bracey, John wrote:
> Hey:
>
> Do any of you have, or can you direct me to any MRTG templates for
> Cisco 1150x content switches (Arrowpoint)?
In fact, I do:
[@ldap cfg]$ cat css.template
$head_lines .= <<ECHO
#.....................................................................
# Processor utilization.
#
ECHO
;
snmpMIB_to_OID("/usr/share/snmp/mibs/apent.mib");
snmpMIB_to_OID("/usr/share/snmp/mibs/chassismgrext.mib");
my (@temp) =
snmpwalk($router_connect,'apChassisMgrExtSubModuleCPUInstantaneous');
my $first=0;
foreach my $tempi(@temp) {
$tempi =~ /([\d\.]+):\d/;
my $instance=$1;
my $target_name=$router_name.".cpu.".$instance;
my $inmenu="no";
if ($first++ == 0) { $inmenu="yes"; }
$target_lines .= <<CPU
Target[$target_name]:
apChassisMgrExtSubModuleCPUInstantaneous.$instance&apChassisMgrExtSubModuleCPUInstantaneous.$instance:$router_connect
MaxBytes[$target_name]: 100
routers.cgi*ShortDesc[$target_name]: CPU $instance
routers.cgi*InMenu[$target_name]: $inmenu
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, noi
Directory[$target_name]: $directory_name
WithPeak[$target_name]: wmy
YLegend[$target_name]: % Utilization
ShortLegend[$target_name]: %
Legend1[$target_name]: 1 Second Load
LegendI[$target_name]: CPU :
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
;
}
$first = 0;
my (@temp) =
snmpwalk($router_connect,'apChassisMgrExtSubModuleInstalledMemory');
foreach my $tempi(@temp) {
$tempi =~ /([\d\.]+):(.+)/;
my $instance=$1;
my $maxsize = $2;
my $inmenu="no";
if ($first++ == 0) { $inmenu="yes"; }
my $target_name=$router_name.".memory.".$instance;
$target_lines .= <<DISK
#--------------------------------------------------------------------------------------
# Memory Utilization
Target[$target_name]:
apChassisMgrExtSubModuleSystemHeapFree.$instance&apChassisMgrExtSubModuleSystemHeapFree.$instance:$router_connect
YLegend[$target_name]: Bytes Free
Options[$target_name]: gauge, unknaszero,noi
Directory[$target_name]: $directory_name
MaxBytes[$target_name]: $maxsize
ShortLegend[$target_name]: bytes
routers.cgi*ShortDesc[$target_name]: Memory $instance
routers.cgi*InMenu[$target_name]: $inmenu
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
LegendI[$target_name]: Free
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
;
}
snmpMIB_to_OID("/usr/share/snmp/mibs/cntsvcext.mib");
my (@temp) = snmpwalk($router_connect,'apCntsvcSvcName');
foreach my $tempi(@temp) {
$tempi =~ /([\d\.]+):(.+)/;
my $instance=$1;
my ($owner) =
snmpget($router_connect,"apCntsvcOwnName.$instance");
#print "$owner\n";
next if $owner =~ /trouble/;
my $description = $2;
my $target_name=$router_name.'.'.$description.'.hits';
my $maxsize = 100;
my $absmaxsize=10000;
$target_lines .= <<HITS
#--------------------------------------------------------------------------------------
# Hits
Target[$target_name]: apCntsvcHits.$instance&apCntsvcHits.$instance:
$router_connect
YLegend[$target_name]: hits
Options[$target_name]: unknaszero, noi, perminute
Directory[$target_name]: $directory_name
MaxBytes[$target_name]: $maxsize
AbsMax[$target_name]: $absmaxsize
ShortLegend[$target_name]: Hits
routers.cgi*ShortDesc[$target_name]: $description Hits
routers.cgi*Icon[$target_name]: www-sm.gif
bb*host[$target_name]: $router_name
bb*svc[$target_name]: mrtg
bb*red[$target_name]: 99%
bb*yellow[$target_name]: 98%
LegendI[$target_name]: Hits
WithPeak[$target_name]: ymw
Title[$target_name]: $sysname
PageTop[$target_name]: <H1>Hits on $description/H1>
<TABLE>
<TR><TD>System:</TD><TD>$sysname </TD></TR>
<TR><TD>Location:</TD><TD>$syslocation </TD></TR>
<TR><TD>Table:</TD><TD>$description </TD></TR>
</TABLE>
HITS
;
my $target_name=$router_name.".".$description.".bytes";
my $maxsize = 125000000;
$target_lines .= <<BYTES
#--------------------------------------------------------------------------------------
# Bytes
Target[$target_name]: apCntsvcBytes.$instance&apCntsvcBytes.$instance:
$router_connect
YLegend[$target_name]: bits
Options[$target_name]: unknaszero, noi, bits
Directory[$target_name]: $directory_name
MaxBytes[$target_name]: $maxsize
ShortLegend[$target_name]: bits
routers.cgi*ShortDesc[$target_name]: $description bits
routers.cgi*Icon[$target_name]: traffic-sm.gif
bb*host[$target_name]: $router_name
bb*svc[$target_name]: mrtg
bb*red[$target_name]: 99%
bb*yellow[$target_name]: 98%
LegendI[$target_name]: Hits
WithPeak[$target_name]: ymw
Title[$target_name]: $sysname
PageTop[$target_name]: <H1>Bytes on $description/H1>
<TABLE>
<TR><TD>System:</TD><TD>$sysname </TD></TR>
<TR><TD>Location:</TD><TD>$syslocation </TD></TR>
<TR><TD>Table:</TD><TD>$description </TD></TR>
</TABLE>
BYTES
;
my $target_name=$router_name.".".$description.".state";
$target_lines .= <<STATE
#--------------------------------------------------------------------------------------
# State
Target[$target_name]: apCntsvcState.$instance&apCntsvcState.$instance:
$router_connect|cssState
YLegend[$target_name]: State
Options[$target_name]: gauge, unknaszero, noi, integer
Directory[$target_name]: $directory_name
MaxBytes[$target_name]: 4
ShortLegend[$target_name]: Status
routers.cgi*ShortDesc[$target_name]: $description Status
routers.cgi*Icon[$target_name]: query-sm.gif
bb*host[$target_name]: $router_name
bb*svc[$target_name]: state
bb*yellow[$target_name]: 1
bb*red[$target_name]: 1.5
LegendI[$target_name]: State
WithPeak[$target_name]: ymw
Title[$target_name]: $sysname
PageTop[$target_name]: <H1>State Of $description/H1>
<TABLE>
<TR><TD>System:</TD><TD>$sysname </TD></TR>
<TR><TD>Location:</TD><TD>$syslocation </TD></TR>
<TR><TD>Table:</TD><TD>$description </TD></TR>
<TR><TD>States:</TD><TD>4 is UP, 2 is down</TD></TR>
</TABLE>
STATE
;
}
>
> Thanks.
>
> _______________________________________
> John K. Bracey, Sr. Network Analyst
> Communication Services - Network Operations
> California State University, Chico
> (530)898-5400
>
> _______________________________________________
> mrtg mailing list
> mrtg at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
--
Daniel J McDonald, CCIE # 2495, CISSP # 78281, CNX
Austin Energy
http://www.austinenergy.com
More information about the mrtg
mailing list