Discussion:
Zenoss and DNS lookups
joanypony
2014-02-21 11:04:30 UTC
Permalink
joanypony [http://community.zenoss.org/people/joanypony] created the discussion

"Zenoss and DNS lookups"

To view the discussion, visit: http://community.zenoss.org/message/75705#75705

--------------------------------------------------------------
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
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/75705#75705]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
joanypony
2014-03-10 09:40:07 UTC
Permalink
joanypony [http://community.zenoss.org/people/joanypony] created the discussion

"Re: Zenoss and DNS lookups"

To view the discussion, visit: http://community.zenoss.org/message/75720#75720

--------------------------------------------------------------
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."
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/75720#75720]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...