ZenDMD Tip - Quickly Audit Enterprise Collectors

From Zenoss Wiki
Revision as of 19:11, 16 October 2017 by Trelane (Talk | contribs)$7

(diff) ← Older revision | Approved revision (diff) | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Ever need to quickly audit your collectors? If not, you will someday. Here's how.

Note: Uses organization of EnterpriseCollectors

Run the following in zendmd:

for hubObj in dmd.Monitors.Hub.getHubs():
    print "Hub " + hubObj.id
    for collectorObj in hubObj.collectors():
        print "    Collector " + collectorObj.id
        collectorDevices = collectorObj.getDevices()
        collectorDeviceComponents = []
        collectorComponents = 0
        collectorDatapoints = 0
        for collectorDeviceObj in collectorDevices:
            collectorDeviceComponents = collectorDeviceObj.getDeviceComponents()
            collectorComponents = collectorComponents + len(collectorDeviceComponents)
            collectorDatapoints = collectorDatapoints + len(collectorDeviceObj.getRRDDataPoints()) 
            for collectorDeviceComponentObj in collectorDeviceComponents:
                collectorDatapoints = collectorDatapoints + len(collectorDeviceComponentObj.getRRDDataPoints())
        print "        Devices " + str(len(collectorDevices))
        print "        Components " + str(collectorComponents)
        print "        Datapoints " + str(collectorDatapoints)