[mrtg] Host Template: Cisco 7609 Environmentals

Daniel McDonald dan.mcdonald at austinenergy.com
Fri May 28 13:59:24 CEST 2010


On 5/27/10 12:06 PM, "Jason Farrell" <Jason.Farrell at cogeco.com> wrote:

> Does anyone have the OID's or host template for temperature
> environmental for a Cisco 7609? I have them for 650x series and works
> but it seems to be different for 760x series:

It will be different for pretty much every chassis, maybe every boot.

I use the following snippet in my template to query the entity sensor mib,
examine the thresholds and sensors, and create useful configs.  This one is
particular to dB loss on optics, but you should be able to change the "next
if $ttype..." line more to your liking and set the units elsewhere more
appropriately.

#
# Look for dBm meters - probably interesting

snmpMIB_to_OID("/usr/share/snmp/mibs/ENTITY-MIB-V1SMI.my");
snmpMIB_to_OID("/usr/share/snmp/mibs/ENTITY-SENSOR-MIB.my");
snmpMIB_to_OID("/usr/share/snmp/mibs/CISCO-ENTITY-SENSOR-MIB-V1SMI.my");
        my (@est) = snmpwalk($router,$v3opt,'entSensorType');
        foreach my $esti (@est) {
        my ($tinstance,$ttype) = ($esti =~  /(\d+):(.+)$/) ;
        next if $ttype != 14;
                my (@estv) =
snmpwalk($router,$v3opt,'entSensorThresholdValue.'.$tinstance);
                my %thresh;
                foreach my $estvi (@estv) {
                        my ($thin,$value) = ($estvi =~ /(\d+):(.+)$/) ;
                        $thresh{$thin} = $value;
                        };
                my $maxsize = $thresh{1}+10;
                $maxsize =1 if $maxsize < 1;
                my ($sens_name) =
snmpget($router,$v3opt,'entPhysicalName.'.$tinstance);
        my $sens_descr .= ' '.$sens_name;
        my $target_name=$router_name.".signal".$tinstance;
        $target_lines .= <<SIGNAL
#---------------------------------------------------------------------------
-----------
# Signal Strength
    
Target[$target_name]:
entSensorValue.$tinstance&entSensorValue.$tinstance:$router
SnmpOptions[$target_name]: $v3options
YLegend[$target_name]: dB
Options[$target_name]: gauge, noi, nopercent
Directory[$target_name]: $directory_name
MaxBytes[$target_name]: $maxsize
ShortLegend[$target_name]: dB
Factor[$target_name]: .1
routers.cgi*ShortDesc[$target_name]: $sens_name
routers.cgi*Options[$target_name]: nototal
bb*host[$target_name]: $router_name
bb*svc[$target_name]: signal
bb*red[$target_name]: $thresh{4}:$thresh{1}
bb*yellow[$target_name]: $thresh{3}:$thresh{2}
Legend1[$target_name]: dB
WithPeak[$target_name]: ymw
Title[$target_name]: $sysname $sens_descr
PageTop[$target_name]: <H1>$sysname $sens_descr </H1>
 <TABLE>
   <TR><TD>System:</TD><TD>$sysname  </TD></TR>
   <TR><TD>Location:</TD><TD>$syslocation </TD></TR>
 </TABLE>
SIGNAL
;
} 
-- 
Daniel J McDonald, CCIE # 2495, CISSP # 78281



More information about the mrtg mailing list