Reporting correct partition free space of linux OS

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
AWS
Posts: 63
Joined: Fri May 13, 2011 4:33 pm
Location: Vancouver, WA

Reporting correct partition free space of linux OS

Post 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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Reporting correct partition free space of linux OS

Post by slansing »

Can you post the check command string you are using to test with from your Nagios Terminal?
AWS
Posts: 63
Joined: Fri May 13, 2011 4:33 pm
Location: Vancouver, WA

Re: Reporting correct partition free space of linux OS

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Reporting correct partition free space of linux OS

Post 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'
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
AWS
Posts: 63
Joined: Fri May 13, 2011 4:33 pm
Location: Vancouver, WA

Re: Reporting correct partition free space of linux OS

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Reporting correct partition free space of linux OS

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Reporting correct partition free space of linux OS

Post 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.
AWS
Posts: 63
Joined: Fri May 13, 2011 4:33 pm
Location: Vancouver, WA

Re: Reporting correct partition free space of linux OS

Post 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
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Reporting correct partition free space of linux OS

Post 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.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Reporting correct partition free space of linux OS

Post by scottwilkerson »

BanditBBS is correct.

Have you installed an agent on the machine you are trying to monitor?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked