On Sep 9, 2008, at 5:18 AM, zarxcky wrote:
The pointer that you gave me really helpful. Following this link:
http://www.zenoss.com/community/docs/zenoss-api-docs/2.2/, I now
manage to identify the steps that should be taken within zendmd.
Testing with one device first:
Manual UI way:
1- Go to device page
2- Click Manage -> Reset IP & Leave blank to use DNS (which will get
new IP from DNS)
3- Go to Device Events & Acknowledge/push the red alert events to
history
4- Clear Heartbeats
5- Push changes
6- Remodel the device.
Zendmd way:
1- find('clf*')
Returns:
<Device at /zport/dmd/Devices/Server/Dumas/devices/
clfantasy.dyndns.org>
d = find('clf*')
2- d.getManageIp()
'xx.xx.2.183' <--- OLD IP
d.setManageIp()
'xx.xxx.48.189' <--- NEW IP from DNS
commit()
3- I dont see what class should I used to push red alert event down
to history, perhaps the Zen Master could enlighten me on this one.
[Wink]
Now you're really getting into it.
evids = [ e.evid for e in dmd.ZenEventManager.getEventListME(d) ]
dmd.ZenEventManager.manage_deleteEvents(evids)
4- Clear Heartbeats
dmd.ZenEventManager.clearHeartbeats()
5- Push changes
d.pushConfig()
6- Remodel the device.
d.collectDevice()
Refreshing my zenoss page, I can see the the IP has change,
everything green coming back again EXCEPT the red alert event still
inside the Event tab since I haven't do anything about that one
inside the zendmd.
Thanks Chet!! Really appreciate it.. If only you can tell me what
class to use to push the red event down to history... that will make
much more cool! I start to like zendmd now..
Okay, with my limited knowledge in Python, I will now try to write
some script for mass-resetting devices DNS.. [Idea]
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users