Last active
December 31, 2015 16:58
-
-
Save cluther/8016651 to your computer and use it in GitHub Desktop.
Print CSV of device and production state for all devices with at least one JMX datasource bound to the device or a component thereof.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def jmx_datasources(thing): | |
| for template in thing.getRRDTemplates(): | |
| for ds in template.datasources(): | |
| if ds.enabled and ds.sourcetype == 'JMX': | |
| return True | |
| return False | |
| for device in dmd.Devices.getSubDevicesGen(): | |
| if any(map(jmx_datasources, [device] + device.getMonitoredComponents())): | |
| print "{},{}".format(device.id, device.getProductionStateString()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment