Quantcast
Channel: Zenoss Community: Message List
Viewing all articles
Browse latest Browse all 1118

Re: Zenoss and DNS lookups

$
0
0

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


Viewing all articles
Browse latest Browse all 1118

Trending Articles