Page 1 of 1

Incomplete status information

Posted: Fri May 10, 2013 6:00 am
by dihavs
When i run this code from /usr/local/nagios/libexec/

Code: Select all

./check_disk.pl -i /,/volume1/photo/Upload,/volumeUSB1/usbshare,/volume1/photo/Top,/tmp,/opt -w 20G -c 30G -v -H 172.23.2.14 -u root
I get this output: DISK OK [/volume1 1.6T (45% free)]

When i create a servicecheck, the Nagios interface only shows: DISK OK (Not the part between the brackets). How can i get the verbose description to show up in Nagios?

This is the checkcommand:

Code: Select all

}
define command {
                command_name                          check_linux_volumes
                command_line                          $USER1$/check_disk.pl -H $HOSTADDRESS$ -v -u root -i $ARG1$ -w $ARG2$ -c $ARG3$
}
This is the service:

Code: Select all

}

define service {
                service_description                   Data Volume
                check_command                         check_linux_volumes!/,/volume1/photo/Upload,/volumeUSB1/usbshare,/volume1/photo/Top,/tmp,/opt!-w 500G!-c 200G!!
                host_name                             dsbks014
                check_period                          24x7
                notification_period                   24x7
                max_check_attempts                    5
                check_interval                        10
                retry_interval                        2
                event_handler_enabled                 0
                use                                   local-service
                contact_groups                        +admins
}

Re: Incomplete status information

Posted: Fri May 10, 2013 9:08 am
by gshergill
Hi dihavs,

There's a mistake in your service definition check_command.

For $ARG2$ and $ARG3$ you have "-w 500G" and "-c 200G!!"

This line should really say, based on your command line input;

Code: Select all

check_command                         check_linux_volumes!/,/volume1/photo/Upload,/volumeUSB1/usbshare,/volume1/photo/Top,/tmp,/opt!20G!30G
Kind Regards,

Gary Shergill

Re: Incomplete status information

Posted: Fri May 10, 2013 9:46 am
by dihavs
Thank you for your reply.
I have tried several combinations of checkcommands and services, see this example, same results.
It seems that Nagios don't want to eat the "-v" option. When i run the command from shell without "-v", i get "DISK OK".

Service:

Code: Select all

check_linux_volumes!root!/,/volume1/photo/Upload,/volumeUSB1/usbshare,/volume1/photo/Top,/tmp,/opt!500G!200G!
Checkcommand:

Code: Select all

command_line                          $USER1$/check_disk.pl -H $HOSTADDRESS$ -u $ARG1$ -i $ARG2$ -w $ARG3$ -c $ARG4$ -v

Code: Select all

./check_disk.pl -i /,/volume1/photo/Upload,/volumeUSB1/usbshare,/volume1/photo/Top,/tmp,/opt -w 500G -c 200G -H 192.168.10.20 -u root
DISK OK

./check_disk.pl -i /,/volume1/photo/Upload,/volumeUSB1/usbshare,/volume1/photo/Top,/tmp,/opt -w 500G -c 200G -H 192.168.10.20 -u root -v
DISK OK [/volume1 1.6T (45% free)]

Re: Incomplete status information

Posted: Fri May 10, 2013 10:53 am
by sreinhardt
Have you tried placing the -v flag in another location on the check command? Also you might try specifying $ARG5$ after -v, even though it will not be in use and will not need to be filled in, it might force nagios to accept the extra flag.

Re: Incomplete status information

Posted: Fri May 10, 2013 11:30 am
by dihavs
sreinhardt wrote:Have you tried placing the -v flag in another location on the check command? Also you might try specifying $ARG5$ after -v, even though it will not be in use and will not need to be filled in, it might force nagios to accept the extra flag.
Yes i have, it does not make any difference. I have also tried to use quotation marks between some parts of the command, but no fix so far...

Re: Incomplete status information

Posted: Fri May 10, 2013 12:10 pm
by dihavs
Solved the issue; the ssh authentication key was only valid for my root account. I created another one for the nagios user. Now it works like a charm :)

Thanks for your help!

Re: Incomplete status information

Posted: Fri May 10, 2013 2:56 pm
by sreinhardt
Ha that would do it! Thanks for letting us know