Richard Evans
2013-05-07 15:16:43 UTC
Richard Evans [http://community.zenoss.org/people/Richard.evans%40schwab.com] created the discussion
"JSON parser for zencommand"
To view the discussion, visit: http://community.zenoss.org/message/73085#73085
--------------------------------------------------------------
I found an old ZenPack for createing Event Histograms (see: http://community.zenoss.org/docs/DOC-4538 http://community.zenoss.org/docs/DOC-4538 http://community.zenoss.org/docs/DOC-4538 Event Histograms), but it doesn't appear to be current. So, I took a look at what I could do now.
I found:Â getEventSeveritiesCount()Â which when scripted like:
   dmd = ZenScriptBase(connect=True).dmd
   print dmd.Devices.getEventSeveritiesCount()
gives me what I think I want:
    {'info': {'count': 1057, 'acknowledged_count': 0}, 'clear': {'count': 0, 'acknowledged_count': 0}, 'warning': {'count': 333, 'acknowledged_count': 0}, 'critical': {'count': 376, 'acknowledged_count': 0}, 'error': {'count': 2937, 'acknowledged_count': 2}, 'debug': {'count': 244, 'acknowledged_count': 0}}
which is very nicely formatted JSON (and, if I want, i can iterated over the Device sub-classes).
I've read that the zencommand collector can parse JSON.Â
1. Is that the "Auto" parser? (nothing in the list says "JSON")
2. How do I structure the datapoints under this datasource?
TIA!
Richard Evans

--------------------------------------------------------------
Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/73085#73085]
Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
"JSON parser for zencommand"
To view the discussion, visit: http://community.zenoss.org/message/73085#73085
--------------------------------------------------------------
I found an old ZenPack for createing Event Histograms (see: http://community.zenoss.org/docs/DOC-4538 http://community.zenoss.org/docs/DOC-4538 http://community.zenoss.org/docs/DOC-4538 Event Histograms), but it doesn't appear to be current. So, I took a look at what I could do now.
I found:Â getEventSeveritiesCount()Â which when scripted like:
   dmd = ZenScriptBase(connect=True).dmd
   print dmd.Devices.getEventSeveritiesCount()
gives me what I think I want:
    {'info': {'count': 1057, 'acknowledged_count': 0}, 'clear': {'count': 0, 'acknowledged_count': 0}, 'warning': {'count': 333, 'acknowledged_count': 0}, 'critical': {'count': 376, 'acknowledged_count': 0}, 'error': {'count': 2937, 'acknowledged_count': 2}, 'debug': {'count': 244, 'acknowledged_count': 0}}
which is very nicely formatted JSON (and, if I want, i can iterated over the Device sub-classes).
I've read that the zencommand collector can parse JSON.Â
1. Is that the "Auto" parser? (nothing in the list says "JSON")
2. How do I structure the datapoints under this datasource?
TIA!
Richard Evans

--------------------------------------------------------------
Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/73085#73085]
Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]