[mrtg] newbie question: how to convert string -> value?

Freddie Cash fjwcash at gmail.com
Fri Feb 27 21:48:30 CET 2009


On February 27, 2009 3:26 am Evert wrote:
> A very basic/newbie question from me: I have an SNMP query (load average)
> which returns:
>     STRING: 0.35
>
> How do I configure this in mrtg.conf so that I get something I can graph?

If you are using MRTG in RRD mode, and using routers2.cgi to view it, all 
you need is to add the following for the target:

  routers.cgi*Options[targetname]: fixunit

That will graph the load average correctly, even though it's querying a 
string value via SNMP.

I've got it querying almost 80 servers using:

# 1 and 15 minute load averages
Target[server_load]:			laLoad.1&laLoad.3:netmon at server
SetEnv[server_load]:			MRTG_INT_DESCR="System: Load Avgs"
Title[server_load]:			System: Load Avgs
MaxBytes[server_load]:			100
ShortLegend[server_load]:
YLegend[server_load]:			Load Avg
Legend1[server_load]:			1-min:
Legend2[server_load]:			5-min:
Legend3[server_load]:			Peak 1-min:
Legend4[server_load]:			PeaK 15 min:
LegendI[server_load]:			1-min:
LegendO[server_load]:			5-min:
Options[server_load]:			nopercent gauge
routers.cgi*Options[server_load]:	nomax fixunit
routers.cgi*Icon[server_load]:		load-sm.gif

Which gives a nice graph like the attached image.

-- 
Freddie
fjwcash at gmail.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: loadaverages2.png
Type: image/png
Size: 25214 bytes
Desc: not available
Url : http://lists.oetiker.ch/pipermail/mrtg/attachments/20090227/6a511d39/attachment-0001.png 


More information about the mrtg mailing list