Incomplete status information

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
dihavs
Posts: 5
Joined: Fri May 10, 2013 5:50 am

Incomplete status information

Post 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
}
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: Incomplete status information

Post 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
dihavs
Posts: 5
Joined: Fri May 10, 2013 5:50 am

Re: Incomplete status information

Post 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)]
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Incomplete status information

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
dihavs
Posts: 5
Joined: Fri May 10, 2013 5:50 am

Re: Incomplete status information

Post 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...
dihavs
Posts: 5
Joined: Fri May 10, 2013 5:50 am

Re: Incomplete status information

Post 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!
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Incomplete status information

Post by sreinhardt »

Ha that would do it! Thanks for letting us know
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked