Check_exi command setup

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.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Check_exi command setup

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

Re: Check_exi command setup

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
scheema31
Posts: 90
Joined: Wed Jun 06, 2012 1:11 pm

Re: Check_exi command setup

Post 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!
Attachments
nagios3.png
nagios3.png (5.21 KiB) Viewed 3264 times
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Check_exi command setup

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
scheema31
Posts: 90
Joined: Wed Jun 06, 2012 1:11 pm

Re: Check_exi command setup

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

Re: Check_exi command setup

Post 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$
Be sure to check out our Knowledgebase for helpful articles and solutions!
scheema31
Posts: 90
Joined: Wed Jun 06, 2012 1:11 pm

Re: Check_exi command setup

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

Re: Check_exi command setup

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
scheema31
Posts: 90
Joined: Wed Jun 06, 2012 1:11 pm

Re: Check_exi command setup

Post by scheema31 »

Perfect that did the trick, my checks are now successful on server and through browser.

Thanks for all your help Tgriep!
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Check_exi command setup

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked