[mrtg] error in temperature oid

Mike Mitchell Mike.Mitchell at sas.com
Thu Sep 10 15:57:15 CEST 2009


Multiple cards in a 6500 have temperature sensors.  The Supervisor won't always have the OID index of '1'.
I use the following script to average the multiple temperature sensors:

=========== CUT =========
#!/usr/bin/perl
#
# Find the input and output temperature in a Cisco 6500 chassis
#
use lib qw(/opt/mrtg/lib/mrtg2);
use SNMP_util;

$desc = "1.3.6.1.4.1.9.9.13.1.3.1.2";           # TemperatureStatusDescr
$valu = "1.3.6.1.4.1.9.9.13.1.3.1.3";           # TemperatureStatusValue

$In = 0;
$InC = 0;
$Ou = 0;
$OuC = 0;
$Ot = 0;
$OtC = 0;
$hst = shift(@ARGV);
$hst .= ":::::2" unless ($hst =~ /:/);          # switch to SNMPv2

snmpmaptable($hst, \&fillTemp, $desc, $valu);

$In = int(($In * 1.8 / $InC) + 32.5) if ($InC);         # Average the temps
$Ou = int(($Ou * 1.8 / $OuC) + 32.5) if ($OuC);         # Convert C to F

if ($In == 0 && $Ou == 0) {
    $Ot = int(($Ot * 1.8 / $OtC) + 32.5) if ($OtC);
    print "$Ot\n$Ot\n";
} else {
    print "$In\n$Ou\n";
}
exit 0;

sub fillTemp($@)
{
    my($ind, $desc, $val) = @_;

    if ($val > 2) {     # ignore dead sensors
        if (($desc =~ /Intake/i)||($desc =~ /Inlet/i)) {
            $In += $val;
            $InC++;
        } elsif (($desc =~ /Exhaust/i)||($desc =~ /Outlet/i)) {
            $Ou += $val;
            $OuC++;
        } else {
            $Ot += $val;
            $OtC++;
        }
    }
}
=========== CUT =========
You'll have to adjust the 'use lib qw(/opt/mrtg/lib/mrtg2);' line to specify where you've installed MRTG.
Just pass the script the hostname and community in the form 'community at host' and it will print out the inlet temperature and outlet temperature.

Mike Mitchell

-----Original Message-----
From: mrtg-bounces at lists.oetiker.ch [mailto:mrtg-bounces at lists.oetiker.ch] On Behalf Of Sean Cheesman
Sent: Thursday, September 10, 2009 9:31 AM
To: NAP; mrtg at lists.oetiker.ch
Subject: Re: [mrtg] error in temperature oid

I just polled my 6513 with SUP720-3BXL with that OID and received a gauge32 response.  Is there a chance your supervisor card doesn't support that gauge?  I assume you can poll other OID's on that chassis with no problem?

________________________________________
From: mrtg-bounces at lists.oetiker.ch [mrtg-bounces at lists.oetiker.ch] On Behalf Of NAP [nap at etecsa.cu]
Sent: Thursday, September 10, 2009 9:16 AM
To: mrtg at lists.oetiker.ch
Subject: [mrtg] error in temperature oid

I cant get value in this OID. This is on ciso catalyts 6509 (IOS Version
12.2(33)SXH4)

snmpget -v 2c -c napgate 200.0.16.126 1.3.6.1.4.1.9.9.13.1.3.1.3.1
SNMPv2-SMI::enterprises.9.9.13.1.3.1.3.1 = No Such Instance currently
exists at this OID


--
VP Operaciones de la Red
AG-8 (Grupo Gestion NAP)
Tel: (537) 885-4242 / 885-4646

_______________________________________________
mrtg mailing list
mrtg at lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg

_______________________________________________
mrtg mailing list
mrtg at lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg



More information about the mrtg mailing list