Page 1 of 1

Nagios XI disk name problem

Posted: Mon Jun 15, 2015 6:38 am
by tzidore
Hi

I am rather new to the whole world of Nagios.

I've been setting up 10-15 machines and haven't had to hard a time doing so, but now I have a problem.
I imagine it is a rather easy question to answer.

I have a Mac OS X 10.9.5 server running on nagios just fine. I have a nfs drive attached and would like to check if the drive is mounted.

I thought that this would do the trick:
check_nrpe!check_disk!-a '-w 20% -c 10% -p /Volumes/Example\ Digital\ Delivery'

I think the problem is the name of the drive, it contains spaces between the words, as it is called "Example Digital Delivery"

How can I make the nagios server see the nfs drive?

Re: Nagios XI disk name problem

Posted: Mon Jun 15, 2015 9:17 am
by tmcdonald
Try this:

Code: Select all

check_nrpe!check_disk!-a '-w 20% -c 10% -p "/Volumes/Example Digital Delivery"'
And what error do you get when using the one you currently have?

Re: Nagios XI disk name problem

Posted: Tue Jun 16, 2015 5:52 am
by tzidore
Thank for replying.

here is what I get on the string suggested:
COMMAND: /usr/local/nagios/libexec/check_nrpe -H 10.0.0.191 -t 30 -c check_disk -a '-w 20% -c 10% -p -a '-w 20% -c 10% -p "/Volumes/Example Digital Delivery\\"\'
OUTPUT: Incorrect command line arguments supplied

And this is what I got on the other

COMMAND: /usr/local/nagios/libexec/check_nrpe -H 10.0.0.191 -t 30 -c check_disk -a '-w 20% -c 10% -p /Volumes/Postyr\\ Digital\\ Delivery'
OUTPUT: CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

Re: Nagios XI disk name problem

Posted: Tue Jun 16, 2015 10:44 am
by abrist
You may not be able to pass the partition through nrpe as quotes are illegal characters. Your best bet may be to hardcode the path for the command in the remote in nrpe.cfg and then run the check from nagios without the path declared. There is a branch of nrpe around that removes quotes from the illegal characters, but do understand that this has serious potential security consequences.

Re: Nagios XI disk name problem

Posted: Tue Jun 16, 2015 10:55 am
by lmiltchev
OK, try the following:

1. Modify the "check_disk" command definition on the client in the "/usr/local/nagios/etc/nrpe/common.cfg" (or nrpe.cfg) to look like this:

Code: Select all

command[check_disk]=/usr/local/nagios/libexec/check_disk "$ARG1$"
Note: Basically, wrap the arg in double quotes.

Restart xinetd so that changes can take effect (or restart nrpe if it is running as a standalone daemon):

Code: Select all

service xinetd restart
2. Test your command from the command line on the Nagios XI server (don't test from within CCM; do it in a ssh/putty terminal):

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 10.0.0.191 -t 30 -c check_disk -a '-w 20% -c 10% -p /Volumes/Example Digital Delivery'
Let me know if this worked.

Re: Nagios XI disk name problem

Posted: Thu Jun 25, 2015 6:11 am
by tzidore
Hi again

It doesn't work. It is conflicting with the fact that it is a VMware machine.

DISK CRITICAL - /Volumes/VMware Shared Folders is not accessible: Input/output error

Re: Nagios XI disk name problem

Posted: Thu Jun 25, 2015 10:36 am
by lmiltchev
Strange...this is working for me:

on the client:

Code: Select all

[root@speedking ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_speedking-lv_root
                       18G   12G  4.9G  71% /
tmpfs                 2.0G     0  2.0G   0% /dev/shm
/dev/sda1             477M  104M  348M  23% /boot
tmpfs                  50M     0   50M   0% /Volumes/Example Digital Delivery

[root@speedking ~]# grep "check_disk" /usr/local/nagios/etc/nrpe/common.cfg
command[check_disk]=/usr/local/nagios/libexec/check_disk "$ARG1$"
on the Nagios XI server:

Code: Select all

[root@testbox etc]# /usr/local/nagios/libexec/check_nrpe -H 192.168.x.x -t 30 -c check_disk -a '-w 20% -c 10% -p /Volumes/Example Digital Delivery'
DISK OK - free space: / 4953 MB (29% inode=72%); /dev/shm 1962 MB (100% inode=99%); /boot 347 MB (77% inode=99%); /Volumes/Example Digital Delivery 50 MB (100% inode=99%);| /=11698MB;14035;;0;17544 /dev/shm=0MB;1569;;0;1962 /boot=103MB;380;;0;476 '/Volumes/Example Digital Delivery'=0MB;40;;0;50
I am not sure why it's not working for you. Can you show us how the "check_disk" is defined on the client and how you test it from the XI server?