Module: check_mk
Branch: master
Commit: 30db0991ce7d732188284ccace49fd193251c271
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=30db0991ce7d73…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Jun 9 13:56:46 2015 +0200
#2308 agent_vsphere, esx_vsphere_sensors: now reports additional sensor information (cpu,
storage controller, memory)
The agent_vsphere now queries these additional objects
<ul>
<li>runtime.healthSystemRuntime.hardwareStatusInfo.storageStatusInfo</li>
<li>runtime.healthSystemRuntime.hardwareStatusInfo.cpuStatusInfo</li>
<li>runtime.healthSystemRuntime.hardwareStatusInfo.memoryStatusInfo</li>
</ul>
The esx_vsphere_sensor check will report any problems regarding the
raid controller, the health of the CPU and the DIMM modules.
---
.werks/2308 | 17 +++++++++++++++
ChangeLog | 1 +
agents/special/agent_vsphere | 49 +++++++++++++++++++++++++++++-------------
checks/esx_vsphere_sensors | 3 ++-
4 files changed, 54 insertions(+), 16 deletions(-)
diff --git a/.werks/2308 b/.werks/2308
new file mode 100644
index 0000000..1e1229e
--- /dev/null
+++ b/.werks/2308
@@ -0,0 +1,17 @@
+Title: agent_vsphere, esx_vsphere_sensors: now reports additional sensor information
(cpu, storage controller, memory)
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i2
+Date: 1433850734
+Class: feature
+
+The agent_vsphere now queries these additional objects
+<ul>
+<li>runtime.healthSystemRuntime.hardwareStatusInfo.storageStatusInfo</li>
+<li>runtime.healthSystemRuntime.hardwareStatusInfo.cpuStatusInfo</li>
+<li>runtime.healthSystemRuntime.hardwareStatusInfo.memoryStatusInfo</li>
+</ul>
+
+The esx_vsphere_sensor check will report any problems regarding the
+raid controller, the health of the CPU and the DIMM modules.
diff --git a/ChangeLog b/ChangeLog
index 1161a67..5a40741 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,7 @@
* 2219 hr_cpu: Reworked check to use WATO rule allowing averaging and predictive
levels...
NOTE: Please refer to the migration notes!
* 1255 AIX Agent now supports fileinfo. Thanks to Falk Grunert (IBM)
+ * 2308 agent_vsphere, esx_vsphere_sensors: now reports additional sensor information
(cpu, storage controller, memory)...
* 2323 FIX: df: Fix new graphs for all filesystem checks in case of existing inode
information
* 2305 FIX: agent_vsphere, esx_vsphere_sensors: now able to handle sensor names with
semicolon...
* 2118 FIX: aix_sap_processlist: agent plugin now is more general to deal with
various AIX versions...
diff --git a/agents/special/agent_vsphere b/agents/special/agent_vsphere
index 84f97eb..582012e 100755
--- a/agents/special/agent_vsphere
+++ b/agents/special/agent_vsphere
@@ -32,6 +32,9 @@
import httplib, pprint, sys, os, getopt, socket, time, datetime, re
+# Great article how to get additional information
+#
http://www.veeam.com/kb1007
+
telegram_list = {
"systeminfo":
'<ns1:RetrieveServiceContent
xsi:type="ns1:RetrieveServiceContentRequestType">'\
@@ -177,6 +180,9 @@ telegram_list = {
'<ns1:pathSet>name</ns1:pathSet>'\
'<ns1:pathSet>overallStatus</ns1:pathSet>'\
'<ns1:pathSet>runtime.healthSystemRuntime.systemHealthInfo.numericSensorInfo</ns1:pathSet>'\
+
'<ns1:pathSet>runtime.healthSystemRuntime.hardwareStatusInfo.storageStatusInfo</ns1:pathSet>'\
+
'<ns1:pathSet>runtime.healthSystemRuntime.hardwareStatusInfo.cpuStatusInfo</ns1:pathSet>'\
+
'<ns1:pathSet>runtime.healthSystemRuntime.hardwareStatusInfo.memoryStatusInfo</ns1:pathSet>'\
'<ns1:pathSet>runtime.inMaintenanceMode</ns1:pathSet>'\
'<ns1:pathSet>hardware.memorySize</ns1:pathSet></ns1:propSet>'\
'<ns1:objectSet><ns1:obj
type="Folder">%(rootFolder)s</ns1:obj><ns1:skip>false</ns1:skip>'\
@@ -852,6 +858,15 @@ if not error:
"currentReading": currentReading, "unitModifier": unitModifier,
"baseUnits":
baseUnits, "sensorType": sensorType }
+ def eval_hardwarestatus_info(sensor_propset):
+ sensor_pattern = ""
+ for key in [ "name", "label",
"summary", "key" ]:
+ sensor_pattern +=
"<%(name)s>(.*?)</%(name)s>.*?" % { "name": key}
+
+ sensor_data = get_pattern(sensor_pattern, sensor_propset)
+ for name, label, summary, key in sensor_data:
+ hostsystems_sensors[hostname][name] = { "name": name,
"label": label, "summary": summary, "key": key }
+
def eval_multipath_state(multipath_propset):
multipaths =
get_pattern("<name>(.*?)</name><pathState>(.*?)</pathState>",
value)
for mp_name, mp_state in multipaths:
@@ -888,11 +903,14 @@ if not error:
keys_index[key] = idx
eval_functions = {
- "config.multipathState.path"
: eval_multipath_state,
-
"runtime.healthSystemRuntime.systemHealthInfo.numericSensorInfo":
eval_sensor_info,
- "hardware.cpuPkg"
: eval_cpu_pkg,
- "hardware.pciDevice"
: eval_pci_device,
- "hardware.systemInfo.otherIdentifyingInfo"
: eval_systeminfo_other,
+ "config.multipathState.path"
: eval_multipath_state,
+
"runtime.healthSystemRuntime.systemHealthInfo.numericSensorInfo" :
eval_sensor_info,
+
"runtime.healthSystemRuntime.hardwareStatusInfo.storageStatusInfo":
eval_hardwarestatus_info,
+
"runtime.healthSystemRuntime.hardwareStatusInfo.cpuStatusInfo" :
eval_hardwarestatus_info,
+
"runtime.healthSystemRuntime.hardwareStatusInfo.memoryStatusInfo" :
eval_hardwarestatus_info,
+ "hardware.cpuPkg"
: eval_cpu_pkg,
+ "hardware.pciDevice"
: eval_pci_device,
+ "hardware.systemInfo.otherIdentifyingInfo"
: eval_systeminfo_other,
}
elements =
get_pattern('<propSet><name>(.*?)</name><val.*?>(.*?)</val></propSet>',
entry)
@@ -909,22 +927,23 @@ if not error:
print "<<<esx_vsphere_hostsystem>>>"
for key in sorted(properties.keys()):
- if key ==
"runtime.healthSystemRuntime.systemHealthInfo.numericSensorInfo":
- continue
- value = properties[key]
- print "%s %s" % (key, " ".join(value))
+ print "%s %s" % (key, " ".join(properties[key]))
print "<<<esx_vsphere_sensors:sep(59)>>>"
for key in sorted(hostsystems_sensors[hostname].keys()):
data = hostsystems_sensors[hostname][key]
if data["key"] in ["green",
"unknown"]:
continue
- line = '%s;%s;%s;%s;%s;' %
(data["name"].replace(";", "_"),
data["baseUnits"], data["currentReading"],
- data["sensorType"],
data["unitModifier"])
- if "rateUnits" in data:
- line += data["rateUnits"]
- line += ";%s;%s;%s" % ( data["key"],
data["label"], data["summary"] )
- print line
+ print '%s;%s;%s;%s;%s;%s;%s;%s;%s' % (
+ data["name"].replace(";",
"_"),
+ data.get("baseUnits", ""),
+ data.get("currentReading", ""),
+ data.get("sensorType", ""),
+ data.get("unitModifier", ""),
+ data.get("rateUnits", ""),
+ data["key"],
+ data["label"],
+ data["summary"].replace(";",
"_"))
###########################
diff --git a/checks/esx_vsphere_sensors b/checks/esx_vsphere_sensors
index 0441d51..ffb084a 100644
--- a/checks/esx_vsphere_sensors
+++ b/checks/esx_vsphere_sensors
@@ -39,6 +39,7 @@ def check_esx_vsphere_sensors(_no_item, params, info):
sensor_state_modified = False
for name, base_units, current_reading, sensor_type, unit_modifier, rate_units,
health_key, health_label, health_summary in info:
+ health_key = health_key.lower()
if health_key == "green":
continue # usually not output by agent anyway
infos.append("%s: %s (%s)" % (name, health_label, health_summary))
@@ -58,7 +59,7 @@ def check_esx_vsphere_sensors(_no_item, params, info):
new_state = entry.get("states").get(str(sensor_state))
if new_state != None:
sensor_state = new_state
- extra_info = "(state modified by rule)"
+ extra_info = "(Alert state has been modified by
Check_MK rule)"
sensor_state_modified = True
state = max(state, sensor_state)