Nagiosgraph some advice please?

hello…

i have installed nagiosgraph and its works great… i am trying to graph data returned by my check_nrpe commands run on my windows server, for example checking disk space:

here is my check command:
$USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c CheckDriveSize -a Drive=C: ShowAll=long MaxWarn=85% MaxCrit=90%

here is a my nagiosgraph log:

Input servicedescr:Disk Space C:
Input hostname:myhost
Input perfdata:
Input lastcheck:1131898498
Input output:oK: C:: Total: 37.3G - Used: 4.74G (12%) - Free: 32.5G (88%)

how do i take that and create a graph?

any help or suggestions would be appreciated.

thanks

g

I haven’t setup nagiosgraph, but I have setup nagiostat. Nagiostat install README explains how to set it up, and I"m sure there must be a readme for nagiosgraph.

But in short, you take that output that you pasted, you parse it and input the parsed data into a rrd table. First, though, you must follow the nagios docs that explain how to enable performance monitoring.

hello again…

thanks for the reply, my apologies for not being more clear…

everything works, my problem is that I am new to rrdtool etc… and I am not sure how to create a custom graph. been reading up, but was hoping someone could give me some pointers.

thanks

rrd has a huge learning curve and you won’t understand it from a few pointers in this forum. Study the man pages for each and every rrd command. There are several.

The key with nagiosgraph is understanding the map file. This works by using perl regexps to identify what sort of data Nagios has just spat out. You also have to let it know whether you’re getting perfdata or just normal output for the plugin. Looking at one entry in my map as follows

Service type: ntload

check command: check_nt -H Address -v CPULOAD -l5,70,90,30,70,90

output: CPU Load 9% (5 min average) 11% (30 min average)

perfdata: ‘5 min avg Load’=9%;70;80;0;100 ‘30 min avg Load’=11%;70;90;0;100

#/output:.?(d+)% .?(d+)% /
/perfdata:.*5 min avg Load=([0-9]+)%;[0-9]+;[0-9]+;[0-9]+;[0-9]+ 30 min avg Load
=([0-9]+)%;[0-9]+;[0-9]+;[0-9]+;[0-9]+/
and push @s, ntload,
avg05min, GAUGE, $1 ],
avg30min, GAUGE, $2 ] ];

So we’re only looking at perfdata outputted for this plugin. The 1st ([0-9]+)% is put in a guage type rrd called hostname_ntload_avg05min and the second into an rrd called hostname_ntload_avg30min.

As Jakkedup correctly guessed, there’s a lot of help both on the site and on the sourceforge pages. Again, being able to generate new entries for the map file is really the key.

To be honest, if I was in the poisition that you are now, I would go for nagiostat instead. Whilst nagiosgraph is pretty simple to get going, and it improved my understanding of perl regexps you are pretty limited in what you can output. When I get round to migrating my install to the box I’ve been promised for a while now I’ll going to convert to nagiosstat.

Oh and don’t even thing of trying APAN - a whole other world of horror awaits you there :smiley:

Sorry, for your example you’d use.
/output:C:.?[0-9]+%.?(.0-9]+)%.*?/
and push @s, ntdiskc,
pctused, GAUGE, $1 ] ];

thanks very much for the replies, i guess my biggest confusion is that i dont understand the regexp stuff…

thanks for the tip redtom, will definately look into it.

thanks again guys…

Yes, the regex is only one part though, that you will have trouble with. I have to agree, install nagiostat and I could help you alot more and possibly share some of my confusion. But I do know, that with nagiostat, they already had many examples of regex’s in the sample config file, so I just modified them to my needs, and learned as I went on. At least now, I know how to make my own regex’s that actually work sometimes, by doing using nagiostat.