Skip to content

Instantly share code, notes, and snippets.

@cluther cluther/gist:1076520
Created Jul 11, 2011

Embed
What would you like to do?
Fix Collector Associations
# Remove non-existent devices from performance monitors
from Products.ZenModel.PerformanceConf import PerformanceConf
for pmon in dmd.Monitors.Performance.objectValues():
if not isinstance(pmon, PerformanceConf): continue
for device in pmon.devices():
try:
bah = device.primaryAq()
except Exception:
print "Removing %s from %s" % (device.id, pmon.id)
pmon.devices._remove(device)
# Save changes
commit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.