Check_VMWARE_API Plugin not working

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Re: Check_VMWARE_API Plugin not working

Postby kwhogster » Wed Mar 13, 2019 6:14 pm

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: 578
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA

Re: Check_VMWARE_API Plugin not working

Postby kwhogster » Wed Mar 13, 2019 8:03 pm

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

Re: Check_VMWARE_API Plugin not working

Postby lmiltchev » Thu Mar 14, 2019 8:32 am

Can you upload your plugin on the forum? I would like to test it in house. Thank you!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
QA Manager
 
Posts: 12025
Joined: Mon May 23, 2011 12:15 pm

Re: Check_VMWARE_API Plugin not working

Postby kwhogster » Thu Mar 14, 2019 11:13 pm

Here it is

check_vmware_api.pl
plugin
(166.12 KiB) Downloaded 14 times
kwhogster
 
Posts: 578
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA

Re: Check_VMWARE_API Plugin not working

Postby lmiltchev » Fri Mar 15, 2019 8:45 am

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 40 times

Test the new plugin to see if it fixes your issue.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
QA Manager
 
Posts: 12025
Joined: Mon May 23, 2011 12:15 pm

Re: Check_VMWARE_API Plugin not working

Postby kwhogster » Fri Mar 15, 2019 9:02 am

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

Re: Check_VMWARE_API Plugin not working

Postby lmiltchev » Fri Mar 15, 2019 9:33 am

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;;
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
QA Manager
 
Posts: 12025
Joined: Mon May 23, 2011 12:15 pm

Re: Check_VMWARE_API Plugin not working

Postby kwhogster » Fri Mar 15, 2019 9:47 am

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

Re: Check_VMWARE_API Plugin not working

Postby lmiltchev » Fri Mar 15, 2019 10:04 am

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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
QA Manager
 
Posts: 12025
Joined: Mon May 23, 2011 12:15 pm

Re: Check_VMWARE_API Plugin not working

Postby kwhogster » Fri Mar 15, 2019 10:18 am

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

PreviousNext

Return to Nagios Core

Who is online

Users browsing this forum: arfhan, Bing [Bot], EOjuile, Google [Bot], stburri and 32 guests