Skip to content

Instantly share code, notes, and snippets.

@GothAck GothAck/gist:6726943
Created Sep 27, 2013

Embed
What would you like to do?
Reclassify servers in Zenoss, keeping their title
for dev in dmd.Devices.Server.Linux.getSubDevices():
if 'MyNewClass' in [a for x in dev.path() for a in x]:
print 'Already moved %s: %s' % (dev.id, dev.title)
continue
title = dev.title
id = dev.id
dev.changeDeviceClass('/Server/Linux/MyNewClass')
sync()
dev = find(id)
dev.title = title
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.