Page 1 of 2
Check_exi command setup
Posted: Fri Jan 13, 2017 5:46 pm
by scheema31
Hi,
im trying to monitor my esxi host using check_exi command but im getting errors.
here is what ive done so far:
1. install dependency yum install perl-Pod-Perldoc perl-CPAN openssl-devel to /usr/bin, all installed but one gave this warrning about a module:
Socket6 0.23 or newer
IO::Socket::INET6 2.71 or newer
2. downloaded and extracted tar zxvf VMware-vSphere-Perl-SDK-<version-number>.tar.gz to /root/vmware-vsphere-cli-distrib
3. run the /vmware-insatll.pl
4. downloaded check_esx3.pl from
https://exchange.icinga.com/exchange/check_esx3
5. put the file in my /nagios/libexec folder
6. setup the command:
Code: Select all
define command{
command_name check_esx_cpu
command_line $USER1$/check_esx $ESXUSER$/check_esx -H $HOSTADDRESS$ -u $ESXUSER$ -p $ESXPASSWORD$ -l cpu -s usage -w $ARG1$ -c $ARG2$ }
7. setup check command:
Code: Select all
define service{
use Generic-services
host_name SV-VMHOST-02.baynet.local
service_description CPU Load check_command
check_command check_esx_cpu!80!90
}
7. setup username and password in resource file
- when running the check through browser i get following error (Return code of 127 is out of bounds - plugin may be missing)
- when running the check from my linux box i get error /usr/bin/perl: symbol lookup error: /usr/lib64/perl5/auto/XML/LibXML/Common/Common.so: undefined symbol: Perl_Gthr_key_ptr
what am i missing here
thanks,
Re: Check_exi command setup
Posted: Mon Jan 16, 2017 12:13 pm
by tgriep
The command line looks like it is not configured correctly and that is causing the issue.
Try editing the command_line and change the following from
Code: Select all
command_line $USER1$/check_esx $ESXUSER$/check_esx -H $HOSTADDRESS$ -u $ESXUSER$ -p $ESXPASSWORD$ -l cpu -s usage -w $ARG1$ -c $ARG2$ }
to
Code: Select all
command_line $USER1$/check_esx3.pl -H $HOSTADDRESS$ -u $ESXUSER$ -p $ESXPASSWORD$ -l cpu -s usage -w $ARG1$ -c $ARG2$ }
Make sure the perl script is still called check_esx3.pl in the libexec folder, adjust it if necessary.
Save the settings and restart nagios by running
If you still have problems, provide a screen capture of the error and the output of the plugin when run from the command line.
Re: Check_exi command setup
Posted: Mon Jan 16, 2017 2:01 pm
by scheema31
Thanks for the update tgriep,
I updated the the command name to check_esx3.pl and updated the command line as you suggested:
Code: Select all
command_line $USER1$/check_esx3.pl -H $HOSTADDRESS$ -u $ESXUSER$ -p $ESXPASSWORD$ -l cpu -s usage -w $ARG1$ -c $ARG2$ }
Saved it and restarted nagios
However im still getting same error on my browser and when running the command on the server - please see attached screen shots.
is there maybe a dependency plugin i may be missing or needs to be updated?
Thanks!
Re: Check_exi command setup
Posted: Mon Jan 16, 2017 2:24 pm
by tgriep
Yes, it looks like there are missing prerequisites that the plugin needs, run the following as root and see if this will install them.
Code: Select all
yum install perl-Nagios-Plugin libuuid* perl-XML-LibXML -y
Then run the plugin from a command prompt to see if the plugin runs without any errors.
If it is good, then the check should work for you in Nagios.
Re: Check_exi command setup
Posted: Mon Jan 16, 2017 4:07 pm
by scheema31
okay awesome looks like some progress but still issue.
1. Ran the yum command to install/update missing prerequisites - all ran successfully
2. Ran command on server and got diffrerent error this time, looks like an issue with checking check_esx3.pl file:
Code: Select all
[root@someserver ~]# /usr/local/nagios/libexec/check_esx3.pl sv-vmhost-02
Use of uninitialized value in string eq at /usr/local/nagios/libexec/check_esx3.pl line 238.
Use of uninitialized value in string eq at /usr/local/nagios/libexec/check_esx3.pl line 238.
Use of uninitialized value in string eq at /usr/local/nagios/libexec/check_esx3.pl line 238.
Use of uninitialized value in string eq at /usr/local/nagios/libexec/check_esx3.pl line 238.
Use of uninitialized value in string eq at /usr/local/nagios/libexec/check_esx3.pl line 238.
Use of uninitialized value in numeric gt (>) at /usr/local/nagios/libexec/check_esx3.pl line 242.
Use of uninitialized value in numeric gt (>) at /usr/local/nagios/libexec/check_esx3.pl line 242.
Here is the output of those lines in check_esx3.pl file:
Code: Select all
Line #
234 sub validate_dataType {
235 my @validDataType = ("VMmem", "VMcpu", "HostMem", "HostCpu", "Datastore");
236 my $isvalid = 0;
237 foreach (@validDataType) {
238 if ($_ eq Opts::get_option ('dataType')) {
239 $isvalid = 1;
240 }
241 }
242 if ( Opts::get_option ('warning') > Opts::get_option ('critical') ) {
243 $isvalid = 0;
244 print "critical should be grather than warning\n";
245 }
246 return $isvalid;
247 }
248 return $isvalid;
249 }
Also on web page it now shows a different error:
(Return code of 255 is out of bounds)
Thanks!
Re: Check_exi command setup
Posted: Mon Jan 16, 2017 4:32 pm
by tgriep
You are going to have to upload that plugin here so we can view it?
There are a lot of revisions to that plugin and the lines that are giving you the error message do not exist in the version I have running.
The version I am using is in the link below. Version 0.7.1
https://github.com/shinken-monitoring/p ... er/libexec
Re: Check_exi command setup
Posted: Mon Jan 16, 2017 4:38 pm
by scheema31
I have attached the check_esx.pl file to view.
will i be able to edit it to make work or should i use the file you are testing with? if so please instruct on how i can go about reinstalling.
Thanks tgriep!
Re: Check_exi command setup
Posted: Mon Jan 16, 2017 4:57 pm
by tgriep
I ran the plugin that you uploaded and when you don't specify the options like the --hostIP, --warning, --critical,m etc., it will print out those messages so if you define your command with all of the required options, it should work for you.
Re: Check_exi command setup
Posted: Mon Jan 16, 2017 5:20 pm
by scheema31
hmm i think im trying that but same result, is this how you are testing on your server?
Code: Select all
[root@someserver ~]# /usr/local/nagios/libexec/check_esx3.pl --hostIP 10.10.xx.xx --username xxxx --password xxxx
should this not be enough to make a simple check?
Thanks,
Re: Check_exi command setup
Posted: Mon Jan 16, 2017 5:26 pm
by scheema31
okay i think ive made some progress, sorry i wasnt using the correct options before.
this is what i have but its a diffrerent errror now:
Code: Select all
[root@someserver ~]# /usr/local/nagios/libexec/check_esx3.pl --hostIP 10.10.xx.xx --dataType VMcpu --username xxxx --password xxxx --warning 80 --critical 90
length() used on @array (did you mean "scalar(@array)"?) at /usr/lib64/perl5/IO/Compress/Zlib/Extra.pm line 198.
thanks!