[mrtg] Temerature reading on netapp 2020

Lennie Wennerlund lennie at bioinvent.com
Fri Jul 25 12:22:38 CEST 2008


Hello.

I can't still get it working.
I have talk to netapp and the don't have separate OID´s for the temperature.

When I running the mrtg whit you config I get this error

root at mrtg:/etc/mrtg/test# env LANG=C /usr/bin/mrtg /etc/mrtg/test/netapp.cfg
2008-07-25 12:16:31: ERROR: Target[netapptempone][_IN_] 'encTempSensorsCurrentTemp.1& encTempSensorsCurrentTemp. $target->[0]{$mode} ' (eval): Bareword "encTempSensorsCurrentTemp" not allowed while "strict subs" in use at (eval 17) line 1.
Bareword "encTempSensorsCurrentTemp" not allowed while "strict subs" in use at (eval 17) line 1.

2008-07-25 12:16:31: ERROR: Target[netapptempone][_OUT_] 'encTempSensorsCurrentTemp.1& encTempSensorsCurrentTemp. $target->[0]{$mode} ' (eval): Bareword "encTempSensorsCurrentTemp" not allowed while "strict subs" in use at (eval 18) line 1.
Bareword "encTempSensorsCurrentTemp" not allowed while "strict subs" in use at (eval 18) line 1.

Me MyConversions.pl file look like this

sub getitem($$) {
        my(@l) = split " ",$_[0];
        my($t) = $l[$_[1]*2];
        return $1 if($t =~ /(\d+)/);
        return "UNKNOWN";
}
sub netappTempone   { return getitem($_[0],0); }
sub netappTemptwo   { return getitem($_[0],1); }
sub netappTempthree { return getitem($_[0],2); }
sub netappTempfour  { return getitem($_[0],3); }

and the mrtg netapp.cfg look like this

root at mrtg:/etc/mrtg/test# more netapp.cfg
######################################################################
# Multi Router Traffic Grapher -- Sample Configuration File
######################################################################
# This file is for use with mrtg-2.5.4c

# Global configuration
RunAsDaemon: no
EnableIPv6: no
WorkDir: /var/www/mrtg/test
#Options[_]: bits,growright
WriteExpires: Yes

LoadMIBS: /etc/mrtg/mibs/netapp.mib
ConversionCode: /etc/mrtg/MyConversions.pl

#Title[^]: Traffic Analysis for


######################################################################


Target[netappTempOne]:encTempSensorsCurrentTemp.1& encTempSensorsCurrentTemp.1:public at 10.3.20.10|netappTempone
SetEnv[netappTempOne]: MRTG_INT_DESCR="1"
MaxBytes[netappTempOne]: 100
ShortLegend[netappTempOne]: degC
LegendI[netappTempOne]: 1:
Legend1[netappTempOne]: first sensor temperature
Legend3[netappTempOne]: peak first sensor temp
Title[netappTempOne]: Temp - Netapp 1 FS01
PageTop[netappTempOne]: <h1>Temp-Netapp 1 FS01</h1>
Options[netappTempOne]: noo
routers.cgi*Options[netappTempOne]: unscaled fixunit nomax nopercent
routers.cgi*Graph[netappTempOne]: netappTemp
routers.cgi*ShortDesc[netappTempOne]: Sensor 1
routers.cgi*InMenu[netappTempOne]: no


root at mrtg:/etc/mrtg/test#

when I run mrtg whit debug=tarp,snpo,log I get this information

root at mrtg:/etc/mrtg/test# env LANG=C /usr/bin/mrtg /etc/mrtg/test/netapp.cfg --debug=tarp,snpo,log
--tarp: Starting netapptempone -> encTempSensorsCurrentTemp.1& encTempSensorsCurrentTemp.1:public at 10.3.20.10|netappTempone
--tarp: &targparser external done: 'encTempSensorsCurrentTemp.1& encTempSensorsCurrentTemp.1:public at 10.3.20.10|netappTempone'
--tarp: &targparser complex done: 'encTempSensorsCurrentTemp.1& encTempSensorsCurrentTemp.1:public at 10.3.20.10|netappTempone'
--tarp: New simple target [0] '1:public at 10.3.20.10|netappTempone':
  Comu:  public, Host: 10.3.20.10
  Opt:   , IPv4: 1
  Conv:  netappTempone
  OID:   ifInOctets, ifOutOctets
  IfSel: If, If
  Key:   1, 1
--tarp: &targparser simple done: 'encTempSensorsCurrentTemp.1& encTempSensorsCurrentTemp. $target->[0]{$mode} '
--tarp: &targparser returning: unique = 0
--snpo: run snmpget from ifInOctets&ifOutOctets:public at 10.3.20.10
--snpo: simple If: .1
--snpo: simple If: .1
--snpo: SNMPGet from public at 10.3.20.10 -- ifInOctets.1,ifOutOctets.1,sysUptime,sysName
--snpo: SNMPfound -- '134645627', '8038855', '9 days, 23:47:06', 'fs01.BIOINVENT.NET'
2008-07-25 12:19:46: ERROR: Target[netapptempone][_IN_] 'encTempSensorsCurrentTemp.1& encTempSensorsCurrentTemp. $target->[0]{$mode} ' (eval): Bareword "encTempSensorsCurrentTemp" not allowed while "strict subs" in use at (eval 17) line 1.
Bareword "encTempSensorsCurrentTemp" not allowed while "strict subs" in use at (eval 17) line 1.

2008-07-25 12:19:46: ERROR: Target[netapptempone][_OUT_] 'encTempSensorsCurrentTemp.1& encTempSensorsCurrentTemp. $target->[0]{$mode} ' (eval): Bareword "encTempSensorsCurrentTemp" not allowed while "strict subs" in use at (eval 18) line 1.
Bareword "encTempSensorsCurrentTemp" not allowed while "strict subs" in use at (eval 18) line 1.

--log: Called /usr/bin/rateup /var/www/mrtg/test/ netapptempone 1216981186 -Z u -1 -1 100 c #00cc00 #0000ff #006600 #ff00ff -o k 1000 i /var/www/mrtg/test/netapptempone-day.png -100 -100 400 100 1 1 0 300 0 4 1 %Y-%m-%d %H:%M 0
root at mrtg:/etc/mrtg/test#


______________________________________________________________________________________________
 
Kind Regards
Lennie Wennerlund


-----Ursprungligt meddelande-----
Från: Steve Shipway [mailto:s.shipway at auckland.ac.nz] 
Skickat: den 25 juli 2008 00:44
Till: Lennie Wennerlund; 'mrtg at lists.oetiker.ch'
Ämne: RE: Temerature reading on netapp 2020


> 1.3.6.1.4.1.789.1.21.1.2.1.25.1
> SNMPv2-SMI::enterprises.789.1.21.1.2.1.25.1 = STRING: "33C (91F), 31C
> (87F), 30C (86F), 34C (93F)"

Doesn't the device produce these values as separate OIDs?  It seems a bit strange that they are only available as a string.  Four separate SNMP OIDs would be much easier to manage.

>Target[netappTemp]:encTempSensorsCurrentTemp.1:public at 10.3.20.10|netappTemp

MRTG will ALWAYS takes EXACTLY TWO values.  Also, both values are passed to the postprocessing script with no additional parameters.  So, you should instead have:

Target[netappTempOne]:encTempSensorsCurrentTemp.1& encTempSensorsCurrentTemp.1:public at 10.3.20.10|netappTempone

Which will extract the string (twice) and pass it to the postprocess function (twice).  So, you need multiple postprocess functions to extract different positions in the string.

> The Problem is the MyConversion.pl file. I don't know what I write inside
> it.

sub getitemn($$) {
        my(@l) = split " ",$_[0];
        my($t) = $l[$_[1]*2];
        return $1 if($t =~ /(\d+)/);
        return "UNKNOWN";
}
sub netappTempone   { return getitem($_[0],0); }
sub netappTemptwo   { return getitem($_[0],1); }
sub netappTempthree { return getitem($_[0],2); }
sub netappTempfour  { return getitem($_[0],3); }

Now, this means you can only have one of the 4 temperatures per MRTG graph, so you use the 'noo' option and create 4 targets (one per item).  If you user Routers2, you can create a userdefined graph to put all 4 lines on one image:

Target[netappTempOne]:encTempSensorsCurrentTemp.1& encTempSensorsCurrentTemp.1:public at 10.3.20.10|netappTempone
SetEnv[netappTempOne]: MRTG_INT_DESCR="1"
MaxBytes[netappTempOne]: 100
ShortLegend[netappTempOne]: degC
LegendI[netappTempOne]: 1:
Legend1[netappTempOne]: first sensor temperature
Legend3[netappTempOne]: peak first sensor temp
Title[netappTempOne]: Temp - Netapp 1 FS01
PageTop[netappTempOne]: <h1>Temp-Netapp 1 FS01</h1>
Options[netappTempOne]: noo
routers.cgi*Options[netappTempOne]: unscaled fixunit nomax nopercent
routers.cgi*Graph[netappTempOne]: netappTemp
routers.cgi*ShortDesc[netappTempOne]: Sensor 1
routers.cgi*InMenu[netappTempOne]: no

Target[netappTempTwo]:encTempSensorsCurrentTemp.1& encTempSensorsCurrentTemp.1:public at 10.3.20.10|netappTemptwo
SetEnv[netappTempTwo]: MRTG_INT_DESCR="2"
MaxBytes[netappTempTwo]: 100
ShortLegend[netappTempTwo]: degC
LegendI[netappTempTwo]: 2:
Legend1[netappTempTwo]: second sensor temperature
Legend3[netappTempTwo]: peak second sensor temp
Title[netappTempTwo]: Temp - Netapp 1 FS01
PageTop[netappTempTwo]: <h1>Temp-Netapp 1 FS01</h1>
Options[netappTempTwo]: noo
routers.cgi*Options[netappTempTwo]: unscaled fixunit nomax nopercent
routers.cgi*Graph[netappTempTwo]: netappTemp
routers.cgi*ShortDesc[netappTempTwo]: Sensor 2
routers.cgi*InMenu[netappTempTwo]: no

then repeat for the other 2 sensors.  See how  the Target line specifies a different postprocess function each time - the new function extracts a different number from the list.  The routers2 extended options define a summary graph, and hide the individual graphs from the menu.

This explanation got a bit out of hand, I've been writing MRTG documentation examples this week...

Steve



More information about the mrtg mailing list