Check_VMWARE_API Plugin not working

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.
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Check_VMWARE_API Plugin not working

Post by kwhogster »

I got it working now

Found it in two other locations

root@tgcs017:/usr/local/nagios/libexec# ./check_vmware_api.pl -H Myhost-8 -D MTDatacenter
Usage: check_vmware_api.pl -D <data_center> | -H <host_name> [ -C <cluster_name> ] [ -N <vm_name> ]
-u <user> -p <pass> | -f <authfile>
-l <command> [ -s <subcommand> ] [ -T <timeshift> ] [ -i <interval> ]
[ -x <black_list> ] [ -o <additional_options> ]
[ -t <timeout> ] [ -w <warn_range> ] [ -c <crit_range> ]
[ -V ] [ -h ]

Missing argument: command


Anyone have a valid command as an example?
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Check_VMWARE_API Plugin not working

Post by kwhogster »

I got a sample but it errors out.

root@tgcs017:/usr/local/nagios/libexec# ./check_vmware_api.pl -H MYHOST-3 -u myroot -p "##########" -l runtime -s status
Undefined subroutine &Nagios::Monitoring::Plugin::plugin_exit called at ./check_vmware_api.pl line 824.


This is line 824 in check_vmware_api.pl

$np->plugin_exit($result, $output);


Any ideas?
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Check_VMWARE_API Plugin not working

Post by lmiltchev »

Can you upload your plugin on the forum? I would like to test it in house. Thank you!
Be sure to check out our Knowledgebase for helpful articles and solutions!
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Check_VMWARE_API Plugin not working

Post by kwhogster »

Here it is
check_vmware_api.pl
plugin
(166.12 KiB) Downloaded 216 times
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Check_VMWARE_API Plugin not working

Post by lmiltchev »

Make a backup of your original plugin:

Code: Select all

mv check_vmware_api.pl check_vmware_api.pl.backup
Download the plugin below, and place it in the plugins directory.
check_vmware_api.pl
(166.38 KiB) Downloaded 380 times
Test the new plugin to see if it fixes your issue.
Be sure to check out our Knowledgebase for helpful articles and solutions!
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Check_VMWARE_API Plugin not working

Post by kwhogster »

Now working..

Thank you.

do you have any sample checks I can set up?

I ran this one

root@tgcs017:/usr/local/nagios/libexec# ./check_vmware_api.pl -H MYHOST-3 -u root -p "###############" -l runtime -s status
CHECK_VMWARE_API.PL OK - overall status=green


I tried this

root@tgcs017:/usr/local/nagios/libexec# ./check_vmware_api.pl -D MY-Datacenter -u root -p "############" -l runtime -s status
CHECK_VMWARE_API.PL CRITICAL - Server version unavailable at 'https://TGCSNET-Datacenter:443/sdk/vimService.wsdl' at /usr/share/perl/5.22/VMware/VICommon.pm line 734.



Thank you

Tom
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Check_VMWARE_API Plugin not working

Post by lmiltchev »

You could try some basic checks as these:

Code: Select all

./check_vmware_api.pl -H MYHOST-3 -u root -p "###############" -l -l "CPU" 
./check_vmware_api.pl -H MYHOST-3 -u root -p "###############" -l "VMFS" 
./check_vmware_api.pl -H MYHOST-3 -u root -p "###############" -l "IO" 
./check_vmware_api.pl -H MYHOST-3 -u root -p "###############" -l "MEM" 
./check_vmware_api.pl -H MYHOST-3 -u root -p "###############" -l "NET" 
./check_vmware_api.pl -H MYHOST-3 -u root -p "###############" -l "SERVICE" 
./check_vmware_api.pl -H MYHOST-3 -u root -p "###############" -l "RUNTIME" 
Depending on what you would like to monitor, and what metrics are available, you could "narrow down" the output by using a subcommand ("-s").

Example:

Code: Select all

[root@main-nagios-xi var]# /usr/local/nagios/libexec/check_vmware_api.pl -H <ip address> -u <username> -p <password> -l "NET"
CHECK_VMWARE_API.PL OK - net receive=1165.00 KBps, send=5918.00 KBps, all 2 NICs are connected | net_receive=1165.00;; net_send=5918.00;; OK_NICs=2;; Bad_NICs=0;;

[root@main-nagios-xi var]# /usr/local/nagios/libexec/check_vmware_api.pl -H <ip address> -u <username> -p <password> -l "NET" -s usage
CHECK_VMWARE_API.PL OK - net usage=5005.00 KBps | net_usage=5005.00;;
Be sure to check out our Knowledgebase for helpful articles and solutions!
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Check_VMWARE_API Plugin not working

Post by kwhogster »

Thank you that's what I was looking for.


The plugin is timing out


root@tgcs017:/usr/local/nagios/libexec# ./check_vmware_api.pl -H MYHOST-1 -u root -p "#########" -l "CPU"
CHECK_VMWARE_API.PL UNKNOWN - plugin timed out (timeout 30s)
root@tgcs017:/usr/local/nagios/libexec# ./check_vmware_api.pl -H Myhost-1 -u root -p "############" -l runtime -s status
CHECK_VMWARE_API.PL UNKNOWN - plugin timed out (timeout 30s)
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Check_VMWARE_API Plugin not working

Post by lmiltchev »

Hmm, the default timeout is quite a bit - 30 sec.
-t, --timeout=INTEGER
Seconds before plugin times out (default: 30)
You could try increasing the timeout to see if this is going to resolve the issue:

Code: Select all

./check_vmware_api.pl -H MYHOST-1 -t 50 -u root -p "#########" -l "CPU"
There must be some other issue though... Try increasing the verbosity in order to debug the problem:

Code: Select all

./check_vmware_api.pl -H MYHOST-1 -u root -p "#########" -l "CPU" -vvv
Be sure to check out our Knowledgebase for helpful articles and solutions!
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Check_VMWARE_API Plugin not working

Post by kwhogster »

root@tgcs017:/usr/local/nagios/libexec# ./check_vmware_api.pl -H myhost-2 -t 50 -u root -p "#########" -l runtime -s status -vvv
[extra-opts] check_vmware_api.pl -H muhost-2 -t 50 -u root -p ##My95hog -l runtime -s status -vvv
CHECK_VMWARE_API.PL UNKNOWN - plugin timed out (timeout 50s)
root@tgcs017:/usr/local/nagios/libexec# ./check_vmware_api.pl -H myhost-2 -t 120 -u root -p "##########" -l "CPU" -vvv
[extra-opts] check_vmware_api.pl -H myhost-2 -t 120 -u root -p ##My95hog -l CPU -vvv
CHECK_VMWARE_API.PL UNKNOWN - plugin timed out (timeout 120s)


Even upping it to 120 still time outs
Locked