box293_check_vmware.pl plugin timed out Nagios Core 3.4.1

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.
miracledisease
Posts: 13
Joined: Wed Sep 10, 2014 9:11 am

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

Post 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"
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

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

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
miracledisease
Posts: 13
Joined: Wed Sep 10, 2014 9:11 am

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

Post 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!
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

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

Post 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$\""
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
miracledisease
Posts: 13
Joined: Wed Sep 10, 2014 9:11 am

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

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

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

Post by tmcdonald »

I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee
Locked