Module: check_mk
Branch: master
Commit: 60cca46867973591b38812ccc914c6fa417059dd
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=60cca468679735…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Feb 28 15:49:34 2014 +0100
esx_vsphere_vm.guest_tools: new check to monitor guest tools status
This check allows to monitor if the guestTools version of the VM is up-to-date.<br>
Possible values and states:
<ul>
<li>"VMware Tools is installed, and the version is current" - State
OK)</li>
<li>"VMware Tools is installed, but the version is not current" - State
WARN)</li>
<li>"VMware Tools has never been installed" - State CRIT)</li>
<li>"VMware Tools is installed, but it is not managed by VMWare" - State
WARN)</li>
</ul>
The resulting state of each value can also be modified by the WATO rule
<tt>Virtual machine guest tools status</tt>
---
.werks/562 | 19 +++++++++++++++
ChangeLog | 1 +
checks/esx_vsphere_vm | 43 ++++++++++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 36 ++++++++++++++++++++++++++++
4 files changed, 99 insertions(+)
diff --git a/.werks/562 b/.werks/562
new file mode 100644
index 0000000..34ed20e
--- /dev/null
+++ b/.werks/562
@@ -0,0 +1,19 @@
+Title: esx_vsphere_vm.guest_tools: new check to monitor guest tools status
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1393598628
+Class: feature
+
+This check allows to monitor if the guestTools version of the VM is
up-to-date.<br>
+Possible values and states:
+<ul>
+<li>"VMware Tools is installed, and the version is current" - State
OK)</li>
+<li>"VMware Tools is installed, but the version is not current" - State
WARN)</li>
+<li>"VMware Tools has never been installed" - State CRIT)</li>
+<li>"VMware Tools is installed, but it is not managed by VMWare" - State
WARN)</li>
+</ul>
+
+The resulting state of each value can also be modified by the WATO rule
+<tt>Virtual machine guest tools status</tt>
+
diff --git a/ChangeLog b/ChangeLog
index e00ed5b..b273ac7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -96,6 +96,7 @@
* 0702 Rule for checking agents for wanted version...
* 0586 rmon_stats: new snmp check to gather network traffic statistics on RMON
enabled network interfaces
* 0704 windows_os_bonding: new check for bonding interfaces on windows...
+ * 0562 esx_vsphere_vm.guest_tools: new check to monitor guest tools status...
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/checks/esx_vsphere_vm b/checks/esx_vsphere_vm
index c0a723f..6d1b7fa 100644
--- a/checks/esx_vsphere_vm
+++ b/checks/esx_vsphere_vm
@@ -117,6 +117,49 @@ check_info['esx_vsphere_vm.name'] = {
"service_description" : "ESX Name",
}
+
+#.
+# .--GuestTools----------------------------------------------------------.
+# | ____ _ _____ _ |
+# | / ___|_ _ ___ ___| ||_ _|__ ___ | |___ |
+# | | | _| | | |/ _ \/ __| __|| |/ _ \ / _ \| / __| |
+# | | |_| | |_| | __/\__ \ |_ | | (_) | (_) | \__ \ |
+# | \____|\__,_|\___||___/\__||_|\___/ \___/|_|___/ |
+# | |
+# +----------------------------------------------------------------------+
+# | |
+# '----------------------------------------------------------------------'
+
+def inventory_esx_vsphere_vm_guest_tools(info):
+ data = esx_vsphere_vm_convert(info)
+ if 'guest.toolsVersionStatus' in data:
+ return [(None, None)]
+
+def check_esx_vsphere_vm_guest_tools(_no_item, params, info):
+ data = esx_vsphere_vm_convert(info)
+
+ vm_status = data['guest.toolsVersionStatus'][0]
+
+ guest_tools_map = {
+ "guestToolsCurrent": (0, "VMware Tools is installed, and the
version is current"),
+ "guestToolsNeedUpgrade": (1, "VMware Tools is installed, but the
version is not current"),
+ "guestToolsNotInstalled": (2, "VMware Tools has never been
installed"),
+ "guestToolsUnmanaged": (1, "VMware Tools is installed, but it
is not managed by VMWare")
+ }
+ state, info = guest_tools_map.get(vm_status, (3, "Unknown status for VMware
Tools"))
+
+ if params:
+ state = params.get(vm_status, state)
+
+ return state, info
+
+check_info['esx_vsphere_vm.guestTools'] = {
+ "inventory_function" : inventory_esx_vsphere_vm_guest_tools,
+ "check_function" : check_esx_vsphere_vm_guest_tools,
+ "service_description" : "ESX Guest Tools",
+ "group" : "vm_guest_tools"
+}
+
#.
# .--Heartbeat-----------------------------------------------------------.
# | _ _ _ _ _ |
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 01f766a..718cee8 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -2107,6 +2107,42 @@ register_check_parameters(
register_check_parameters(
subgroup_os,
+ "vm_guest_tools",
+ _("Virtual machine guest tools status"),
+ Dictionary(
+ optional_keys = False,
+ elements = [
+ ( "guestToolsCurrent",
+ MonitoringState(
+ title = _("VMware Tools is installed, and the version is
current"),
+ default_value = 0,
+ )
+ ),
+ ( "guestToolsNeedUpgrade",
+ MonitoringState(
+ title = _("VMware Tools is installed, but the version is not
current"),
+ default_value = 1,
+ )
+ ),
+ ( "guestToolsNotInstalled",
+ MonitoringState(
+ title = _("VMware Tools has never been installed"),
+ default_value = 2,
+ )
+ ),
+ ( "guestToolsUnmanaged",
+ MonitoringState(
+ title = _("VMware Tools is installed, but it is not managed by
VMWare"),
+ default_value = 1,
+ )
+ ),
+ ]
+ ),
+ None,
+ "dict",
+)
+register_check_parameters(
+ subgroup_os,
"vm_heartbeat",
_("Virtual machine heartbeat status"),
Dictionary(