Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

check_vmware_api

Rating
35 votes
Favoured:
8
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
check_vmware_api (former check_esx3) is a Nagios plugin made by op5 AB to monitor vmware's products.

The plugin uses the VMWare API (via HTTPS) to do a wide variety of checks. You can check out the latest version with GIT at git://git.op5.org/nagios/op5plugins.git Requires the Nagios::Plugin CPAN module as well as the "VMware Infrastructure (VI) Perl Toolkit Packages" available from http://www.vmware.com/download/sdk/ See http://www.op5.com/support/documentation/how-to/400-monitoring-vmware-esx-3x-and-vmware-esxi for Nagios Command definitions, although the latest version of the script supports additional checks which aren't listed on that webpage yet, so you'll probably need to make a few more up.
./check_vmware_api --help
check_vmware_api 0.6.0

This nagios plugin is free software, and comes with ABSOLUTELY NO WARRANTY.
It may be used, redistributed and/or modified under the terms of the GNU
General Public Licence (see http://www.fsf.org/licensing/licenses/gpl.txt).

VMWare Infrastructure plugin

Usage: check_vmware_api -D | -H [ -C ] [ -N ]
-u -p | -f
-l [ -s ] [ -T ] [ -i ]
[ -x ] [ -o ]
[ -t ] [ -w ] [ -c ]
[ -V ] [ -h ]

-?, --usage
Print usage information
-h, --help
Print detailed help screen
-V, --version
Print version information
--extra-opts=[
[@]]
Section and/or config_file from which to load extra options (may repeat)
-H, --host=
ESX or ESXi hostname.
-C, --cluster=
ESX or ESXi clustername.
-D, --datacenter=
Datacenter hostname.
-N, --name=
Virtual machine name.
-u, --username=
Username to connect with.
-p, --password=
Password to use with the username.
-f, --authfile=
Authentication file with login and password. File syntax :
username=
password=
-w, --warning=THRESHOLD
Warning threshold. See
http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT
for the threshold format.
-c, --critical=THRESHOLD
Critical threshold. See
http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT
for the threshold format.
-l, --command=COMMAND
Specify command type (CPU, MEM, NET, IO, VMFS, RUNTIME, ...)
-s, --subcommand=SUBCOMMAND
Specify subcommand
-S, --sessionfile=SESSIONFILE
Specify a filename to store sessions for faster authentication
-x, --exclude=
Specify black list
-o, --options=
Specify additional command options (quickstats, ...)
-T, --timestamp=
Timeshift in seconds that could fix issues with "Unknown error". Use values like 5, 10, 20, etc
-i, --interval=
Sampling Period in seconds. Basic historic intervals: 300, 1800, 7200 or 86400. See config for any changes.
Default value is 20 (realtime). Since cluster don't have realtime stats interval other than 20 is mandatory
--trace=
Set verbosity level of vSphere API request/respond trace
-t, --timeout=INTEGER
Seconds before plugin times out (default: 30)
-v, --verbose
Show details for command-line debugging (can repeat up to 3 times)
Supported commands(^ means blank or not specified parameter) :
Common options for VM, Host and DC :
* cpu - shows cpu info
+ usage - CPU usage in percentage
+ usagemhz - CPU usage in MHz
^ all cpu info
* mem - shows mem info
+ usage - mem usage in percentage
+ usagemb - mem usage in MB
+ swap - swap mem usage in MB
+ overhead - additional mem used by VM Server in MB
+ overall - overall mem used by VM Server in MB
+ memctl - mem used by VM memory control driver(vmmemctl) that controls ballooning
^ all mem info
* net - shows net info
+ usage - overall network usage in KBps(Kilobytes per Second)
+ receive - receive in KBps(Kilobytes per Second)
+ send - send in KBps(Kilobytes per Second)
^ all net info
* io - shows disk io info
+ read - read latency in ms (totalReadLatency.average)
+ write - write latency in ms (totalWriteLatency.average)
^ all disk io info
* runtime - shows runtime info
+ status - overall host status (gray/green/red/yellow)
+ issues - all issues for the host
^ all runtime info
VM specific :
* cpu - shows cpu info
+ wait - CPU wait time in ms
+ ready - CPU ready time in ms
* mem - shows mem info
+ swapin - swapin mem usage in MB
+ swapout - swapout mem usage in MB
+ active - active mem usage in MB
* io - shows disk I/O info
+ usage - overall disk usage in MB/s
* runtime - shows runtime info
+ con - connection state
+ cpu - allocated CPU in MHz
+ mem - allocated mem in MB
+ state - virtual machine state (UP, DOWN, SUSPENDED)
+ consoleconnections - console connections to VM
+ guest - guest OS status, needs VMware Tools
+ tools - VMWare Tools status
Host specific :
* net - shows net info
+ nic - makes sure all active NICs are plugged in
* io - shows disk io info
+ aborted - aborted commands count
+ resets - bus resets count
+ kernel - kernel latency in ms
+ device - device latency in ms
+ queue - queue latency in ms
* vmfs - shows Datastore info
+ (name) - free space info for datastore with name (name)
^ all datastore info
* runtime - shows runtime info
+ con - connection state
+ health - checks cpu/storage/memory/sensor status
+ storagehealth - storage status check
+ temperature - temperature sensors
+ maintenance - shows whether host is in maintenance mode
+ list(vm) - list of VMWare machines and their statuses
* service - shows Host service info
+ (names) - check the state of one or several services specified by (names), syntax for (names):,,...,
^ show all services
* storage - shows Host storage info
+ adapter - list bus adapters
+ lun - list SCSI logical units
+ path - list logical unit paths
* device - shows Host specific device info
+ cd/dvd - list vm's with attached cd/dvd drives
* uptime - shows Host uptime
DC specific :
* io - shows disk io info
+ aborted - aborted commands count
+ resets - bus resets count
+ kernel - kernel latency in ms
+ device - device latency in ms
+ queue - queue latency in ms
* vmfs - shows Datastore info
+ (name) - free space info for datastore with name (name)
^ all datastore info
* runtime - shows runtime info
+ list(vm) - list of VMWare machines and their statuses
+ listhost - list of VMWare esx host servers and their statuses
+ listcluster - list of VMWare clusters and their statuses
+ tools - VMWare Tools status
* recommendations - shows recommendations for cluster
+ (name) - recommendations for cluster with name (name)
^ all clusters recommendations


Copyright (c) 2008 op5
Reviews (22)
The plugin works great. However, I found one bug. The check, if a machine is in maintenance mode, does not work. It will always return the value you use for querying. E.g. if you add the paramter "mainwarn", it will always return WARNING regardless of the state of the machine.

The fix is quite easy. Just add "&& $runtime->inMaintenanceMode eq "1")" in the if-statements:

2280 if ($addopts eq "maintwarn" && $runtime->inMaintenanceMode eq "1") {
2281 $res = WARNING;
2282 }
2283 elsif ($addopts eq "maintcrit" && $runtime->inMaintenanceMode eq "1") {
2284 $res = CRITICAL;
2285 }
bydoro, December 7, 2015
Everything works with:

Ubuntu 14.04
Nagios Core 3.5.1-1ubuntu1
Perl 5.18.2
VMware Perl SDK: VMware-vSphere-Perl-SDK-5.5.0-1384587.x86_64.tar.gz

Path original VICommon.pm manually:

root@st:~/check_vmware_api# diff /usr/share/perl/5.18/VMware/VICommon.pm /usr/share/perl/5.18/VMware/VICommon.pm_orig
448d447
ssl_opts( SSL_verify_mode => 0 );
506c505
$ENV{PERL_NET_HTTPS_SSL_SOCKET_CLASS} = "Net::SSL";
530d528
ssl_opts( SSL_verify_mode => 0 );
2113d2110
ssl_opts( SSL_verify_mode => 0 );
root@st:~/check_vmware_api#




TEST:
Edit file generate_tests.pl:

root@st:~/check_vmware_api# time perl generate_tests.pl
CHECK_VMWARE_API.PL OK - Storages : 'local_datastore_1'(free)=907044.00 MB (95.86%), 'public_images'(free)=134284.75 MB (65.57%), 'vol258'(free)=281717.14 MB (62.34%) | local_datastore_1=907044.00MB;; public_images=134284.75MB;; vol258=281717.14MB;;
CHECK_VMWARE_API.PL UNKNOWN - vmhba0 (unknown); vmhba32 (unknown); vmhba33 (unknown); vmhba34 (unknown); vmhba35 (unknown); vmhba36 (unknown); | adapters=0units;;
CHECK_VMWARE_API.PL OK - Local ATA Disk (t10.ATA_____ST91000640NS________________________________________9XG4X7YW) ; | LUNs=1units;;
CHECK_VMWARE_API.PL OK - sata.vmhba0-sata.0:0-t10.ATA_____ST91000640NS________________________________________9XG4X7YW ; | paths=1units;;
CHECK_VMWARE_API.PL UNKNOWN - 0/6 adapters online, 1/1 LUNs ok, 1/1 paths active | adapters=0units;; LUNs=1units;; paths=1units;;
CHECK_VMWARE_API.PL OK - cpu usage=8.99 % | cpu_usage=8.99%;;
CHECK_VMWARE_API.PL OK - cpu usagemhz=2266.00 MHz | cpu_usagemhz=2266.00MHz;;
CHECK_VMWARE_API.PL OK - cpu usage=2266.00 MHz (8.99%) | cpu_usagemhz=2266.00MHz;; cpu_usage=8.99%;;
CHECK_VMWARE_API.PL OK - net usage=3352.00 KBps | net_usage=3352.00KBps;;
CHECK_VMWARE_API.PL OK - net receive=199.00 KBps | net_receive=199.00KBps;;
CHECK_VMWARE_API.PL OK - net send=3152.00 KBps | net_send=3152.00KBps;;
CHECK_VMWARE_API.PL OK - All 2 NICs are connected | OK_NICs=2;; Bad_NICs=0;;
CHECK_VMWARE_API.PL OK - net receive=199.00 KBps, send=3152.00 KBps, all 2 NICs are connected | net_receive=199.00KBps;; net_send=3152.00KBps;; OK_NICs=2;; Bad_NICs=0;;
CHECK_VMWARE_API.PL OK - connection state=connected
CHECK_VMWARE_API.PL OK - All 132 health checks are GREEN: Logging (3x); temperature (6x); fan (4x); Management Subsystem Health (4x); Memory (1x); CPU (2x); Software Components (87x); voltage (7x); power (6x); system (1x); Watchdog (4x); Battery (1x); Processors (6x); | Alerts=0;;
CHECK_VMWARE_API.PL UNKNOWN - Storage health status unavailable - make sure you have the "Storage Health" tab in your vSphere client | Alerts=0;;
CHECK_VMWARE_API.PL OK - All 6 temperature checks are GREEN: OK : [Device] Other 0 Inlet Temp --- Normal = 23 C, OK : Processor 1 PCH Temp --- Normal = 47 C, OK : Processor 1 DIMM ZONE 2 Temp --- Normal = 31 C, OK : Processor 1 DIMM ZONE 1 Temp --- Normal = 35 C, OK : Processor 1 CPU2 Temp --- Normal = 44 C, OK : Processor 1 CPU1 Temp --- Normal = 48 C | '[Device] Other 0 Inlet Temp --- Normal'=23C;; 'Processor 1 PCH Temp --- Normal'=47C;; 'Processor 1 DIMM ZONE 2 Temp --- Normal'=31C;; 'Processor 1 DIMM ZONE 1 Temp --- Normal'=35C;; 'Processor 1 CPU2 Temp --- Normal'=44C;; 'Processor 1 CPU1 Temp --- Normal'=48C;;
CHECK_VMWARE_API.PL CRITICAL - Provide sensor name as -o argument
Use of uninitialized value $addopts in string eq at ./check_vmware_api.pl line 2277.
Use of uninitialized value $addopts in string eq at ./check_vmware_api.pl line 2280.
CHECK_VMWARE_API.PL OK - maintenance=no
CHECK_VMWARE_API.PL OK - 8/8 VMs up: vpn(OK), vcenter-88-2(OK), XXXXXXXX.com(OK), XXXXXXXX.com(OK), XXXXXXXX.com(OK), XXXXXXXX.com(OK), XXXXXXXX.com(OK), XXXXXXXX.com(OK) | vmcount=8units;;
CHECK_VMWARE_API.PL OK - overall status=green
CHECK_VMWARE_API.PL OK - No config issues
Use of uninitialized value $subcommand in string ne at ./check_vmware_api.pl line 1898.
CHECK_VMWARE_API.PL OK - 8/8 VMs up, overall status=green, connection state=connected, maintenance=no, All 132 health checks are Green, no config issues | vmcount=8units;; health_issues=0;; config_issues=0;;
CHECK_VMWARE_API.PL OK - No VM's with cd/dvd devices | match=0;;
CHECK_VMWARE_API.PL OK - services : DCUI (up), TSM (down), TSM-SSH (up), lbtd (up), lsassd (down), lwiod (down), netlogond (down), ntpd (up), sfcbd-watchdog (up), snmpd (up), vmware-fdm (down), vprobed (down), vpxa (up), xorg (down)
CHECK_VMWARE_API.PL OK - io commands aborted=0 | io_aborted=0;;
CHECK_VMWARE_API.PL OK - io bus resets=0 | io_busresets=0;;
CHECK_VMWARE_API.PL OK - io read latency=0 ms | io_read=0ms;;
CHECK_VMWARE_API.PL OK - io write latency=0 ms | io_write=0ms;;
CHECK_VMWARE_API.PL OK - io kernel latency=0 ms | io_kernel=0ms;;
CHECK_VMWARE_API.PL OK - io device latency=0 ms | io_device=0ms;;
CHECK_VMWARE_API.PL OK - io queue latency=0 ms | io_queue=0ms;;
CHECK_VMWARE_API.PL OK - io commands aborted=0, io bus resets=0, io read latency=0 ms, write latency=0 ms, kernel latency=0 ms, device latency=0 ms, queue latency=0 ms | io_aborted=0;; io_busresets=0;; io_read=0ms;; io_write=0ms;; io_kernel=0ms;; io_device=0ms;; io_queue=0ms;;
CHECK_VMWARE_API.PL OK - mem usage=82.26 % | mem_usage=82.26%;;
CHECK_VMWARE_API.PL OK - mem usage=107788.05 MB | mem_usagemb=107788.05MB;;
CHECK_VMWARE_API.PL OK - swap usage=79.71 MB | mem_swap=79.71MB;;
CHECK_VMWARE_API.PL OK - overhead=1502.64 MB | mem_overhead=1502.64MB;;
CHECK_VMWARE_API.PL OK - overall=109290.69 MB | mem_overhead=109290.69MB;;
CHECK_VMWARE_API.PL OK - memctl=129.01 MB | mem_memctl=129.01MB;;
CHECK_VMWARE_API.PL OK - mem usage=107788.05 MB (82.26%), overhead=1502.64 MB, swapped=79.71 MB, memctl=129.01 MB | mem_usagemb=107788.05MB;; mem_usage=82.26%;; mem_overhead=1502.64MB;; mem_swap=79.71MB;; mem_memctl=129.01MB;;
CHECK_VMWARE_API.PL OK - mem usage=82.25 % | mem_usage=82.25%;;
CHECK_VMWARE_API.PL OK - mem usage=107773.45 MB | mem_usagemb=107773.45MB;;
CHECK_VMWARE_API.PL OK - swap usage=79.71 MB | mem_swap=79.71MB;;
CHECK_VMWARE_API.PL OK - overhead=1502.64 MB | mem_overhead=1502.64MB;;
CHECK_VMWARE_API.PL OK - overall=109290.69 MB | mem_overall=109290.69MB;;
CHECK_VMWARE_API.PL OK - memctl=129.01 MB | mem_memctl=129.01MB;;
CHECK_VMWARE_API.PL OK - mem usage=107788.05 MB (82.26%), overhead=1502.64 MB, swapped=79.71 MB, memctl=129.01 MB | mem_usagemb=107788.05MB;; mem_usage=82.26%;; mem_overhead=1502.64MB;; mem_swap=79.71MB;; mem_memctl=129.01MB;;
CHECK_VMWARE_API.PL OK - io commands aborted=0 | io_aborted=0;;
CHECK_VMWARE_API.PL OK - io bus resets=0 | io_busresets=0;;
CHECK_VMWARE_API.PL OK - io read latency=0 ms | io_read=0ms;;
CHECK_VMWARE_API.PL OK - io write latency=0 ms | io_write=0ms;;
CHECK_VMWARE_API.PL OK - io kernel latency=0 ms | io_kernel=0ms;;
CHECK_VMWARE_API.PL OK - io device latency=0 ms | io_device=0ms;;
CHECK_VMWARE_API.PL OK - io queue latency=0 ms | io_queue=0ms;;
CHECK_VMWARE_API.PL OK - io commands aborted=0, io bus resets=0, io read latency=0 ms, write latency=0 ms, kernel latency=0 ms, device latency=0 ms, queue latency=0 ms | io_aborted=0;; io_busresets=0;; io_read=0ms;; io_write=0ms;; io_kernel=0ms;; io_device=0ms;; io_queue=0ms;;
CHECK_VMWARE_API.PL OK - cpu usage=19.85 % | cpu_usage=19.85%;;
CHECK_VMWARE_API.PL OK - cpu usagemhz=5002.00 MHz | cpu_usagemhz=5002.00MHz;;
CHECK_VMWARE_API.PL OK - cpu usage=5002.00 MHz (19.85%) | cpu_usagemhz=5002.00MHz;; cpu_usage=19.85%;;
CHECK_VMWARE_API.PL CRITICAL - Storages : 'public_images'(free)=134284.80 MB (65.57%), 'local_datastore_1'(free)=907044.00 MB (95.86%), 'local_datastore_2' is not accessible, 'vol258'(free)=281650.31 MB (62.34%) | public_images=134284.80MB;; local_datastore_1=907044.00MB;; vol258=281650.31MB;;
CHECK_VMWARE_API.PL OK - 8/9 VMs up: debian8(DOWN), vcenter-88-2(UP), vpn(UP), XXXXXXXX.com(UP), XXXXXXXX.com(UP), XXXXXXXX.com(UP), XXXXXXXX.com(UP), XXXXXXXX.com(UP), XXXXXXXX.com(UP) | vmcount=8units;;
CHECK_VMWARE_API.PL UNKNOWN - 1/2 Hosts up: XX.XX.XX.XX(UNKNOWN), XX.XX.XX.XX(UP) | hostcount=1units;;
CHECK_VMWARE_API.PL OK - 1/1 Cluster green: cluster#1(GREEN) | clustercount=1units;;
CHECK_VMWARE_API.PL OK - XXXXXXXX.com(Running-Unmanaged), XXXXXXXX.com(Running-Unmanaged), XXXXXXXX.com(Running-Unmanaged), XXXXXXXX.com(Running-Unmanaged), XXXXXXXX.com(Running-Unmanaged), XXXXXXXX.com(Running-Unmanaged), vpn(Not running-Not installed), vcenter-88-2(Running-Unmanaged) | toolsok=0%;;
CHECK_VMWARE_API.PL UNKNOWN - Interxion MAD2 overall status=gray
CHECK_VMWARE_API.PL OK - No config issues | issues=0;;
CHECK_VMWARE_API.PL OK - 8/8 VMs up (1 templates), 1/2 Hosts up, Interxion MAD2 overall status=gray, no config issues | vmcount=8units;; hostcount=1units;; config_issues=0;;
CHECK_VMWARE_API.PL OK - No recommendations | recommendations=0;;
CHECK_VMWARE_API.PL OK - net usage=4352.00 KBps | net_usage=4352.00KBps;;
CHECK_VMWARE_API.PL OK - net receive=111.00 KBps | net_receive=111.00KBps;;
CHECK_VMWARE_API.PL OK - net send=3426.00 KBps | net_send=3426.00KBps;;
CHECK_VMWARE_API.PL OK - net receive=111.00 KBps, send=3426.00 KBps | net_receive=111.00KBps;; net_send=3426.00KBps;;

real 0m38.762s
user 0m29.331s
sys 0m2.007s
root@st:~/check_vmware_api#
bycampanel, May 15, 2015
1 of 1 people found this review helpful
# ./check_vmware_api.pl -D IP -u opuser -p ****** -l cpu -s usage -w 92 -c 98
CHECK_VMWARE_API.PL CRITICAL - Server version unavailable at 'https://IP:443/sdk/vimService.wsdl' at /usr/lib/perl5/site_perl/5.8.8/VMware/VICommon.pm line 545.
___

solution:
# cpan -D LWP
bybkingx, February 5, 2015
I am also getting the Server version unavailable message when running the check but, being a n00b, I don't know how to apply the work around suggested by ginter. Can someone please tell me the steps to make this work correctly?

I have:
Ubuntu 14.04
Nagios Core 4.0.8
Perl 5.18.2
VMware Perl SDK 5.1
byginer, December 29, 2014
3 of 3 people found this review helpful
Here is a work around for everyone who can't make check_vmware_api work on recent OS with new perl and recent VMware Perl SDK.


Prerequisites:
- Ubuntu 14.04 Server (perl v5.18.2)
- VMware-vSphere-Perl-SDK-5.5.0-2043780
- check_vmware_api.pl 0.7.1


Basic installation:

apt-get install perl-doc libssl-dev libxml-libxml-perl libarchive-zip-perl libcrypt-ssleay-perl libclass-methodmaker-perl libuuid-perl libdata-dump-perl libsoap-lite-perl libio-compress-perl
tar -xf VMware-vSphere-Perl-SDK-5.5.0-2043780.x86_64.tar.gz -C /tmp
cd /tmp/vmware-vsphere-cli-distrib
./vmware-install.pl



Work around for "Server version unavailable":

patch -b /usr/share/perl/5.18/VMware/VICommon.pm new(agent => "VI Perl");
+ $user_agent->ssl_opts( SSL_verify_mode => 0 );
my $cookie_jar = HTTP::Cookies->new(ignore_discard => 1);
$user_agent->cookie_jar($cookie_jar);
$user_agent->protocols_allowed(['http', 'https']);
@@ -502,7 +503,7 @@
sub query_server_version {
BEGIN {
#To remove SSL Warning, switching from IO::Socket::SSL to Net::SSL
- $ENV{PERL_NET_HTTPS_SSL_SOCKET_CLASS} = "Net::SSL";
+ #$ENV{PERL_NET_HTTPS_SSL_SOCKET_CLASS} = "Net::SSL";
#To remove host verification
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
}
@@ -526,6 +527,7 @@
}
}
my $user_agent = LWP::UserAgent->new(agent => "VI Perl");
+ $user_agent->ssl_opts( SSL_verify_mode => 0 );
my $cookie_jar = HTTP::Cookies->new(ignore_discard => 1);
$user_agent->cookie_jar($cookie_jar);
$user_agent->protocols_allowed(['http', 'https']);
@@ -2108,6 +2110,7 @@
sub new {
my ($class, $url) = @_;
my $user_agent = LWP::UserAgent->new(agent => "VI Perl");
+ $user_agent->ssl_opts( SSL_verify_mode => 0 );
my $cookie_jar = HTTP::Cookies->new(ignore_discard => 1);
$user_agent->cookie_jar( $cookie_jar );
$user_agent->protocols_allowed( ['http', 'https'] );
*****************************************************************
by4l3x4ndr3, September 12, 2014
Hello
From what I found, the script takes the standard IO latency vmhba (vmhba0):

  /usr/local/nagios/libexec/check_esx3-0.5.pl D xxxx xxxx H -u nagiosvc p xxxx -l io
CHECK_ESX3-0.5.PL OK - aborted commands io = 0, io bus resets = 0, io = 4 ms read latency, write latency = 0 ms, = 0 ms latency kernel, device = 0 ms latency, queue latency ms = 0 | io_aborted = 0 ;; io_busresets = 0 ;; io_read = 4ms;; io_write = 0ms;; io_kernel = 0ms;; io_device = 0ms;; io_queue = 0ms;;

I have other vmhba, and what matters most is not the 0. You can customize the script to collect another? How can I do?

Grateful!
Great plugin, we use it for years!
Yesterday however I updated our Ubuntu server and the script does not work anymore. Error is:
Server version unavailable at 'https://x.x.x.x:443/sdk/vimService.wsdl' at /usr/lib/perl5/5.18/VMware/VICommon.pm line 545
I narrowed down the offending update to: liblwp-protocol-https-perl, version 6.04-2ubuntu0.1.
I reverted back to our backup and did not install this module, it is working fine again.
bydarkweaver87, March 13, 2014
Good plugin but the percentage is buggy. For host swap check for instance you have to check against the host total swap usable. For instance I got an alert because my ESX is using 20MB of swap on 1.5GB. This is not exactly 20%.
byniriw, February 15, 2014
Does what it says. I was able to setup this plugin without lot of problems for ESXi host. I still cannot create configuration for VM monitoring though. Can anybody help with the configuration I need to perform for monitoring VM cpu and memory parameters?
byPradyumna, February 8, 2014
Working fine but Esxi logs are growing

every check create a Login event and a logout event in the event table of the Esxi.
We get a lot of check (2 check per VM every 5min). That is generating millions of lines in the Esxi database which became very slow. We already reduce the event&task conservation time but not enough.

Does anyone know a way to limit the number of login to Esxi done by the check ?

Regards,
Pradyumna
Great script does everything that I need. One note for people trying to install it. In my instance I am running Nagios on the latest Ubuntu server version.

I experienced the "(Service Check Timed Out)" problem.

I then tried installing the older Net-Http perl module (v 6.3):

perl -MCPAN -e shell
install GAAS/Net-HTTP-6.03.tar.gz

After installing that the Service Check Timed Out error went away, but was replaced with:

"Undefined subroutine &LWP::Protocol::https::Socket::can_read called at /usr/local/share/perl5/LWP/Protocol/http.pm line 22"

A little research (thank you GOOGLE!) found the fix. You also need to re-install Bundle::LWP from an older version, not just Net-HTTP.

perl -MCPAN -e shell
install GAAS/libwww-perl-6.03.tar.gz.

Now the sctipt is working great and does everything that I need.
bydlawless, December 12, 2013
This plugin does everything you have stated,

I was wondering if it was possible to pull disk statistics from this?

I want to be able to pull the disk iops / read / write latency and I would want to do it at the datastore level. I can retrieve this information when i log into the vcenter and do stats show.

Didn't know if this would be something that was relatively easy to add. Thanks for the plugin!
byVivawest, December 12, 2013
This is a very good Check for our environment.

For those experiencing timeouts: Try to install libxml-libxml-perl ( sudo apt-get install libxml-libxml-perl on Ubuntu ) . The VMware vSphere SDK for Perl had a Output telling that it can't be found. After Installation the Checks via console were a lot faster (like 1 second) and i didn't get a timout on Icinga anymore.
bywadcyr8_197, November 17, 2013
Hi,

this works fine on our infrastructure, but we get some issue donc vcenter database growing.

every check create a Login event and a logout event in the event table of the vcenter.
We get a lot of check (2 check per VM every 5min). That is generating millions of lines in the vcenter database which became very slow. We already reduce the event&task conservation time but not enough.

Does anyone know a way to limite the number of login to vcenter done by the check ?
byNooJ, November 13, 2013
Good check here.
Work like a charm when I launch this by command line (ie. ./check_vmware_api -H 192.168.2.25 -u supervision -p **** -l runtime -s status )

But when I launch this in NAGIOS I get : (Service Check Timed Out)

I already tried to install older Net-Http perl module (v 6.3)
perl -MCPAN -e shell
install GAAS/Net-HTTP-6.03.tar.gz

But nothing change.

Any help here ?
bygardenik, May 12, 2013
Hi all,
for timeout issues with this plugin like:
/check_vmware_api -H xxxx -u root -p xxxx -l cpu
CHECK_VMWARE_API UNKNOWN - plugin timed out (timeout 30s)

the solution is to install older Net-Http perl module (v 6.3)

perl -MCPAN -e shell
install GAAS/Net-HTTP-6.03.tar.gz
byjarduini, April 26, 2013
There is a way to add a total datastorage usage and free space of the DC?
BTW excelent check!
Thanks a Lot

Javier
Hello,
is it possible to use it to monitor a NFS datastore latency ?
which would be the syntax?
thanks
byjerry123je, November 20, 2012
Hi guys,

I use this script on two of my nagios (different site)

one is now in use and with a very good reply.
another one has a big issue that after i installed basic component and vmware tool kit.this script can run with out error but only a time out output.

./check_vmware_api -H xxxx -u root -p xxxx -l cpu
CHECK_VMWARE_API UNKNOWN - plugin timed out (timeout 30s)

could anyone give some suggestion on this?
byvallsit, July 19, 2011
You're writing - h 10.2.2.1 but -h is for showing the script help
In order to check that address you should type -H (in capital letters) host_address
Page 1 of 2