[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Cheshire Cat Computing • View topic - mrtg_nrpe : MRTG plugin to query Nagios NRPE agent

Cheshire Cat Computing

Software support and information
It is currently Sat May 30, 2020 6:01 pm

All times are UTC + 12 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Mon Sep 29, 2008 4:43 pm 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand


Attachments:
File comment: Version 2.4
mrtg-nrpe.pl [11.7 KiB]
Downloaded 649 times

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11
Top
 Profile Send private message  
 
PostPosted: Tue Oct 21, 2008 5:24 pm 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
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.


Attachments:
File comment: Version 2.8
mrtg-nrpe.tar.gz [9.05 KiB]
Downloaded 632 times

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11
Top
 Profile Send private message  
 
PostPosted: Fri Feb 13, 2009 6:37 am 
Offline
User

Joined: Fri Feb 13, 2009 6:31 am
Posts: 2
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


Top
 Profile Send private message  
 
PostPosted: Fri Feb 13, 2009 10:04 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
PostPosted: Sat Feb 14, 2009 3:08 am 
Offline
User

Joined: Fri Feb 13, 2009 6:31 am
Posts: 2
Brilliant! that works perfectly! :D
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


Top
 Profile Send private message  
 
PostPosted: Mon Feb 16, 2009 9:55 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
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.

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 12 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group