[mrtg] Temerature reading on netapp 2020
Steve Shipway
s.shipway at auckland.ac.nz
Fri Jul 25 00:43:57 CEST 2008
> 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