Page 2 of 2

Re: Check_exi command setup

Posted: Mon Jan 16, 2017 5:43 pm
by ssax
Does your username or password have special characters in it? If so, you might try surrounding them with single quotes:

Code: Select all

--username 'xxxx' --password 'xxxx'

Re: Check_exi command setup

Posted: Mon Jan 16, 2017 5:51 pm
by tgriep
I found a link that says the following perl module (IO::Compress::Zlib::Extra) needs to be updated.
Login to the server as root and run the following command to do that.

Code: Select all

cpan IO::Compress::Zlib::Extra

Re: Check_exi command setup

Posted: Mon Jan 16, 2017 6:08 pm
by scheema31
tgriep - I ran the perl module update which completed, ran the command again and this time i don't get an error but command does not return anything either, just waiting for input... ive attached screenshot

ssax - thanks for the suggestion but my username nor password contain special characters, however i tried it with single quotes but that did not help.

thanks!

Re: Check_exi command setup

Posted: Tue Jan 17, 2017 10:22 am
by tgriep
It looks like if you do not specify a Virtual Machine, or a Datastore, etc., the plugin will walk through all of the hosts and guests in your VMWare network so it could take a long time to run.
Try using specific guests, datastores in the command and that should make it run faster.

Re: Check_exi command setup

Posted: Tue Jan 17, 2017 1:42 pm
by scheema31
Excellet!
it worked when running on my server :)
[root@someserver ~]# /usr/local/nagios/libexec/check_esx3.pl --hostIP 10.10.xx.xx --dataType Datastore --datacenter /vmfs/volumes/somedatastore_01 --username user --password pass --warning 80 --critical 90
MYDATASTORE_01 : 84 % Used MYDATASTORE_02 : 83 % Used

now how should my command line looks for it to run on web? i dont think what i have is correct:

Code: Select all

define command{
		command_name check_esx_datastore
		command_line $USER1$/check_esx3.pl -H $HOSTADDRESS$ -u $ESXUSER$ -p $ESXPASSWORD$ -l datastore -s usage -w $ARG1$ -c $ARG2$ }

Code: Select all

define service{ 
	use 			        Generic-services 
	host_name 		SV-VMHOST-02
	service_description 	Datastore MYDATASTORE
	check_command 	check_esx_datastore!80!90  }
Thanks,

Re: Check_exi command setup

Posted: Tue Jan 17, 2017 2:34 pm
by tgriep
You could create your command like the example below. You may have to tweak it to get it to work.

Code: Select all

command_line $USER1$/check_esx3.pl --hostIP $HOSTADDRESS$ --dataType Datastore --datacenter /vmfs/volumes/somedatastore_01 --username $ESXUSER$ --password $ESXPASSWORD$ --warning $ARG1$ --critical $ARG2$

Re: Check_exi command setup

Posted: Tue Jan 17, 2017 3:26 pm
by scheema31
thanks that made some progress, i can make checks but returns a warning state with an error (attached picture)
looks like another plugin install/update?

thanks!

Re: Check_exi command setup

Posted: Tue Jan 17, 2017 4:18 pm
by tgriep
Yes, looks like another perl module needs to be installed.
Run this as root to install that

Code: Select all

yum install perl-Crypt-SSLeay -y
Most sites you download plugins from, should have instructions on installing and creating commands, take a look at them for more details.

Re: Check_exi command setup

Posted: Wed Jan 18, 2017 1:14 pm
by scheema31
Perfect that did the trick, my checks are now successful on server and through browser.

Thanks for all your help Tgriep!

Re: Check_exi command setup

Posted: Wed Jan 18, 2017 1:31 pm
by tgriep
That is good to hear. I'll close and lock this post as solved. If you have any other issues / questions, feel free to open a new post.