| Languages: |
English • Deutsch |
Contents |
check_vmware3.pl on Nagios Exchange
./check_vmware3.pl --server 10.10.0.32 --username readonlyuser --password secret --protocol https --portnumber 8333 --host my.vmware.server.com --ignore '.' --ensure 'VPN'
The plugin will warn you if it cannot find the API.
Nagios will get critical if a virtual machine is missing or not running fine (bad) unless you defined to ignore it.
$ ./check_vmware3.pl --help
Synopsis: /usr/lib/nagios/plugins/NETWAYS/check_vmware3.pl OPTIONS
Command-specific options:
--ensure
List of VM-Names (separated by comma, regexp possible) for which state must be green
--host
Name of the host
--ignore
List of VM-Names (separated by comma, regexp possible) to ignore if state not green
--timeout
Timeout in seconds
--verboseVMs
list VM names as plugin output
--vmname
one single VM to check - the other checks will be suppressed
Common VI options:
--config (variable VI_CONFIG)
Location of the VI Perl configuration file
--encoding (variable VI_ENCODING, default 'utf8')
Encoding: utf8, cp936 (Simplified Chinese), iso-8859-1 (German), shiftjis (Japanese)
--help
Display usage information for the script
--passthroughauth (variable VI_PASSTHROUGHAUTH)
Attempt to use pass-through authentication
--passthroughauthpackage (variable VI_PASSTHROUGHAUTHPACKAGE, default 'Negotiate')
Pass-through authentication negotiation package
--password (variable VI_PASSWORD)
Password
--portnumber (variable VI_PORTNUMBER)
Port used to connect to server
--protocol (variable VI_PROTOCOL, default 'https')
Protocol used to connect to server
--savesessionfile (variable VI_SAVESESSIONFILE)
File to save session ID/cookie to utilize
--server (variable VI_SERVER, default 'localhost')
VI server to connect to. Required if url is not present
--servicepath (variable VI_SERVICEPATH, default '/sdk/webService')
Service path used to connect to server
--sessionfile (variable VI_SESSIONFILE)
File containing session ID/cookie to utilize
--url (variable VI_URL)
VI SDK URL to connect to. Required if server is not present
--username (variable VI_USERNAME)
Username
--verbose (variable VI_VERBOSE)
Display additional debugging information
--version
Display version information for the script
on SUSE you may need to install Class::MethodMaker from CPAN if you get the following error message:
/usr/bin/perl: symbol lookup error: /usr/lib/perl5/site_perl/5.10.0/i586-linux-thread-multi/auto/Class/MethodMaker/MethodMaker.so: undefined symbol: Perl_Tstack_sp_ptr
perl -MCPAN -e shell install Class::MethodMaker
you may need to apply the patch like this:
$ patch -p0 < VICommon.pm.patch
--- /root/vmware-viperl-distrib/lib/VMware/share/VMware/VICommon.pm 2008-07-13 05:39:51.000000000 +0200
+++ /usr/lib/perl5/site_perl/5.8.8/VMware/VICommon.pm 2008-11-20 10:23:55.000000000 +0100
@@ -1796,7 +1796,7 @@
Carp::confess("Internal error: server returned '$val' as a boolean value");
}
} else {
- $val = $child_class_name->deserialize($_);
+ $val = ($_->toString =~ /^<device xsi:type="VirtualMachineVMCIDevice">/) ? XML::LibXML::Element->new("void") : $child_class_name->deserialize($_);
}
} else {
$val = $_->textContent;
The graph will get a pink top if a virtual machine is missing.