On Sep 8, 2008, at 1:30 AM, zarxcky wrote:
Sorry for typo on my first post. Instead of More -> Manage IP, the
post should say Manage -> Reset IP.
Thanks for quick reply. And your scripts kind of promising too. But
then, I was looking for ways to emulate the UI way to reset the IP
to get new one from DNS, but within command line or python scripts,
since the devices I am monitoring now use dynamic line which get
their dynamic IP from ISP. The device currently run ddclient which
will updating the IP changes to the dyndns.org server name that I
have created before.
Every time the dynamic IP changes, the device send event 'ip <ip
number> has down' to Zenoss server, and the way I always did to
clear that event out is through UI, which is:
1- Go to device page
2- Click Manage -> Reset IP
3- Leave blank to use DNS (which will get new IP from DNS)
4- Go to Device Events & Acknowledge/push the red alert events to
history
5- Push changes
6- Remodel the device.
But for < 100 servers run on dynamic IP and increasing, I wish there
are far more practical way to do that..
Not really good in Python, so struggling a bit to get this thing done.
I bet the keys is within the zendmd, So first thing on my list to
emulate in zendmd is the 2nd and 3rd step shown above which will be
Click Manage -> Reset IP & Leave blank to use DNS. How to emulate
that in zendmd..
Will play a lot more with zendmd, but I welcome those who can help
with this problem.
Thanks Scott, will study your code and perhaps tweak little bit here
and there if you wont mind.
If you run the setManageIp method of a device with no parameters it
will use DNS to figure it out.
for d in dmd.Devices.getSubDevices():
d.setManageIp()
commit()
Be aware that this will blank out the IP address for devices that
can't be resolved with DNS. You may want to do the following
afterwards to find any devices with a blank manageIp so that you can
get them added to DNS.
pprint([ d.id for d in dmd.Devices.getSubDevices() if d.manageIp ==
"" ])
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users