Skip to content

Commit

Permalink
Zabbix Helper Module is now able to process item values and return Za…
Browse files Browse the repository at this point in the history
…bbix LLD data
  • Loading branch information
dnaeon committed Jan 9, 2014
1 parent 5105512 commit 703df38
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/vpoller/helpers/zabbix.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ def zabbix_item_value(self):
The property value from the result message
"""
pass
property_name = self.msg['property']

return self.data['result'][property_name]

def zabbix_lld_data(self):
"""
Expand All @@ -95,6 +97,19 @@ def zabbix_lld_data(self):
For more information about Zabbix LLD, please refer to link below:
- https://www.zabbix.com/documentation/2.2/manual/discovery/low_level_discovery
The result attribute names are in Zabbix Macro-like format, e.g.
{#vSphere.<attribute>}: <value>
"""
pass
result = self.data['result']

data = []

for eachItem in result:
props = [('{#vSphere.' + k + '}', v) for k, v in eachItem.items()]
data.append(dict(props))

return json.dumps({ 'data': data }, indent=4)

0 comments on commit 703df38

Please sign in to comment.