| Cheshire Cat Computing http://steveshipway.org/forum/ |
|
| mrtg_nrpe : MRTG plugin to query Nagios NRPE agent http://steveshipway.org/forum/viewtopic.php?f=35&t=1645 |
Page 1 of 1 |
| Author: | stevesh [ Mon Sep 29, 2008 4:43 pm ] | ||
| Post subject: | mrtg_nrpe : MRTG plugin to query Nagios NRPE agent | ||
|
|||
| Author: | stevesh [ Tue Oct 21, 2008 5:24 pm ] | ||
| Post subject: | Re: mrtg_nrpe : MRTG plugin to query Nagios NRPE agent | ||
I now have a pure-C version of this, using the utils.c module from the check_nrpe Nagios plugin code by Ethan Galstead. This has a much smaller footprint than the Perl version and is faster. However, I have only compiled under Linux and you may well need to make changes to compile under other UNIXes. I doubt it would compile under Windows at all. This is version 2.8: fixed bugs in previous posting.
|
|||
| Author: | barhamd [ Fri Feb 13, 2009 6:37 am ] |
| Post subject: | Re: mrtg_nrpe : MRTG plugin to query Nagios NRPE agent |
Can you give me any advice on using nrpe? running a check_nrpe gives:- ./check_nrpe -H {IP} -c CheckDriveSize -a Drive="C:\\" ShowAll MaxWarn=80% MaxCrit=90% OK: C:\: 501G|'C:\'=24%;80;90; trying to run /usr/local/bin/mrtg-nrpe NRPEOPTS -H 134.244.155.8 -d -o 1 -x -M -c CheckDriveSize -a Drive="C:\\" ShowAll MaxWarn=80% MaxCrit=90%Recording option=[o] Saving offset=[1]=1 to slot 0 Recording option=[x] Recording option=[M] Recording option=[c] Recording option=[a] Starting alarm for 10 sec Starting queries Seeking offset 1 Opening connection to host... Creating socket... Connecting... Setting reuseaddr... SSL handshake Building query -> [CheckDriveSize] [Drive=C:\] Sending data using SSL Sent 1036 bytes from 1036 Receiving data (1036 bytes) Closing down SSL connection Closing down socket Testing data Parsing data [OK: All drives within bounds.] Processed: 0.00, Returning 0.000000 Returning 0.000000 0.000000 0.000000 OK: All drives within bounds. I can't see how I get the option to pick up the 501G bit of the return strick. thanks David |
|
| Author: | stevesh [ Fri Feb 13, 2009 10:04 am ] |
| Post subject: | Re: mrtg_nrpe : MRTG plugin to query Nagios NRPE agent |
| Author: | barhamd [ Sat Feb 14, 2009 3:08 am ] |
| Post subject: | Re: mrtg_nrpe : MRTG plugin to query Nagios NRPE agent |
Brilliant! that works perfectly! Setting 'MaxBytes' to the size of the drive means I even get the percentage correct. Target[cbrintsvr18.cbr.ugs.com.c]: `/usr/local/bin/mrtg-nrpe -H 134.244.155.8 -M -c CheckDriveSize -a "Drive=C:\\" -a ShowAll -a "MaxWarn=80%" -a "MaxCrit=90%"` Options[cbrintsvr18.cbr.ugs.com.c]: gauge,growright,noo MaxBytes[cbrintsvr18.cbr.ugs.com.c]: 2047 Title[cbrintsvr18.cbr.ugs.com.c]: C drive usage YLegend[cbrintsvr18.cbr.ugs.com.c]: C drive ShortLegend[cbrintsvr18.cbr.ugs.com.c]: Gb LegendI[cbrintsvr18.cbr.ugs.com.c]: Used Many thanks for your help David |
|
| Author: | stevesh [ Mon Feb 16, 2009 9:55 am ] |
| Post subject: | Re: mrtg_nrpe : MRTG plugin to query Nagios NRPE agent |
A Best Practice recommendation for when you're monitoring drive space is to store the values in Bytes, not in K or M or G. So, if your mrtg-nrpe check is returning the data in Mb, then add '* 1024000' to the end of the Target definition, which will mean that the value is multipled by 1024000 before storing - IE, it will be stored in bytes. This means that MaxBytes will of course need to be 2048000000 if you want 2GB. Then, you will not need to set ShortLegend, or the fixunit or kMG options as the multipliers will all be done correctly (you may not have realised yet what will happen as the values fall below 1) Another nice trick is that, if your plugin is returning a 'used' and a 'size' value, you can use 'dorelpercent' to have MRTG graph the first as a percentage of the second - IE, percentage used. |
|
| Page 1 of 1 | All times are UTC + 12 hours [ DST ] |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|