check_nrpe check_disk issue


#1

I am using check_nrpe to call check_disk on a remote machine. The remote partition should display a warning message but is not doing so. Iam able to recreate the problem via the command line. Here is what I am talking about:

[nagios@dtjhayden ~]$ /usr/local/nagios/libexec/check_nrpe -H diskserver -c check_disk -a "20 10 /mnt/big"
DISK WARNING - free space: /mnt/big 641201 MB (13% inode=99%);| /mnt/big=3981604MB;4693427;;0;4693447
This what I would expect to see but when I do this

[nagios@dtjhayden ~]$ /usr/local/nagios/libexec/check_nrpe -H diskserver -c check_disk -a 20 10 /mnt/big
DISK OK - free space: /mnt/big 641201 MB (13% inode=99%);| /mnt/big=3981604MB;4693427;4693437;0;4693447
This is what I see (and is also what is showing up in my logs). I am guessing that nagios is doing the latter and not the former (ie. not quoting the argument list).

Is there any way for me to fix this via configuration files etc?

Thanks in advance

John


#2

Ok,

A bit more info about this issue. It is only happening with my linux boxes. My windows server return the correct warnings but the linux machines are problematic. Could it be that I have compiled the plugins (check_disk or check_nrpe) incorrectly on the linux machines? Any clues would be appreciated.

John


#3

Hi!

just a quick question: when you run “check_disk” as a user logged on “diskserver”, with the right arguments (like “./check_disk 20 10 /mnt/big”, what is the output ?


#4

Good question and interesting results!

Check_disk with integers:
[root@diskserver ~]# /usr/local/nagios/libexec/check_disk -w 20 -c 10 -p /mnt/big
DISK OK - free space: /mnt/big 640801 MB (13% inode=99%);| /mnt/big=3982005MB;4693427;4693437;0;4693447

Check_disk with percentages:
[root@diskserver ~]# /usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /mnt/big
DISK WARNING - free space: /mnt/big 640801 MB (13% inode=99%);| /mnt/big=3982005MB;3754757;4224102;0;4693447

I need to look in the documentation and see if these 2 commands should be equivalent. In the meantime, I have changed my call of

check_command check_nrpe!check_disk!20!10!/mnt/big to
check_command check_nrpe!check_disl!20%!10%!/mnt/big and that solves my problem

Just seems like odd behavior

I’ll keep an eye here in case anyone comes up with an answer

Thx

John


#5

too bad … now that you mention it, I knew the problem, cause I add the same 2 months ago :confused:
my mistake :wink:


#6

Ok,

My bad! I just looked in the source code for check_disk and the two command forms are NOT equivalent! One is for percents (obviously) and the other is for units. Just not sure why my initial command line test with and without quotes worked the way it does.

Oh well, a project for another day in ALL my spare time. Hah!

Thx again everyone