Page 3 of 3

Re: box293_check_vmware.pl plugin timed out Nagios Core 3.4.

Posted: Fri May 22, 2015 12:09 pm
by miracledisease
When I run the command as a nagios user (su nagios) the results are as expected. When I run the commands from root it asked for the root password for the vMA. I a trying to achieve a correct configuration so that Nagios' web interface displays the results. Nagios displays

UNKNOWN: 'Host_OS_Name_Version10124$$$$$' is not a valid --check argument!

command.cfg:
define command{
command_name box293_check_vmware
command_line $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H 10.xxx.xxx.xxx -C "nice -n19 ~/box293_check_vmware.pl --server $ARG1$ --check $ARG2$\"$ARG3$\"\"$ARG$$\"\"$ARG5$\"\"$ARG6$\"\"$ARG7$\"\"$ARG8$\""
}

Linux.cfg:
define service{
use local-service
host_name 10.zzz.zzz.zzz
service_description vCenter Version1
check_command box293_check_vmware!$HOSTADDRESS$!vCenter_Name_Version!!!!!!
initial_state u
max_check_attempts 3
check_interval 1440
retry_interval 7
active_checks_enabled 1
check_period 24x7
register 1
}

Check command: as nagios user (su nagios)- checks work this way, as root user they do not......
/usr/local/nagios/libexec/check_by_ssh -E 1 -l vi-admin -H 10.xxx.xxx.xxx -C "~/box293_check_vmware.pl --server 10.zzz.zzz.zzz --check vCenter_Name_Version"

Re: box293_check_vmware.pl plugin timed out Nagios Core 3.4.

Posted: Fri May 22, 2015 2:01 pm
by tgriep
Could you edit the service check and hard code the IP address in it for a test?
Change this from

Code: Select all

check_command box293_check_vmware!$HOSTADDRESS$!vCenter_Name_Version!!!!!!
to

Code: Select all

check_command box293_check_vmware!10.zzz.zzz.zzz!vCenter_Name_Version!!!!!!
Also, could you run the command as nagios from the command line and post the output here?
I would like to see if there are and illegal characters in it.

Re: box293_check_vmware.pl plugin timed out Nagios Core 3.4.

Posted: Fri May 22, 2015 2:15 pm
by miracledisease
[nagios@nagios objects]$ /usr/local/nagios/libexec/check_by_ssh -E 1 -l vi-admin -H 10.xxx.xxx.xxx -C "~/box293_check_vmware.pl --server 10.zzz.zzz.zzz --check vCenter_Name_Version"
OK: VMware vCenter Server 5.5.0 build-xxxxxx

Nagios web interface output ----- after changing $HOSTADDRESS$ to 10.zzz.zzz.zzz
UNKNOWN: 'vCenter_Name_Version3337$$$$$' is not a valid --check argument!

Re: box293_check_vmware.pl plugin timed out Nagios Core 3.4.

Posted: Sun May 24, 2015 8:22 pm
by Box293
miracledisease wrote:command.cfg:
define command{
command_name box293_check_vmware
command_line $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H 10.xxx.xxx.xxx -C "nice -n19 ~/box293_check_vmware.pl --server $ARG1$ --check $ARG2$\"$ARG3$\"\"$ARG$$\"\"$ARG5$\"\"$ARG6$\"\"$ARG7$\"\"$ARG8$\""
}
All of these arguments need a space separating them AND what *should* be $ARG4$ is currently $ARG$$, these are both contributing to your issues. Here is what it should be::

Code: Select all

command_line $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H 10.xxx.xxx.xxx -C "nice -n19 ~/box293_check_vmware.pl --server $ARG1$ --check $ARG2$ \"$ARG3$\" \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""

Re: box293_check_vmware.pl plugin timed out Nagios Core 3.4.

Posted: Tue May 26, 2015 8:14 am
by miracledisease
Thank you guys for all your help. The check is finally producing desired results on the web interface. Now it is time to get more checks running. Again thank you to all the Nagios champs that helped out.

Re: box293_check_vmware.pl plugin timed out Nagios Core 3.4.

Posted: Tue May 26, 2015 9:08 am
by tmcdonald
I'll be closing this thread now, but feel free to open another if you need anything in the future!