List Device Data Points

From Zenoss Wiki
This is the approved revision of this page, as well as being the most recent.
Jump to: navigation, search

Below ZenDMD script would allow you to list Device Data points .

Steps to Run it :

$ chmod a+x
$ chown zenoss.
$ python > /tmp/datapoints.txt

import Globals
from Products.ZenUtils.ZCmdBase import ZCmdBase
dmd = ZCmdBase().dmd
counts = {}
for poll in dmd.Monitors.Performance.objectValues("PerformanceConf"):
    counts[] = {}
    for d in poll.devices():
        d = d.primaryAq()
        dc = d.deviceClass().primaryAq().getPrimaryId()[10:]
        if not counts[].has_key(dc):
        counts[][dc] = {'devices': 0, 'datapoints': 0}
        comps = d.getMonitoredComponents()
        datapoints = sum([comp.getRRDDataPoints() for comp in comps], []) + d.getRRDDataPoints()
        counts[][dc]['devices'] += 1
        counts[][dc]['datapoints'] += len(datapoints)

Script can be downloaded from: GitHub