Nagiostat examples

I have gotten Nagiostat to work finally. Thanks to all the posts that I have read through over the past day ( I read alot).

I am struggling with creating new RRD templates though. For some reason it is not clicking and I’m not finding enough examples to try and see what is going on.

I want to create a template for CPULOAD. I am using the NSClient (not that matters probably). Can anyone share parts of their nagiostat.conf file?

Or can easily point to a thread that this has been discussed before on? I have searched so many pages and am not coming up with the right key words for what I need.

Thanks,

Adam

Specifically, I am looking for examples of PlotTemplates. That is where I am currently stuck. :slight_smile:

Depends on the output of the plugin. If it outputs loads, you can use something like this:
RRDCreateTemplate loadaverage --step 300 DS:1min:GAUGE:600:U:U DS:5min:GAUGE:600:U:U DS:15min:GAUGE:600:U:U RRA:AVERAGE:0.5:1:396 RRA:AVERAGE:0.5:6:336 RRA:AVERAGE:0.5:24:480 RRA:AVERAGE:0.5:234:480

PlotTemplate loadavg_1min --start $s --end $e -h 200 -w 600 DEF:1min=$f:1min:AVERAGE LINE2:1min#00A000:“1 minute load average” HRULE:15#D0D000:“Warning level” HRULE:30#E00000:“Critical level” GPRINT:1min:MAX:“1 minute load MAX\: %.4lg” GPRINT:1min:MIN:“1 minute load MIN\: %.4lg” GPRINT:1min:AVERAGE:“1 minute load average\: %.4lg” COMMENT:"See also graph_name=???-loadavg-5min and/or -15min"
PlotTemplate loadavg_5min --start $s --end $e -h 200 -w 600 DEF:5min=$f:5min:AVERAGE LINE2:5min#00A000:“5 minute load average” HRULE:10#D0D000:“Warning level” HRULE:25#E00000:“Critical level” GPRINT:5min:MAX:“5 minute load MAX\: %.4lg” GPRINT:5min:MIN:“5 minute load MIN\: %.4lg” GPRINT:5min:AVERAGE:“5 minute load average\: %.4lg” COMMENT:"See also graph_name=???-loadavg-1min and/or -15min"
PlotTemplate loadavg_15min --start $s --end $e -h 200 -w 600 DEF:15min=$f:15min:AVERAGE LINE2:15min#00A000:“15 minute load average” HRULE:5#D0D000:“Warning level” HRULE:20#E00000:“Critical level” GPRINT:15min:MAX:“15 min load MAX\: %.4lg” GPRINT:15min:MIN:“15 min load MIN\: %.4lg” GPRINT:15min:AVERAGE:“15 min load average\: %.4lg” COMMENT:“See also graph_name=???-loadavg-1min and/or -5min”

ValueRegexTemplate loadavg “output:1min:/load average: ([0-9.]+),/” “output:5min:/load average: [0-9.]+, ([0-9.]+),/” “output:15min:/load average: [0-9.]+, [0-9.]+, ([0-9.]+)/”

If i’t’s in cpu percent, instead of a 1,5,15 minute load, then maybe this:

RRDCreateTemplate cpupct --step 300 DS:Pct:GAUGE:600:0:5000 RRA:AVERAGE:0.5:1:396 RRA:AVERAGE:0.5:6:336 RRA:AVERAGE:0.5:24:480 RRA:AVERAGE:0.5:234:480

PlotTemplate cpu_pct --start $s --end $e DEF:Pct=$f:Pct:AVERAGE LINE2:Pct#00A000:“CPU usage in Percent (%)” HRULE:75#D0D000:“Warning level” HRULE:80#E00000:“Critical level” GPRINT:Pct:MAX:“CPU usage MAX\: %.4lg%%” GPRINT:Pct:MIN:“CPU usage MIN\: %.4lg%%” GPRINT:Pct:AVERAGE:“CPU usage average\: %.4lg%%”

ValueRegexTemplate cpu_pct_usage “output:Pct:/([0-9]+)/”

If it’s a dual cpu, let me know, i have that one too.

Cool thanks. I actually spent enough time banging my head against the plottemplates that I finally was able to come up with something that worked.

I actually ended up with something very close to your percentage one.

What I don’t understand and haven’t found any doc’s on yet is the $.4lg in the GPRINT command. Granted, I haven’t googled on GPRINT yet, just searched through RRDTool’s doc’s.

Thanks!