/* * License: GPL v2+ : https://www.gnu.org/licenses/gpl-2.0.html * * author : Olaf Zevenboom * version : 0.3.7 * based on check_vmware_esx.pl,Version 0.9.16 * * based on the work as published here: https://github.com/BaldMansMojo/check_vmware_esx * which is a fork of the esx_vmware_api plugin as developed by Op5 * * detailed documentation per command and template * full documentation included at the end of the file * (the detailed documentation was distilled/copied from this) */ template CheckCommand "vmware-esx" { /* TO DO : * - clean up & documentate in a more consistent way * - test the various authentication methods */ import "plugin-check-command" /* the command itself. Adapt path if required */ command = [ /* PluginDir + "/check_vmware_esx.pl" */ // PluginDir3rdParty + "/check_vmware_esx/check_vmware_esx.pl" "/opt/perlbrew/esx_check.sh" ] /* variables (general options) */ #vars.vmware_ignorewarning = true vars.vmware_timeout = "90" # https://github.com/BaldMansMojo/check_vmware_esx/issues/36 #vars.vmware_trace = "0" /* undesired defaults override */ vars.vmware_sessionfiledir = "/tmp" // default seems to be: /var/nagios_plugin_cache /* sessionfiledir : (Optional).If this option is set a path different from the path stored in $nagios_plugin_cache will be used. */ //vars.vmware_sessionfile = "vmware-esx.session" //vars.vmware_nosession = true /* * arguments for this rather extensive plugin */ /* * Thresholds should be either a simple counter or a percentage * value in the nn% (i.e. 90%). If checking more than a single * with --usedspace volume only percent is allowed as threshold. */ # TODO : # - above comment seems malformed and not really generic or complete. # - not always critical and warning values are allowed and sometimes # the format (percentage or value) can be a different requirement # This is all not taken care of now: this has yet to be implemented! arguments = { "-w" = { value = "$vmware_warning$" description = "Warning threshold." } "-c" = { value = "$vmware_critical$" description = "Critical threshold." } } arguments += { /* general options */ "--ignore_unknown" = { set_if = "$vmware_ignoreunknown$" description = "Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3)." } "--ignore_warning" = { set_if = "$vmware_ignorewarning$" description = "Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view)." } "--timeout" = { value = "$vmware_timeout$" // { set_if = "$vmware_timeout$" } description = "timeout= Seconds before plugin times out (default: 90)" } "--trace" = { #set_if = "$vmware_trace$" value = "$vmware_trace$" description = "Set verbosity level of vSphere API request/respond trace." } } /* Options for authentication: * =========================== * * To reduce amounts of login/logout events in the vShpere logfiles or a lot of * open sessions using sessionfiles the login part has been rewritten. Using session * files is now the default. Only one session file per host or vCenter is used as * default. * * The sessionfile name is automatically set to the vSphere host or the vCenter * (IP or name - whatever is used in the check). * * Multiple sessions are possible using different session file names. To form different * session file names the default name is enhenced by the value you set with * --sessionfile. * * NOTICE! All checks using the same session are serialized. So a lot of checks * using only one session can cause timeouts. In this case you should enhence the * number of sessions by using --sessionfile in the command definition and define * the value in the service definition command as an extra argument so it can be used * in the command definition as $ARGn$. * * --sessionfile= (Optional).Session file name enhancement. * --sessionfiledir= (Optional).If this option is set a path different from the path stored in * $nagios_plugin_cache will be used. * --nosession (Optional). Don't use a session file. This is the old behaviour. It should be used for production use because it can cause a lot of entries in the log files an therefore can cause abnormal growing of the log. * IT SHOULD BE USED FOR TESTING PURPOSES ONLY! * -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= */ arguments += { /* authentication settings */ "--sessionfile" = { #set_if = "$vmware_sessionfile$" value = "$vmware_sessionfile$" #value = "$vmware_sessionfile$.$address$" # sessionfile reusage must be limited somehow description = "(Optional). Session file name enhancement." } "--sessionfiledir" = { #set_if = "$vmware_sessionfiledir$" value = "$vmware_sessionfiledir$" description = "(Optional). If this option is set a path different from the path stored in $nagios_plugin_cache will be used." } "--nosession" = { set_if = "$vmware_nosession$" description = "(Optional). Don't use a session file. This is the old behaviour. It should be used for production use because it can cause a lot of entries in the log files an therefore can cause abnormal growing of the log. IT SHOULD BE USED FOR TESTING PURPOSES ONLY!" /* IT SHOULD BE USED FOR TESTING PURPOSES ONLY! */ } } arguments += { /* authentication settings for debugging purposes */ "--username" = { #set_if = "$vmware_username$" value = "$vmware_username$" description = "Username to connect with." } "--password" = { #set_if = "$vmware_password$" value = "$vmware_password$" description = "Password to use with the username." } "--authfile" = { #set_if = "$vmware_authfile$" && ( len("$vmware_username$") == 0 ) set_if = ( len("$vmware_authfile$") > 0 ) && ( len("$vmware_username$") == 0 ) #set_if = "$vmware_authfile$" value = "$vmware_authfile$" description = "Authentication file with login and password." } } } /* * command support for : Monitoring the vmware datacenter: * template definition to be used by all commands issued via the datacenter */ template CheckCommand "vmware-esx-DC" { import "vmware-esx" arguments += { "--datacenter" = { value = "$vmware_DCname$" required = true description = "Datacenter/Vcenter hostname." } "--cluster" = { #set_if = "$vmware_cluster$" value = "$vmware_cluster$" description = "ESX or ESXi clustername." } "--sslport" = { #set_if = "$vmware_sslport$" value = "$vmware_sslport$" # default value : 443 description = "If a SSL port different from 443 is used." } } } object CheckCommand "vmware-esx-DC-volumes" { /* * possible ways to call this command: * * vmware-esx-DC-volumes without subselect * * vmware-esx-DC-volumes subselect= [--usedspace --warning --critical] * * vmware-esx-DC-volumes subselect= [--alertonly --warning --critical] * * vmware-esx-DC-volumes subselect= [--usedspace --alertonly --warning --critical] * to all these subselects can be added: * * [--exclude=] * * [--exclude= --isregexp] * OR (!) * * [--include=] * * [--include= --isregexp] */ /* * TO DO * - try to implement restriction/exclusions in code */ import "vmware-esx-DC" arguments += { "--select" = { value = "$vmware_select$" required = true description = "Shows all datastore volumes info" } "--subselect" = { value = "$vmware_subselect$" description = "free space info for volume with name " } "--usedspace" = { set_if = "$vmware_usedspace$" && ( len("$vmware_subselect$") > 0 ) #set_if = len("$vmware_subselect$") > 0 value = "$vmware_usedspace$" description = "Output used space instead of free" } "--alertonly" = { #set_if = "$vmware_alertonly$" && ( len("$vmware_subselect$") > 0 ) set_if = len("$vmware_subselect$") > 0 value = "$vmware_alertonly$" description = "List only alerting volumes" } "--exclude" = { #set_if = "$vmware_exclude$" && ( len("$vmware_include$") == 0 ) && ( len("$vmware_subselect$") > 0 ) set_if = ( len("$vmware_exclude$") > 0 ) && ( len("$vmware_include$") == 0 ) && ( len("$vmware_subselect$") > 0 ) #set_if = "$vmware_exclude$" value = "$vmware_exclude$" description = "Blacklist volumes. Use blacklist OR(!) whitelist. Using both in one statement is not allowed." } "--include" = { #set_if = "$vmware_include$" && ( len("$vmware_exclude$") == 0 ) && ( len("$vmware_subselect$") > 0 ) set_if = ( len("$vmware_include$") > 0 ) && ( len("$vmware_exclude$") == 0 ) && ( len("$vmware_subselect$") > 0 ) #set_if = "$vmware_include$" value = "$vmware_include$" description = "Whitelist volumes. Use blacklist OR(!) whitelist. Using both in one statement is not allowed." } "--isregexp" = { set_if = "$vmware_isregexp$" && ( len("$vmware_include$")>0 || len("$vmware_exclude$")>0 ) #set_if = "$vmware_isregexp$" value = "$vmware_isregexp$" description = "Whether to treat name, blacklist and whitelist as regexp" } } vars.vmware_select = "volumes" } object CheckCommand "vmware-esx-DC-runtimeinfo" { /* * possible ways to call this command: * * vmware-esx-DC-runtimeinfo without subselect * * vmware-esx-DC-runtimeinfo --subselect=listvms [--altertonly] [--multiline] * to all these subselects can be added: * * [--exclude=] * * [--exclude= --isregexp] * OR (!) * * [--include=] * * [--include= --isregexp] * * vmware-esx-DC-runtimeinfo --subselect=listhost [--altertonly] [--multiline] * to all these subselects can be added: * * [--exclude=] * * [--exclude= --isregexp] * OR (!) * * [--include=] * * [--include= --isregexp] * * vmware-esx-DC-runtimeinfo --subselect=listcluster [--altertonly] [--multiline] * to all these subselects can be added: * * [--exclude=] * * [--exclude= --isregexp] * OR (!) * * [--include=] * * [--include= --isregexp] * * vmware-esx-DC-runtimeinfo --subselect=issues [--multiline] * to all these subselects can be added: * * [--exclude=] * * [--exclude= --isregexp] * OR (!) * * [--include=] * * [--include= --isregexp * * vmware-esx-DC-runtimeinfo --subselect=status * * vmware-esx-DC-runtimeinfo --subselect=tools [--poweredonly] [--multiline] [--alertonly] * to all these subselects can be added: * * [--exclude=] * * [--exclude= --isregexp] * OR (!) * * [--include=] * * [--include= --isregexp */ /* * TO DO * - try to implement restriction/exclusions in code * - remove the copy/pasted comments below when: * - make sure (how?) that descriptionfields are adequate depending on used arguments */ import "vmware-esx-DC" /* * below docs are copy/paste from the "command_reference" file of the plugin. Kept for review purposes for now. * should be removed later as it is already more or less integrated in the code Runtime Info: ------------- -S, --select=runtime Shows all runtime info for the datacenter/Vcenter. No thresholds are allowed here or with -s, --subselect=listvms List of vmware machines and their power state.. BEWARE!! In larger environments systems can cause trouble displaying the informations needed due to the mass of data. . Use --alertonly to avoid this. -B, --exclude= Blacklist VMs. -W, --include= Whitelist VMs. Use blacklist OR(!) whitelist. Using both in one statement is not allowed. --isregexp Whether to treat blacklist and whitelist as regexp --multiline Multiline output in overview. This mean technically that a multiline output uses a HTML
for the GUI instead of Be aware that your messing connections (email, SMS...) must use a filter to file out the
. A sed oneliner like the following will do the job: sed 's/<[^<>]*>//g' --alertonly List only alerting VMs. Important here to avoid masses of data. or -s, --subselect=listhost List of VMware ESX hosts and their power state.. Power state can be (from the docs): - poweredOff The host was specifically powered off by the user through VirtualCenter. This state is not a cetain state, because after VirtualCenter issues the command to power off the host, the host might crash, or kill all the processes but fail to power off. - poweredOn The host is powered on - standBy The host was specifically put in standby mode, either explicitly by the user, or automatically by DPM. This state is not a cetain state, because after VirtualCenter issues the command to put the host in stand-by state, the host might crash, or kill all the processes but fail to power off. - unknown If the host is disconnected, or notResponding, we can not possibly have knowledge of its power state. Hence, the host is marked as unknown. BEWARE!! In larger environments systems can cause trouble displaying the informations needed due to the mass of data. . Use --alertonly to avoid this. -B, --exclude= Blacklist VMware ESX hosts. -W, --include= Whitelist VMware ESX hosts. Use blacklist OR(!) whitelist. Using both in one statement is not allowed. --isregexp Whether to treat blacklist and whitelist as regexp --multiline Multiline output in overview. This mean technically that a multiline output uses a HTML
for the GUI instead of Be aware that your messing connections (email, SMS...) must use a filter to file out the
. A sed oneliner like the following will do the job: sed 's/<[^<>]*>//g' --alertonly List only alerting hosts. Important here to avoid masses of data. or -s, --subselect=listcluster List of vmware clusters and their states. States can be (from the docs): - gray The status is unknown. - green The entity is OK. - red The entity definitely has a problem. - yellow The entity might have a problem. -B, --exclude= Blacklist VMware cluster. -W, --include= Whitelist VMware cluster. Use blacklist OR(!) whitelist. Using both in one statement is not allowed. --isregexp Whether to treat blacklist and whitelist as regexp --multiline Multiline output in overview. This mean technically that a multiline output uses a HTML
for the GUI instead of Be aware that your messing connections (email, SMS...) must use a filter to file out the
. A sed oneliner like the following will do the job: sed 's/<[^<>]*>//g' --alertonly List only alerting hosts. Important here to avoid masses of data. or -s, --subselect=issues All issues for the host. -B, --exclude= Blacklist issues. -W, --include= Whitelist issues. Use blacklist OR(!) whitelist. Using both in one statement is not allowed. --isregexp Whether to treat blacklist and whitelist as regexp --multiline Multiline output in overview. This mean technically that a multiline output uses a HTML
for the GUI instead of Be aware that your messing connections (email, SMS...) must use a filter to file out the
. A sed oneliner like the following will do the job: sed 's/<[^<>]*>//g' or -s, --subselect=status Overall object status (gray/green/red/yellow). State can be (from the docs): - gray The status is unknown. - green The entity is OK. - red The entity definitely has a problem. - yellow The entity might have a problem. or -s, --subselect=tools Vmware Tools status. Tool status can be: - Installed,running and current. - Installed,running,but the installed version is known to have a grave bug and should be immediately upgraded. - Installed,running,version is not current - Installed,running,supported and newer than the version available on the host - Installed,running,supported, but a newer version is available - Installed,running,but the version is known to be too new too new to work correctly with this virtual machine - Installed,running,but the version is too old - Installed,running,but not managed by VMWare --poweredonly List only VMs which are powered on. -B, --exclude= Blacklist VMs. -W, --include= Whitelist VMs. Use blacklist OR(!) whitelist. Using both in one statement is not allowed. --isregexp Whether to treat blacklist and whitelist as regexp --multiline Multiline output in overview. This mean technically that a multiline output uses a HTML
for the GUI instead of Be aware that your messing connections (email, SMS...) must use a filter to file out the
. A sed oneliner like the following will do the job: sed 's/<[^<>]*>//g' --alertonly List only alerting VMs. Important here to avoid masses of data. */ arguments += { "--select" = { value = "$vmware_select$" required = true description = "Shows all runtime info for the datacenter/Vcenter." } "--subselect" = { value = "$vmware_subselect$" description = "(Optional). listvms, listhost, listcluster, issues, status, tools" /* list of possible subselects : * subselect=listvms * description=List of vmware machines and their power state.. BEWARE!! In larger environments systems can cause trouble displaying the informations needed due to the mass of data. Use --alertonly to avoid this. * --exclude= * --include= * --isregexp * --multiline * --alertonly * subselect=listhost * description= List of VMware ESX hosts and their power state.. Power state can be (from the docs): poweredOff , poweredOn , standBy , unknown * TODO : all these states are extensively documented in the plugin documentation, seems overkill to add these many lines of text here. * --exclude= * --include= * --isregexp * --multiline * --alertonly * subselect=listcluster * description=List of vmware clusters and their states. States can be: grey , green , red , yellow (see the docs) * --exclude= * --include= * --isregexp * --multiline * --alertonly * subselect=issues * description= All issues for the host. * --exclude= * --include= * --isregexp * --multiline * subselect=status * description=Overall object status (gray/green/red/yellow). * subselect=tools * description=Vmware Tools status. Tool status can be: * - Installed,running and current. * - Installed,running,but the installed version is known to have a grave bug and should be immediately upgraded. * - Installed,running,version is not current * - Installed,running,supported and newer than the version available on the host * - Installed,running,supported, but a newer version is available * - Installed,running,but the version is known to be too new too new to work correctly with this virtual machine * - Installed,running,but the version is too old * - Installed,running,but not managed by VMWare * * --poweredonly * --exclude= * --include= * --isregexp * --multiline * --alertonly */ } "--exclude" = { #set_if = "$vmware_exclude$" && ( len("$vmware_include") == 0 ) set_if = ( len("$vmware_exclude$") > 0 ) && ( len("$vmware_include") == 0 ) #set_if = "$vmware_exclude$" value = "$vmware_exclude$" description = "Blacklist VMs. Use blacklist OR(!) whitelist. Using both in one statement is not allowed." } "--include" = { #set_if = "$vmware_include$" && ( len("$vmware_exclude") == 0 ) set_if = ( len("$vmware_include$") > 0 ) && ( len("$vmware_exclude") == 0 ) #set_if = "$vmware_include$" value = "$vmware_include$" description = "Whitelist VMs. Use blacklist OR(!) whitelist. Using both in one statement is not allowed." } "--isregexp" = { set_if = "$vmware_isregexp$" && ( ( len("$vmware_include$") > 0 ) || ( len("$vmware_exclude$") > 0 ) ) #set_if = "$vmware_isregexp$" value = "$vmware_isregexp$" description = "Whether to treat name, blacklist and whitelist as regexp" } "--multiline" = { set_if = "$vmware_multiline$" /* probably a bad idea to use with Icinga */ description = "Multiline output in overview. This mean technically that a multiline output uses a HTML
for the GUI instead of Be aware that your messing connections (email, SMS...) must use a filter to file out the
. A sed oneliner like the following will do the job: sed 's/<[^<>]*>//g'" } "--alertonly" = { set_if = "$vmware_alertonly$" && ( ( "$vmware_subselect$" == "listvms" ) || ( "$vmware_subselect$" == "listhost" ) || ( "$vmware_subselect$" == "listcluster" ) ) #set_if = "$vmware_alertonly$" description = " List only alerting VMs. Important here to avoid masses of data." } "--poweredonly" = { set_if = "$vmware_poweredonly$" && ( "$vmware_subselect$" == "tools" ) #set_if = "$vmware_poweredonly$" description = "List only VMs which are powered on." } } vars.vmware_select = "runtime" } /* * command support for : SOAP API : * - needs cleaning up * - move various parts of soap code to the appropriate sections (now it is bundled and not split per host, DC and cluster like the rest. */ /* * SOAP API * * TO DO : only a single API call is documented, so calling this over DC, host, cluster seems overkill. * Remove most of the code? */ template CheckCommand "vmware-esx-soap" { import "vmware-esx" vars.vmware_select = "soap" /* this is it, nothing more to it */ arguments += { "--select" = { value = "$vmware_select$" required = true description = "simple check to verify a successfull connection to VMWare SOAP API" } "--sslport" = { #set_if = "$vmware_sslport$" value = "$vmware_sslport$" description = "If a SSL port different from 443 is used." } } } object CheckCommand "vmware-esx-host-soap" { import "vmware-esx-soap" arguments += { "--host" = { value = "$vmware_hostname$" required = true description = "ESX or ESXi hostname." } } } object CheckCommand "vmware-esx-DC-soap" { import "vmware-esx-soap" arguments += { "--datacenter" = { value = "$vmware_DCname$" required = true description = "Datacenter/Vcenter hostname." } } } object CheckCommand "vmware-esx-cluster-soap" { import "vmware-esx-soap" arguments += { "--cluster" = { value = "$vmware_cluster$" required = true description = "ESX or ESXi clustername." } } } /* * command support for : Monitoring the vmware host (hypervisor) */ template CheckCommand "vmware-esx-host" { import "vmware-esx" vars.vmware_hostname = "$host_name$" # odd, not needed before??? arguments += { "--host" = { value = "$vmware_hostname$" required = true description = "ESX or ESXi hostname." } "--cluster" = { #set_if = "$vmware_cluster$" value = "$vmware_cluster$" description = "ESX or ESXi clustername." } "--sslport" = { #set_if = "$vmware_sslport$" value = "$vmware_sslport$" # default (if not set) : 443 description = "If a SSL port different from 443 is used." } } } object CheckCommand "vmware-esx-host-uptime" { import "vmware-esx-host" arguments += { "--select" = { value = "$vmware_select$" required = true description = "Displays uptime of the vmware host." } } vars.vmware_select = "uptime" } object CheckCommand "vmware-esx-host-cpu" { import "vmware-esx-host" arguments += { "--select" = { value = "$vmware_select$" required = true description = "CPU usage in percentage." } "--subselect" = { #set_if = ( ( "$vmware_subselect$" == "ready" ) || ( "$vmware_subselect$ == "wait" ) || ( "$vmware_subselect$" == "usage" ) ) # why explicitly check for values as I cannot raise an error/warning? #set_if = "$vmware_subselect$" value = "$vmware_subselect$" # NOTE : the docs talk about VMs where as the code is about the host. Wrong docs supplied with the plugin? description = "(Optional). Subselection: ready, wait, usage" /* * subselect=ready Percentage of time that the virtual machine was * ready, but could not get scheduled to run on the * physical CPU. CPU ready time is dependent on the * number of virtual machines on the host and their * CPU loads. High or growing ready time can be a * hint CPU bottlenecks * (no warning & criticial levels) * subselect=wait CPU time spent in wait state. The wait total includes * time spent the CPU idle, CPU swap wait, and CPU I/O * wait states. High or growing wait time can be a * hint I/O bottlenecks. * (no warning & criticial levels) * subselect=usage Actively used CPU of the host, as a percentage of * the total available CPU. Active CPU is approximately * equal to the ratio of the used CPU to the available CPU. * * Available CPU = # of physical CPUs x clock rate * * 100% represents all CPUs on the host. For example, * if a four-CPU host is running a virtual machine with * two CPUs, and the usage is 50%, the host is using two * CPUs completely. */ } } vars.vmware_select = "cpu" } object CheckCommand "vmware-esx-host-memory" { import "vmware-esx-host" arguments += { "--select" = { value = "$vmware_select$" required = true description = "All mem info (except overall and no thresholds)" } "--subselect" = { #set_if = "$vmware_subselect$" value = "$vmware_subselect$" description = "Optional: usage, consumed, swapused, overhead, memctl" /* * subselect=usage Average mem usage in percentage * subselect=consumed Amount of machine memory used on the host. Consumed * memory includes Includes memory used by the Service * Console, the VMkernel vSphere services, plus the * total consumed metrics for all running virtual * machines in MB * subselect=swapused Amount of memory that is used by swap. Sum of memory * swapped of all powered on VMs and vSphere services * on the host in MB. In case of an error all VMs with their * swap used will be displayed. Use --multiline to have * a better formatted output. * subselect=overhead Additional mem used by VM Server in MB * subselect=memctl The sum of all vmmemctl values in MB for all powered-on * virtual machines, plus vSphere services on the host. * If the balloon target value is greater than the balloo * value, the VMkernel inflates the balloon, causing more * virtual machine memory to be reclaimed. If the balloon * target value is less than the balloon value, the VMkernel * deflates the balloon, which allows the virtual machine to * consume additional memory if needed.used by VM memory * control driver. In case of an error all VMs with their * vmmemctl values will be displayed. Use --multiline to have * a better formatted output. */ } "--multiline" = { #set_if = "$vmware_multiline$" /* probably a bad idea to use with Icinga */ set_if = "$vmware_multiline$" && ( ( "$vmware_subselect$" == "swapused" ) || ( "$vmware_subselect$" == "memctl" ) ) description = "Multiline output in overview. This mean technically that a multiline output uses a HTML
for the GUI instead of Be aware that your messing connections (email, SMS...) must use a filter to file out the
. A sed oneliner like the following will do the job: sed 's/<[^<>]*>//g'" # TODO : requires escaping? Also: not proper English, words and punctuation are missing? } } vars.vmware_select = "mem" } object CheckCommand "vmware-esx-host-network" { # note: no whitelisting?! import "vmware-esx-host" arguments += { "--select" = { value = "$vmware_select$" required = true description = "Shows net info" } "--subselect" = { #set_if = "$vmware_subselect$" value = "$vmware_subselect$" description = "(Optional). usage, receive, send or nic" /* * subselect=usage Overall network usage in KBps(Kilobytes per Second). * subselect=receive Receive in KBps(Kilobytes per Second). * subselect=send Send in KBps(Kilobytes per Second). * subselect=nic Check all active NICs. */ } "--exclude" = { #set_if = "$vmware_exclude$" && ( ( len("$vmware_subselect$") == 0 ) || ( "$vmware_subselect$" == "nic" ) ) set_if = ( len("$vmware_exclude$") > 0 ) && ( ( len("$vmware_subselect$") == 0 ) || ( "$vmware_subselect$" == "nic" ) ) value = "$vmware_exclude$" description = "Blacklist NICs." } "--isregexp" = { set_if = "$vmware_isregexp$" && ( len("$vmware_exclude$") > 0 ) #set_if = "$vmware_isregexp$" value = "$vmware_regexp$" description = "Whether to treat blacklist as regexp" } } vars.vmware_select = "net" } object CheckCommand "vmware-esx-host-volumes" { import "vmware-esx-host" arguments += { "--select" = { value = "$vmware_select$" description = "Shows all datastore volumes info" } "--subselect" = { #set_if = "$vmware_subselect$" value = "$vmware_subselect$" #description = "Free space info for volume with name " description = "Free space info for volume: $subselect$" } "--exclude" = { set_if = "$vmware_exclude$" && ( len("$vmware_include$") == 0 ) && ( len("$vmware_subselect$") > 0 ) #set_if = "$vmware_exclude$" value = "$vmware_exclude$" description = "Blacklist volumes." } "--include" = { #set_if = "$vmware_include$" && ( len("$vmware_exclude$") == 0 ) && ( len("$vmware_subselect$") > 0 ) set_if = ( len("$vmware_include$") > 0 ) && ( len("$vmware_exclude$") == 0 ) && ( len("$vmware_subselect$") > 0 ) #set_if = "$vmware_include$" value = "$vmware_include$" description = "Whitelist volumes." } "--isregexp" = { set_if = "$vmware_isregexp$" && ( ( len("$vmware_include$") > 0 ) || ( len("$vmware_exclude$") > 0 ) ) #set_if = "$vmware_isregexp$" value = "$vmware_regexp$" description = "Whether to treat name, blacklist and whitelist as regexp" } "--gigabyte" = { set_if = "$vmware_gigabyte$" && ( len("$vmware_subselect$") > 0 ) description = "Output in GB instead of MB" } "--usedspace" = { set_if = "$vmware_usedspace$" && ( len("$vmware_subselect$") > 0 ) description = "Output used space instead of free" } "--alertonly" = { set_if = "$vmware_alertonly$" && ( len("$vmware_subselect$") > 0 ) description = "List only alerting volumes" } } vars.vmware_select = "volumes" } object CheckCommand "vmware-esx-host-diskio" { import "vmware-esx-host" arguments += { "--select" = { value = "$vmware_select$" required = true description = "Shows all disk io info. Without subselect no thresholds can be given. All I/O values are aggregated from historical intervals over the past 24 hours with a 5 minute sample rate" } "--subselect" = { #set_if = "$vmware_subselect$" value = "$vmware_subselect$" description = "(Optional). aborted, resets, read, read_latency, write, write_latency, usage, kernel_latency, device_latency, queue_latency, total_latency" /* * subselect=aborted Number of aborted SCSI commands * subselect=resets Number of SCSI bus resets * subselect=read Average number of kilobytes read from the disk each second * Rate at which data is read from each LUN on the host. * read rate = # blocksRead per second x blockSize * issued from the Guest OS to the virtual machine. * subselect=read_latency Average amount of time (ms) to process a SCSI read command * issued from the Guest OS to the virtual machine. * subselect=write Average number of kilobytes written to disk each second. * Rate at which data is written to each LUN on the host. * write rate = # blocksRead per second x blockSize * subselect=write_latency Average amount of time (ms) taken to process a SCSI write * command issued by the Guest OS to the virtual machine. * subselect=usage Aggregated disk I/O rate. For hosts, this metric includes * the rates for all virtual machines running on the host * subselect=kernel_latency Average amount of time (ms) spent by VMkernel processing * each SCSI command. * subselect=device_latency Average amount of time (ms) to complete a SCSI command * from the physical device * subselect=queue_latency Average amount of time (ms) spent in the VMkernel queue, * subselect=total_latency Average amount of time (ms) taken during the collection interval * to process a SCSI command issued by the guest OS to the virtual * machine. The sum of kernelWriteLatency and deviceWriteLatency. */ } } vars.vmware_select = "io" } object CheckCommand "vmware-esx-host-mountedmedia" { import "vmware-esx-host" arguments += { "--select" = { value = "$vmware_select$" required = true description = "List vm's with attached host mounted media like cd,dvd or floppy drives. This is important for monitoring because a virtual machine with a mount cd or dvd drive can not be moved to another host." } "--exclude" = { #set_if = "$vmware_exclude$" && ( len("$vmware_include$") == 0 ) set_if = len("$vmware_include$") == 0 #set_if = "$vmware_exclude$" value = "$vmware_exclude$" description = "Blacklist VMs." } "--include" = { #set_if = "$vmware_include$" && ( len("$vmware_exclude$") == 0 ) set_if = len("$vmware_exclude$") == 0 #set_if = "$vmware_include$" value = "$vmware_include$" description = "Whitelist VMs." } "--isregexp" = { set_if = "$vmware_regexp$" && ( ( len("$vmware_exclude$") > 0 ) || ( len("$vmware_include$") > 0 ) ) #set_if = "$vmware_regexp$" value = "$vmware_regexp$" description = "Whether to treat blacklist and whitelist as regexp" } "--listall" = { set_if = "$vmware_listall$" description = "List all VMs with all mounted media." } "--multiline" = { set_if = "$vmware_multiline$" /* probably a bad idea to use with Icinga */ description = "Multiline output in overview. This mean technically that a multiline output uses a HTML
for the GUI instead of Be aware that your messing connections (email, SMS...) must use a filter to file out the
. A sed oneliner like the following will do the job: sed 's/<[^<>]*>//g'" } } vars.vmware_select = "hostmedia" } object CheckCommand "vmware-esx-host-serviceinfo" { import "vmware-esx-host" arguments += { "--select" = { value = "$vmware_select$" required = true description = "Shows host service info." } "--exclude" = { #set_if = "$vmware_exclude$" && ( len("$vmware_include$") == 0 ) set_if = len("$vmware_include$") == 0 #set_if = "$vmware_exclude$" value ="$vmware_exclude$" description = "Blacklist services." # Use blacklist OR(!) whitelist. Using both in one statement is not allowed." } "--include" = { #set_if = "$vmware_include$" && ( len("$vmware_exclude$") == 0 ) set_if = len("$vmware_exclude$") == 0 #set_if = "$vmware_include$" value = "$vmware_include$" description = "Whitelist services." # Use blacklist OR(!) whitelist. Using both in one statement is not allowed." } "--isregexp" = { set_if = "$vmware_regexp$" && ( ( len("$vmware_exclude$") > 0 ) || ( len("$vmware_include$") > 0 ) ) #set_if = "$vmware_regexp$" value = "$vmware_regexp$" description = "Whether to treat blacklist and whitelist as regexp" } "--multiline" = { set_if = "$vmware_multiline$" /* probably a bad idea to use with Icinga */ description = "Multiline output in overview. This mean technically that a multiline output uses a HTML
for the GUI instead of Be aware that your messing connections (email, SMS...) must use a filter to file out the
. A sed oneliner like the following will do the job: sed 's/<[^<>]*>//g'" } } vars.vmware_select = "service" } object CheckCommand "vmware-esx-host-runtimeinfo" { import "vmware-esx-host" arguments += { "--select" = { value = "$vmware_select$" required = true description = "Shows runtime info. Used without -s (subselect) show all runtime info: VMs, overall status, connection state, health, storagehealth, temperature and sensor are represented as one value and without thresholds." } "--subselect" = { #set_if = "$vmware_subselect$" value = "$vmware_subselect$" description = "(Optional). con, listvms, status, health, storagehealth, temp, issues" /* * subselect=con Shows connection state. * subselect=listvms List of vmware machines and their statuses. * subselect=status Overall object status (gray/green/red/yellow). * State can be (from the docs): * - gray The status is unknown. * - green The entity is OK. * - red The entity definitely has a problem. * - yellow The entity might have a problem. * subselect=health Checks cpu/storage/memory/sensor status. * subselect=storagehealth Local(!) storage status check. * subselect=temp Lists all temperature sensors. * subselect=issues Lists all configuration issues for the host. */ } "--exclude" = { #set_if = "$vmware_exclude$" && ( len("$vmware_include$") == 0 ) && ( "$vmware_subselect$" == "listvms" ) set_if = ( len("$vmware_include$") == 0 ) && ( "$vmware_subselect$" == "listvms" ) #set_if = "$vmware_exclude$" value = "$vmware_exclude$" description = "Blacklist VMs" } "--include" = { #set_if = "$vmware_include$" && ( len("$vmware_exclude$") == 0 ) && ( "$vmware_subselect$" == "listvms" ) set_if = ( len("$vmware_exclude$") == 0 ) && ( "$vmware_subselect$" == "listvms" ) #set_if = "$vmware_include$" value = "$vmware_include$" description = "Whitelist VMs" } "--isregexp" = { set_if = "$vmware_regexp$" && ( (len("$vmware_include") > 0 ) || ( len("$vmware_exclude$")>0 ) ) && ( "$vmware_subselect$" != "con" ) && ( "$vmware_subselect$" != "status") #set_if = "$vmware_regexp$" value = "$vmware_regexp$" description = "Whether to treat blacklist and whitelist as regexp" } "--multiline" = { #set_if = "$vmware_multiline$" /* probably a bad idea to use with Icinga */ set_if = "$vmware_multiline$" && ( ( "$vmware_subselect$" == "listvms" ) || ( "$vmware_subselect$" == "storagehealth" ) || ( "$vmware_subselect$" == "temp" ) || ( "$vmware_subselect$" == "issues" ) ) description = "Multiline output in overview. This mean technically that a multiline output uses a HTML
for the GUI instead of Be aware that your messing connections (email, SMS...) must use a filter to file out the
. A sed oneliner like the following will do the job: sed 's/<[^<>]*>//g'" } "--listsensors" = { set_if = "$vmware_listsensors$" && ( "$vmware_subselect$" == "health" ) #set_if = "$vmware_listsensors$" value = "$vmware_listsensors$" description = "List all available sensors(use for listing purpose only)" } "--nostoragestatus" = { set_if = "$vmware_nostoragestatus$" && ( "$vmware_subselect$" == "health" ) #set_if = "$vmware_nostoragestatus$" value = "$vmware_nostoragestatus$" description = "This is to avoid a double alarm if you use -s health and -s storagehealth." } "--exclude" = { #set_if = "$vmware_exclude$" && ( len("$vmware_include$") == 0 ) && ( "$vmware_subselect$" == "health" ) set_if = ( len("$vmware_include$") == 0 ) && ( "$vmware_subselect$" == "health" ) value = "$vmware_exclude$" description = "Blacklist storage, memory and sensors." } "--include" = { #set_if = "$vmware_include$" && ( len("$vmware_exclude$") == 0 ) && ( "$vmware_subselect$" == "health" ) set_if = ( len("$vmware_exclude$") == 0 ) && ( "$vmware_subselect$" == "health" ) value = "$vmware_include$" description = "Whitelist storage, memory and sensors." } "--exclude" = { #set_if = "$vmware_exclude$" && ( len("$vmware_include$") == 0 ) && ( "$vmware_subselect$" == "storagehealth" ) set_if = ( len("$vmware_include$") == 0 ) && ( "$vmware_subselect$" == "storagehealth" ) #set_if = "$vmware_exclude$" value = "$vmware_exclude$" description = "Blacklist storage." } "--include" = { #set_if = "$vmware_include$" && ( len("$vmware_exclude$") == 0 ) && ( "$vmware_subselect$" == "storagehealth" ) set_if = ( len("$vmware_exclude$") == 0 ) && ( "$vmware_subselect$" == "storagehealth" ) value = "$vmware_include$" description = "Whitelist storage." } "--exclude" = { #set_if = "$vmware_exclude$" && ( len("$vmware_include$") == 0 ) && ( "$vmware_subselect$" == "temp" ) set_if = ( len("$vmware_include$") == 0 ) && ( "$vmware_subselect$" == "temp" ) value = "$vmware_exclude$" description = "Blacklist sensors." } "--include" = { #set_if = "$vmware_include$" && ( len("$vmware_exclude$") == 0 ) && ( "$vmware_subselect$" == "temp" ) set_if = ( len("$vmware_exclude$") == 0 ) && ( "$vmware_subselect$" == "temp" ) value = "$vmware_include$" description = "Whitelist sensors." } "--exclude" = { #set_if = "$vmware_exclude$" && ( len("$vmware_include$") == 0 ) && ( "$vmware_subselect$" == "issues" ) set_if = ( len("$vmware_include$") == 0 ) && ( "$vmware_subselect$" == "issues" ) value = "$vmware_exclude$" description = "Blacklist configuration issues." } "--include" = { #set_if = "$vmware_include$" && ( len("$vmware_exclude$") == 0 ) && ( "$vmware_subselect$" == "issues" ) set_if = ( len("$vmware_exclude$") == 0 ) && ( "$vmware_subselect$" == "issues" ) value = "$vmware_include$" description = "Whitelist configuration issues." } } vars.vmware_select = "runtime" } object CheckCommand "vmware-esx-host-storageinfo" { import "vmware-esx-host" arguments += { "--select" = { value = "$vmware_select$" required = true description = "Shows Host storage info. BEWARE!! Without a subselect only a summary will be listed." } "--subselect" = { value = "$vmware_subselect$" description = "(Optional). adaptor, lun, path" /* * subselect=adapter List host bus adapters. * subselect=lun List SCSI logical units. The listing will include: * - LUN * - canonical name of the disc * - all of displayed name which is not part of the canonical name * - the status * subselect=path List multipaths and the associated paths. */ } "--exclude" = { set_if = "$vmware_exclude$" && ( len("$vmware_include$") == 0 ) && ( len("$vmware_subselect$") == 0 ) #set_if = "$vmware_exclude$" value = "$vmware_exclude$" description = "Blacklist adaptors, luns and paths" } "--include" = { #set_if = "$vmware_include$" && ( len("$vmware_exclude$") == 0 ) && ( len("$vmware_subselect$") == 0 ) set_if = ( len("$vmware_exclude$") == 0 ) && ( len("$vmware_subselect$") == 0 ) #set_if = "$vmware_include$" value = "$vmware_include$" description = "Whitelist adapters, luns and paths" } "--exclude" = { #set_if = "$vmware_exclude$" && ( len("$vmware_include$") == 0 ) && ( "$vmware_subselect$" == "adapter" ) set_if = ( len("$vmware_include$") == 0 ) && ( "$vmware_subselect$" == "adapter" ) #set_if = "$vmware_exclude$" value = "$vmware_exclude$" description = "Blacklist adaptors" } "--include" = { #set_if = "$vmware_include$" && ( len("$vmware_exclude$") == 0 ) && ( "$vmware_subselect$" == "adapter" ) set_if = ( len("$vmware_exclude$") == 0 ) && ( "$vmware_subselect$" == "adapter" ) #set_if = "$vmware_include$" value = "$vmware_include$" description = "Whitelist adapters" } "--exclude" = { #set_if = "$vmware_exclude$" && ( len("$vmware_include$") == 0 ) && ( "$vmware_subselect$" == "lun" ) set_if = ( len("$vmware_include$") == 0 ) && ( "$vmware_subselect$" == "lun" ) #set_if = "$vmware_exclude$" value = "$vmware_exclude$" description = "Blacklist LUNs" } "--include" = { #set_if = "$vmware_include$" && ( len("$vmware_exclude$") == 0 ) && ( "$vmware_subselect$" == "lun" ) set_if = ( len("$vmware_exclude$") == 0 ) && ( "$vmware_subselect$" == "lun" ) #set_if = "$vmware_include$" value = "$vmware_include$" description = "Whitelist LUNs" } "--exclude" = { #set_if = "$vmware_exclude$" && ( len("$vmware_include$") == 0 ) && ( "$vmware_subselect$" == "path" ) set_if = ( len("$vmware_include$") == 0 ) && ( "$vmware_subselect$" == "path" ) #set_if = "$vmware_exclude$" value = "$vmware_exclude$" description = "Blacklist paths" } "--include" = { #set_if = "$vmware_include$" && ( len("$vmware_exclude$") == 0 ) && ( "$vmware_subselect$" == "path" ) set_if = ( len("$vmware_exclude$") == 0 ) && ( "$vmware_subselect$" == "path" ) #set_if = "$vmware_include$" value = "$vmware_include$" description = "Whitelist paths" } "--isregexp" = { set_if = "$vmware_regexp$" && ( ( len("$vmware_include") > 0 ) || ( len("$vmware_exclude$")>0 ) ) #set_if = "$vmware_regexp$" value = "$vmware_regexp$" description = "Whether to treat blacklist and whitelist as regexp" } "--multiline" = { set_if = "$vmware_multiline$" && ( len("$vmware_subselect$") > 0 ) #set_if = "$vmware_multiline$" /* probably a bad idea to use with Icinga */ description = "Multiline output in overview. This mean technically that a multiline output uses a HTML
for the GUI instead of Be aware that your messing connections (email, SMS...) must use a filter to file out the
. A sed oneliner like the following will do the job: sed 's/<[^<>]*>//g'" } "--alertonly" = { #set_if = "$vmware_alteronly$" set_if = "$vmware_alertonly$" && ( ("$vmware_subselect$" == "lun") || ("$vmware_subselect$" == "path") ) description = "List only alerting units. Important here to avoid masses of data." } "--standbyok" = { set_if = "$vmware_standbyok$" && ( "$vmware_subselect$" == "path" ) #set_if = "$vmware_standbyok$" description = "For storage systems where a standby multipath is ok and not a warning." } } vars.vmware_select = "storage" } # TO DO : below: a lot seems already coded elsewhere. Better to integrate. template CheckCommand "vmware-esx-virtualmachine" { import "vmware-esx" vars.vmware_vmname = "$host_name$" # odd, not needed before? arguments += { "--datacenter" = { value = "$vmware_DCname$" description = "Datacenter/Vcenter hostname." } "--host" = { value = "$vmware_hostname$" description = "ESX or ESXi hostname." } "--cluster" = { #set_if = "$vmware_cluster$" value = "$vmware_cluster$" description = "ESX or ESXi clustername." } "--name" = { value = "$vmware_vmname$" required = true description = "Virtual machine name." } "--sslport" = { #set_if = "$vmware_sslport$" value = "$vmware_sslport$" description = "If a SSL port different from 443 is used." } /* authentication settings */ "--sessionfile" = { value = "$vmware_sessionfile$" description = "(Optional). Session file name enhancement." } "--sessionfiledir" = { value = "$vmware_sessionfiledir$" description = "(Optional). If this option is set a path different from the path stored in $nagios_plugin_cache will be used." } "--nosession" = { set_if = "$vmware_nosession$" description = "(Optional). Don't use a session file. This is the old behaviour. It should be used for production use because it can cause a lot of entries in the log files an therefore can cause abnormal growing of the log. IT SHOULD BE USED FOR TESTING PURPOSES ONLY!" /* IT SHOULD BE USED FOR TESTING PURPOSES ONLY! */ } /* authentication settings for debugging purposes */ "--username" = { value = "$vmware_username$" description = "Username to connect with." } "--password" = { value = "$vmware_password$" description = "Password to use with the username." } "--authfile" = { value = "$vmware_authfile$" description = "Authentication file with login and password." /* * File syntax : * username= * password= */ } } /* variables (general options) */ vars.vmware_ignorewarning = "0" vars.vmware_timeout = "90" vars.vmware_trace = "0" /* undesired defaults override */ vars.vmware_sessionfiledir = "/tmp" // default seems to be: /var/nagios_plugin_cache vars.vmware_sessionfile = "vmware-esx.session" //vars.vmware_nosession = true /* main connection items */ #vars.vmware_datacenter = "--datacenter" #vars.vmware_sslport = "443" } object CheckCommand "vmware-esx-vm-cpu" { import "vmware-esx-virtualmachine" arguments += { "--select" = { value = "$vmware_select$" required = true description = "CPU usage in percentage." } "--subselect" = { value = "$vmware_subselect$" description = "(Optional). Subselection: ready, wait, usage" /* * subselect=ready Percentage of time that the virtual machine was * ready, but could not get scheduled to run on the * physical CPU. CPU ready time is dependent on the * number of virtual machines on the host and their * CPU loads. High or growing ready time can be a * hint CPU bottlenecks * (no warning & criticial levels) * subselect=wait CPU time spent in wait state. The wait total includes * time spent the CPU idle, CPU swap wait, and CPU I/O * wait states. High or growing wait time can be a * hint I/O bottlenecks. * (no warning & criticial levels) * subselect=usage Actively used CPU of the host, as a percentage of * the total available CPU. Active CPU is approximately * equal to the ratio of the used CPU to the available CPU. * * Available CPU = # of physical CPUs x clock rate * * 100% represents all CPUs on the host. For example, * if a four-CPU host is running a virtual machine with * two CPUs, and the usage is 50%, the host is using two * CPUs completely. */ } } vars.vmware_select = "cpu" } object CheckCommand "vmware-esx-vm-memory" { import "vmware-esx-virtualmachine" arguments += { "--select" = { value = "$vmware_select$" required = true description = "all mem info(except overall and no thresholds)" } "--subselect" = { value = "$vmware_subselect$" description = "(Optional). usage, consumed, memctl" /* * subselect=usage Average mem usage in percentage of configured virtual * machine "physical" * subselect=consumed Amount of guest physical memory in MB consumed by the * virtual machine for guest memory. Consumed memory does * not include overhead memory. It includes shared memory * and memory that might be reserved, but not actually * used. Use this metric for charge-back purposes. * vm consumed memory = memory granted - memory saved * subselect=memctl Amount of guest physical memory that is currently * reclaimed from the virtual machine through ballooning. * This is the amount of guest physical memory that has been * allocated and pinned by the balloon driver. */ } } vars.vmware_select = "mem" } object CheckCommand "vmware-esx-vm-network" { import "vmware-esx-virtualmachine" arguments += { "--select" = { value = "$vmware_select$" required = true description = "Shows net info" } "--subselect" = { value = "$vmware_subselect$" description = "(Optional). usage, receive, send" /* * subselect=usage Overall network usage in KBps(Kilobytes per Second). * subselect=receive Receive in KBps(Kilobytes per Second). * subselect=send Send in KBps(Kilobytes per Second). */ } } vars.vmware_select = "net" } object CheckCommand "vmware-esx-vm-diskio" { import "vmware-esx-virtualmachine" arguments += { "--select" = { value = "$vmware_select$" required = true description = "Shows all disk io info. Without subselect no thresholds can be given. All I/O values are aggregated from historical intervals over the past 24 hours with a 5 minute sample rate." } "--subselect" = { value = "$vmware_subselect$" description = "(Optional). read, write, usage" /* * subselect=read Average number of kilobytes read from the disk each second. * subselect=write Average number of kilobytes written to disk each second. * subselect=usage Aggregated disk I/O rate. */ } } vars.vmware_select = "io" } object CheckCommand "vmware-esx-vm-runtimeinfo" { import "vmware-esx-virtualmachine" arguments += { "--select" = { value = "$vmware_select$" required = true description = "Shows runtime info, When used without subselect no thresholds can be given." } "--subselect" = { value = "$vmware_subselect$" description = "(Optional). con, " /* * subselect=con Shows the connection state. Connection state can be: * connected The server has access to the virtual machine. * disconnected When checked directly by a VMware host, then * the disconnected state is not possible. However, * when accessed through VirtualCenter, the state * of a virtual machine is set to disconnected if * the hosts that manage the virtual machine becomes * unavailable. * inaccessible One or more of the virtual machine configuration * files are inaccessible. For example, this can be * due to transient disk failures. In this case, no * configuration can be returned for a virtual machine. * invalid The virtual machine configuration format is invalid. * Thus, it is accessible on disk, but corrupted in a * way that does not allow the server to read the content. * In this case, no configuration can be returned for * a virtual machine. * orphaned The virtual machine is no longer registered on the * host it is associated with. For example, a virtual * machine that is unregistered or deleted directly on * a host managed by VirtualCenter shows up in this state. * subselect=powerstate Virtual machine power state poweredOn, poweredOff, suspended) * subselect=status Overall object status (gray/green/red/yellow) * State can be (from the docs): * - gray The status is unknown. * - green The entity is OK. * - red The entity definitely has a problem. * - yellow The entity might have a problem. * subselect=consoleconnections Console connections to VM. * subselect=gueststate Guest OS status. Needs VMware Tools installed and running. * The status can be: * running -> Guest is running normally. (Ok) * shuttingdown -> Guest has a pending shutdown command. (Warning) * resetting -> Guest has a pending reset command. (Warning) * standby -> Guest has a pending standby command. (Warning) * notrunning -> Guest is not running. (Warning) * unknown -> Guest information is not available. (Unknown) * * Due to the fact that it depends on running VMware tools some of * the tools stats are checked here either: * - VMware tools are starting. (Warning) * - VMware tools are not running. * (Warning) if VM up and running. * (Ok) if VM powerd off or suspended. * subselect=tools Vmware tools status. The status can be: * - VMware tools are starting. (Warning) * - VMware tools are not running. * (Warning) if VM up and running. * (Ok) if VM powerd off or suspended. * - VMware tools are running. (Ok) * - VMware tools are installed, but the installed version is known * to have a grave bug and should be immediately upgraded. (Critical) * - VMware tools are installed, but the version is not current. (Warning) * - VMware tools were never been installed. (Warning) * - VMware tools are installed, supported, and newer than the version * available on the host. (Warning) * - No information about VMware tools available. (Warning) * * New since vSphere API 5.0: * - VMware tools are installed, and the version is current. (Ok) * - VMware tools are installed, supported, but a newer version is * available. (Warning) * - VMware tools are installed, and the version is known to be too new to * work correctly with this virtual machine. (Critical) * - VMware tools are installed, but the version is too old. (Warning) * - VMware tools are installed, but it is not managed by VMWare. (Critical) * subselect=issues All issues for the host */ } "--multiline" = { set_if = "$vmware_multiline$" && ( "$vmware_subselect$" == "issues" ) #set_if = "$vmware_multiline$" /* probably a bad idea to use with Icinga */ description = "Multiline output in overview. This mean technically that a multiline output uses a HTML
for the GUI instead of Be aware that your messing connections (email, SMS...) must use a filter to file out the
. A sed oneliner like the following will do the job: sed 's/<[^<>]*>//g'" } } vars.vmware_select = "runtime" } /* * cluster wrappers * * WARNING: major plugin issues, do not use! * see https://github.com/BaldMansMojo/check_vmware_esx/issues/45 */ #object CheckCommand "vmware-esx-cluster-via-host-cpu" { /* cluster specific: * * cpu - shows cpu info * usage - CPU usage in percentage * usagemhz - CPU usage in MHz * ^ all cpu info */ #import "vmware-esx-host-cpu" # TO DO : needs a lot of attention & testing # Note : plugin errors #} #object CheckCommand "vmware-esx-cluster-via-host-memory" { /* * * mem - shows mem info * + usage - mem usage in percentage * + usagemb - mem usage in MB * + swap - swap mem usage in MB * + memctl - mem used by VM memory control driver(vmmemctl) that controls ballooning * ^ all mem info(plus overhead and no thresholds) * * cluster - shows cluster services info * + effectivecpu - total available cpu resources of all hosts within cluster * + effectivemem - total amount of machine memory of all hosts in the cluster * + failover - vmware HA number of failures that can be tolerated * + cpufainess - fairness of distributed cpu resource allocation * + memfainess - fairness of distributed mem resource allocation * ^ only effectivecpu and effectivemem values for cluster services * * runtime - shows runtime info * + listvms - list of vmware machines in cluster and their statuses * + listhost - list of vmware esx host servers in cluster and their statuses * + status - overall cluster status (gray/green/red/yellow) * States can be (from the docs): * - gray The status is unknown. * - green The entity is OK. * - red The entity definitely has a problem. * - yellow The entity might have a problem. * + issues - all issues for the cluster * b - blacklist issues * ^ all cluster runtime info */ #import "vmware-esx-host-mem" # TO DO : # - needs a lot of attention & testing # - seems a mess, runtime, mem, cluster all in one documentation/function ??? # Note : plugin errors, only runtime works #} #object CheckCommand "vmware-esx-cluster-via-host-volumes" { /* Volumes: * Syntaxis and options seem the same as for regular volumes */ #import "vmware-esx-host-volumes" # TO DO : needs a lot of attention & testing # Note : plugin errors #} #object CheckCommand "vmware-esx-cluster-via-DC-cpu" { /* cluster specific: * * cpu - shows cpu info * usage - CPU usage in percentage * usagemhz - CPU usage in MHz * ^ all cpu info */ #import "vmware-esx-DC-cpu" # <------ this does not exists! ?? !!! # TO DO : # - needs a lot of attention & testing # - this is a non existing function ??? # Note : plugin errors #} #object CheckCommand "vmware-esx-cluster-via-DC-memory" { /* * * mem - shows mem info * + usage - mem usage in percentage * + usagemb - mem usage in MB * + swap - swap mem usage in MB * + memctl - mem used by VM memory control driver(vmmemctl) that controls ballooning * ^ all mem info(plus overhead and no thresholds) * * cluster - shows cluster services info * + effectivecpu - total available cpu resources of all hosts within cluster * + effectivemem - total amount of machine memory of all hosts in the cluster * + failover - vmware HA number of failures that can be tolerated * + cpufainess - fairness of distributed cpu resource allocation * + memfainess - fairness of distributed mem resource allocation * ^ only effectivecpu and effectivemem values for cluster services * * runtime - shows runtime info * + listvms - list of vmware machines in cluster and their statuses * + listhost - list of vmware esx host servers in cluster and their statuses * + status - overall cluster status (gray/green/red/yellow) * States can be (from the docs): * - gray The status is unknown. * - green The entity is OK. * - red The entity definitely has a problem. * - yellow The entity might have a problem. * + issues - all issues for the cluster * b - blacklist issues * ^ all cluster runtime info */ #import "vmware-esx-DC-mem" # <------ this does not exists! ?? !!! # TO DO : # - needs a lot of attention & testing # - seems a mess, runtime, mem, cluster all in one documentation/function ??? # - non existsing function for DC ??? # Note : plugin errors, only runtime works #} #object CheckCommand "vmware-esx-cluster-via-DC-volumes" { /* Volumes: * Syntaxis and options seem the same as for regular volumes */ #import "vmware-esx-DC-volumes" # TO DO : needs a lot of attention & testing # Note : plugin errors #}