Nagios XI disk name problem

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
tzidore
Posts: 12
Joined: Wed May 06, 2015 10:52 am

Nagios XI disk name problem

Post 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?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios XI disk name problem

Post 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?
Former Nagios employee
tzidore
Posts: 12
Joined: Wed May 06, 2015 10:52 am

Re: Nagios XI disk name problem

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios XI disk name problem

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios XI disk name problem

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
tzidore
Posts: 12
Joined: Wed May 06, 2015 10:52 am

Re: Nagios XI disk name problem

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

Re: Nagios XI disk name problem

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked