You have a file (devices.txt) containing IPs and matching hostnames, e.g.,
Code:
192.168.0.1;foobar.com
192.168.0.2;foobar.us
192.168.0.3;foobar.de
192.168.0.4;foobar.ie
192.168.0.5;foobar.si
You could do the follwing to rename Zenoss' devices which match the IP from the
file above with the device's manageIp and set the name to the string after the
semicolon. Run zendmd and enter:
Code:
>>> fnames = open("/tmp/devices.txt", "r")
>>> lines = fnames.readlines()
>>> for d in dmd.Devices.getSubDevices():
... for line in lines:
... lineIp,lineHostname = line.split(";")
... if d.manageIp == lineIp:
... d.renameDevice(lineHostname)
...
>>> commit()
>>>
-------------------- m2f --------------------
Read this topic online here:
http://community.zenoss.com/forums/viewtopic.php?p=18345#18345
-------------------- m2f --------------------
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users