Skip to content

Instantly share code, notes, and snippets.

@dougsyer
Forked from cluther/replacePlugin.py
Created October 31, 2012 11:05
Show Gist options
  • Save dougsyer/3986473 to your computer and use it in GitHub Desktop.
Save dougsyer/3986473 to your computer and use it in GitHub Desktop.
oldPlugin="zenoss.snmp.RouteMap"
newPlugin="IpRouteCSOB"
def replacePlugin(objs):
for obj in objs:
if not obj.hasProperty('zCollectorPlugins'): continue
if oldPlugin not in obj.zCollectorPlugins: continue
print "Replacing plugin for %s." % obj.id
obj.zCollectorPlugins = [
p for p in obj.zCollectorPlugins if p != oldPlugin ]
commit()
replacePlugin([dmd.Devices.Network.Router.Cisco])
replacePlugin(dmd.Devices.Network.Router.Cisco.getSubOrganizers())
replacePlugin(dmd.Devices.Network.Router.Cisco.getSubDevices())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment