Archived community.zenoss.org | full text search
Skip navigation
Currently Being Moderated

ZenDMD - Search for IP addresses

VERSION 1 
Created on: Sep 14, 2009 11:21 AM by Noel Brockett - Last Modified:  Sep 14, 2009 11:21 AM by Noel Brockett
import re
ipsearch = re.compile('192\.168\.1\.[0-9]{1,3}')
#for d in dmd.Groups.<groupname>.getSubDevices():
#for d in dmd.Devices.getSubDevices():
for d in dmd.Devices.getSubDevices():
     for i in d.os.interfaces():
          ipaddress = i.getIpAddress()
          if ipaddress == None:
               continue
          else:
               if ipsearch.search(ipaddress):
                    print d.id+" "+ipaddress
Comments (0)