[mrtg] error in temperature oid

McDonald, Dan Dan.McDonald at austinenergy.com
Wed Sep 9 01:10:20 CEST 2009


On Tue, 2009-09-08 at 15:40 -0400, NAP wrote:
> ### I can’t to read temperature in my cisco 6509, 

if you are running IOS, you will need to troll the entity-sensor-mib to
find the various sensors.  Temperature based sensors have a SensorType
of "8".  For example, I have 66 temperature sensors on one of my 6500's:

snmpwalk -v 3 -l authpriv -u luser1 -a sha -x des -3k0x1.. -3K0x8.. -m
ENTITY-SENSOR-MIB tlc-net-4 entPhySensorType | grep 8$
ENTITY-SENSOR-MIB::entPhySensorType.41 8
ENTITY-SENSOR-MIB::entPhySensorType.45 8
ENTITY-SENSOR-MIB::entPhySensorType.49 8
ENTITY-SENSOR-MIB::entPhySensorType.1003 8
ENTITY-SENSOR-MIB::entPhySensorType.1004 8
ENTITY-SENSOR-MIB::entPhySensorType.1005 8
ENTITY-SENSOR-MIB::entPhySensorType.1006 8
ENTITY-SENSOR-MIB::entPhySensorType.1009 8
ENTITY-SENSOR-MIB::entPhySensorType.1010 8
ENTITY-SENSOR-MIB::entPhySensorType.1011 8
ENTITY-SENSOR-MIB::entPhySensorType.2003 8
[...]

Once you know the instances that are interesting, you can gather the
other details:
snmpwalk [...] -m ENTITY-MIB tlc-net-4 entPhysicalTable | grep \\.41\ 
ENTITY-MIB::entPhysicalDescr.41 "VTT-E FRU 1 outlet temperature Sensor"
ENTITY-MIB::entPhysicalVendorType.41
SNMPv2-SMI::enterprises.9.12.3.1.8.33
ENTITY-MIB::entPhysicalContainedIn.41 39
ENTITY-MIB::entPhysicalClass.41 8
ENTITY-MIB::entPhysicalParentRelPos.41 2
ENTITY-MIB::entPhysicalName.41 "VTT 1 outlet temperature Sensor"

snmpwalk [...] -m ENTITY-SENSOR-MIB tlc-net-4 entPhySensorTable | grep
\.41\ 
ENTITY-SENSOR-MIB::entPhySensorType.41 8
ENTITY-SENSOR-MIB::entPhySensorScale.41 9
ENTITY-SENSOR-MIB::entPhySensorPrecision.41 0
ENTITY-SENSOR-MIB::entPhySensorValue.41 39
ENTITY-SENSOR-MIB::entPhySensorOperStatus.41 1
ENTITY-SENSOR-MIB::entPhySensorUnitsDisplay.41 ""
ENTITY-SENSOR-MIB::entPhySensorValueTimeStamp.41 812657610
ENTITY-SENSOR-MIB::entPhySensorValueUpdateRate.41 30 milliseconds

It is recommended that you use a template to script the discovery of the
various entity sensor instances, as well as the scaling information.
Here is a fragment of a template that I use to graph receive power on
10-Gig optics.  You would need to create something similar for $ttype 8
as opposed to $ttype 14 as is shown here:
#
# Look for dBm meters - probably interesting

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 = 10   if ($maxsize < 0) ;
                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
;
} 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.oetiker.ch/pipermail/mrtg/attachments/20090908/18cf4eea/attachment.pgp 


More information about the mrtg mailing list