Module: check_mk
Branch: master
Commit: 3dcc2a8b9e5e1d9b42e30aeaf11fbe987e247cf1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3dcc2a8b9e5e1d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri May 31 14:16:00 2013 +0200
agent_vsphere: Fix missing sensors section when querying vcenter
---
ChangeLog | 2 ++
agents/special/agent_vsphere | 12 ++++++------
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1b539b9..fa16093 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,8 @@
* lnx_if: Fixed crash on missing "Address" field
* viprinet_router: Now able to set required target state via rule
* windows_agent: Now available as 64 bit version
+ * agent_vsphere: fix problem where sensors were missing when
+ you queried multiple host systems via vCenter
Notifications:
* Flexible Notification can now filter service levels
diff --git a/agents/special/agent_vsphere b/agents/special/agent_vsphere
index 24f4e29..22644d5 100755
--- a/agents/special/agent_vsphere
+++ b/agents/special/agent_vsphere
@@ -520,12 +520,12 @@ def output_mors(what, properties, direct=False):
obj_type = MORTypes.VirtualMachine
count = 0
- sections = []
mors = host._retrieve_properties_traversal(property_names=properties.keys(),
obj_type=obj_type)
if not mors:
return
for mor in mors:
+ sections = []
count += 1
# Parse result into a dictionary. Key is the property name,
# value is the value (some custom Python classes)
@@ -564,12 +564,12 @@ def output_mors(what, properties, direct=False):
obj_name = opt_hostname
object_collection.append([what, obj_name, running_on, power_state])
+ # pprint.pprint(sections)
+ for section_name, section_lines in sections:
+ print '<<<%s>>>' % section_name
+ for line in section_lines:
+ print line
- # pprint.pprint(sections)
- for section_name, section_lines in sections:
- print '<<<%s>>>' % section_name
- for line in section_lines:
- print line
def output_datastores():
property_names = [