Page 1 of 2

Reporting correct partition free space of linux OS

Posted: Tue Nov 20, 2012 12:46 pm
by AWS
CentOS release 5.8 (Final)
32bit
2012R1.2
Manual Install of XI
Are you using a proxy: transparent
Are you using SSL: No
*********************************************

I'm trying to monitor a pfSense 2.0.1 server (FreeBSD 8.1-RELEASE-p6 amd64). If I configure my check as:

Code: Select all

Check Command: check_local_disk
$ARG1$: 20%
$ARG2$: 10%
$ARG3$: /
No errors are returned and this is displayed:
DISK OK - free space: / 213145 MB (98% inode=99%):
Which feels about right. However, if I want to also monitor my /var, /usr and swap partitions, I get the same exact output even if I change $ARG3$ to "/var", "/usr", "swap" respectively (not really sure what is the right mount point or variable for checking the swap, but I'll deal with that later).

If I change to NRPE my check command becomes (as a simple test):

Code: Select all

Check Command: check_nrpe
$ARG1$: CheckDriveSize
$ARG2$: -a ShowAll MinWarnFree=10% MinCritFree=5% CheckAll=volumes
and output is:
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
Do I have to define a nrpe command on the pfSense side and call it "CheckDriveSize" or am I missing something pretty basic here? The "remote server logs" say:
Nov 20 09:34:12 nrpe[38877]: Client request was invalid, bailing out...
Nov 20 09:34:12 nrpe[38877]: Error: Request contained command arguments, but argument option is not enabled!
Any starting ideas?
thanks.

Re: Reporting correct partition free space of linux OS

Posted: Tue Nov 20, 2012 2:31 pm
by slansing
Can you post the check command string you are using to test with from your Nagios Terminal?

Re: Reporting correct partition free space of linux OS

Posted: Tue Nov 20, 2012 2:54 pm
by AWS
test with NRPE:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 10.1.1.254 -t 30 -c CheckDriveSize -a ShowAll MinWarnFree=10% MinCritFree=5% CheckAll=volumes
result:
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
test for check_disk:
for /

Code: Select all

/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /
result:
DISK OK - free space: / 213144 MB (98% inode=99%);| /=3956MB;183132;206024;0;228916
for /usr

Code: Select all

/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /usr
result:
DISK OK - free space: / 213143 MB (98% inode=99%);| /=3956MB;183132;206024;0;228916
for /var

Code: Select all

/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /var
result:
DISK OK - free space: / 213143 MB (98% inode=99%);| /=3956MB;183132;206024;0;228916
thank you.

Re: Reporting correct partition free space of linux OS

Posted: Tue Nov 20, 2012 3:02 pm
by scottwilkerson
Can you run the following

Code: Select all

df -h
This plugin can only check different mount point not paths on a filesystem

For this command

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 10.1.1.254 -t 30 -c CheckDriveSize -a ShowAll MinWarnFree=10% MinCritFree=5% CheckAll=volumes
Try wrapping the -a arguments in quotes

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 10.1.1.254 -t 30 -c CheckDriveSize -a 'ShowAll MinWarnFree=10% MinCritFree=5% CheckAll=volumes'

Re: Reporting correct partition free space of linux OS

Posted: Tue Nov 20, 2012 3:38 pm
by AWS
From the pfSense box I'm trying to monitor:

Code: Select all

[2.0.1-RELEASE][root@pfsense.**edit**.local]/root(1): df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ad6s1a     24G     83M     22G     0%    /
devfs          1.0K    1.0K      0B   100%    /dev
/dev/ad6s1d    116G    470M    106G     0%    /usr
/dev/ad6s1e     77G    111M     71G     0%    /var
[2.0.1-RELEASE][root@pfsense.**edit**.local]/root(2):
Wrapping the -a parameters in single or double quotes results in
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
I really like that dh-f command. Can that be used somehow within NagiosXI? That shows what I want to see.

Thanks.

Re: Reporting correct partition free space of linux OS

Posted: Tue Nov 20, 2012 3:57 pm
by lmiltchev
/usr/local/nagios/libexec/check_nrpe -H 10.1.1.254 -t 30 -c CheckDriveSize -a ShowAll MinWarnFree=10% MinCritFree=5% CheckAll=volumes
This looks like NSClient++ (windows agent) stuff... Let me clarify, you are trying to monitor a linux box, correct? What document did you follow to set this up?

Re: Reporting correct partition free space of linux OS

Posted: Tue Nov 20, 2012 4:00 pm
by slansing
In addition if you did not compile the NRPE installation yourself you must use SSL, the error regarding "0 bytes received" is typically an SSL error. If you were to recompile NRPE for no SSL you can switch that option off in the configuration file.

Re: Reporting correct partition free space of linux OS

Posted: Tue Nov 20, 2012 4:18 pm
by AWS
lmiltchev wrote:
/usr/local/nagios/libexec/check_nrpe -H 10.1.1.254 -t 30 -c CheckDriveSize -a ShowAll MinWarnFree=10% MinCritFree=5% CheckAll=volumes
This looks like NSClient++ (windows agent) stuff... Let me clarify, you are trying to monitor a linux box, correct? What document did you follow to set this up?
.... I followed the example of ... other... Windows servers... Yeah. Ok. :lol: :oops: Can we just erase the previous posts and start fresh? Thank you for that enlightening bit of knowledge. Sorry to waste your time on that!
slansing wrote:
In addition if you did not compile the NRPE installation yourself you must use SSL, the error regarding "0 bytes received" is typically an SSL error. If you were to recompile NRPE for no SSL you can switch that option off in the configuration file.
No, I didn't compile anything. I'll look into the SSL stuff for "0 bytes received". So, using the command that does work,

Code: Select all

/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /
is there a reason why I get the exact same output for every linux box I have configured? localhost (Nagios) has the same result as the pfSense server and the -p switch with either "/", "/var" or "/usr" all output the same:
DISK OK - free space: / 213138 MB (98% inode=99%);| /=3961MB;183132;206024;0;228916

Re: Reporting correct partition free space of linux OS

Posted: Tue Nov 20, 2012 4:29 pm
by BanditBBS
Check disk I believe is checking the local disk(Nagios server), not the remote server. You need to use NRPE to check remote server.

Re: Reporting correct partition free space of linux OS

Posted: Tue Nov 20, 2012 5:16 pm
by scottwilkerson
BanditBBS is correct.

Have you installed an agent on the machine you are trying to monitor?