Feb 21, 2014 6:04 AM
Zenoss and DNS lookups
-
Like (0)
Hi,
I've had serveral issues caused by the fact that Zenoss doesn't automatically refresh DNS and IPs on hosts. I know I can do it manually via "Actions" -> "Reset IP". I know how to do this via zendmd and scripts. What I'd like to know is if there is a way to get Zenoss to call the "Reset IP" function regularly via the web interface? eg, could I get the event manager to call it or something? I'd prefer to have it called via the webinterface as it'd be more visible to the other users/administrators of Zenoss. Thanks.
Joan
I couldn't find a way to do this via the webinterface so in the end I just added the following script to the zenoss crontab. Hope it's helpful for someone.
#!/zenoss/python/bin/python
# Joan - this will do a dns refresh on all hosts via cron
import Globals, sys
import transaction
from Products.ZenUtils.ZenScriptBase import ZenScriptBase
dmd = None
try:
dmd = ZenScriptBase(connect=True).dmd
except Exception, e:
print "Connection to zenoss dmd failed: %s\n" % e
sys.exit(1)
for dev in dmd.Devices.getSubDevices_recursive():
print dev.getDeviceName()
dev.setManageIp()
trans = transaction.get()
trans.commit()
print ""
print "DNS Refresh has been run - note - this will not work on hosts with no DNS records or duplicate IP entries."
Follow Us On Twitter »
|
Latest from the Zenoss Blog » | Community | Products | Services Resources | Customers Partners | About Us | ||
Copyright © 2005-2011 Zenoss, Inc.
|
||||||||