Package DataCollector :: Module zendisc :: Class ZenDisc
[hide private]
[frames] | no frames]

Class ZenDisc

source code

Products.DataCollector.zenmodeler.ZenModeler --+
                                               |
                                              ZenDisc

Scan networks and routes looking for devices to add to the ZODB

Instance Methods [hide private]
 
__init__(self, single=True)
Initalizer
source code
function
config(self)
Get the DiscoverService
source code
Twisted deferred
discoverIps(self, nets)
Ping all ips, create entries in the network if necessary.
source code
 
discoverRanges(self, driver)
Ping all IPs in the range and create devices for the ones that come back.
source code
Python iterable
discoverRouters(self, rootdev, seenips=None)
Discover all default routers based on DMD configuration.
source code
 
sendDiscoveredEvent(self, ip, dev=None, sev=2)
Send a 'device discovered' event through zenhub
source code
Python iterable
discoverDevices(self, ips, devicepath="/Discovered", prodState=1000)
Discover devices by active ips that are not associated with a device.
source code
deferred: Twisted deferred
findRemoteDeviceInfo(self, ip, devicePath, deviceSnmpCommunities=None)
Scan a device for ways of naming it: PTR DNS record or a SNMP name
source code
Python iterable
discoverDevice(self, ip, devicepath="/Discovered", prodState=1000)
Discover a device based on its IP address.
source code
Twisted deferred
collectNet(self, driver)
Twisted driver class to iterate through networks
source code
 
printResults(self, results)
Display the results that we've obtained
source code
Twisted deferred
createDevice(self, driver)
Add a device to the system by name or IP.
source code
Twisted deferred
walkDiscovery(self, driver)
Python iterable to go through discovery
source code
Twisted succeed() object
getDeviceList(self)
Our device list comes from our list of newly discovered devices
source code
 
connected(self)
Called by Twisted once a connection has been established.
source code
string
autoAllocate(self, device=None)
Execute a script that will auto allocate devices into their Device Classes
source code
 
buildOptions(self)
Command-line option builder for optparse
source code
Class Variables [hide private]
  initialServices = PBDaemon.initialServices+ ['DiscoverService']
  name = 'zendisc'
  scanned = 0
Method Details [hide private]

__init__(self, single=True)
(Constructor)

source code 
Initalizer
Parameters:
  • single (boolean) - collect from a single device?

config(self)

source code 
Get the DiscoverService
Returns: function
a DiscoverService from zenhub

discoverIps(self, nets)

source code 
Ping all ips, create entries in the network if necessary.
Parameters:
  • nets (list) - list of networks to discover
Returns: Twisted deferred
successful result is a list of IPs that were added

discoverRanges(self, driver)

source code 
Ping all IPs in the range and create devices for the ones that come back.
Parameters:
  • ranges (list) - list of ranges to discover

discoverRouters(self, rootdev, seenips=None)

source code 
Discover all default routers based on DMD configuration.
Parameters:
  • rootdev (device class) - device root in DMD
  • seenips (list of strings) - list of IP addresses
Returns: Python iterable
Twisted/Zenoss Python iterable

sendDiscoveredEvent(self, ip, dev=None, sev=2)

source code 
Send a 'device discovered' event through zenhub
Parameters:
  • ip (strings) - IP addresses
  • dev (device object) - remote device name
  • sev (integer) - severity

discoverDevices(self, ips, devicepath="/Discovered", prodState=1000)

source code 
Discover devices by active ips that are not associated with a device.
Parameters:
  • ips (list of strings) - list of IP addresses
  • devicepath (string) - where in the DMD to put any discovered devices
  • prodState (integer) - production state (see Admin Guide for a description)
Returns: Python iterable
Twisted/Zenoss Python iterable

findRemoteDeviceInfo(self, ip, devicePath, deviceSnmpCommunities=None)

source code 
Scan a device for ways of naming it: PTR DNS record or a SNMP name
Parameters:
  • ip (string) - IP address
  • devicePath (string) - where in the DMD to put any discovered devices
  • deviceSnmpCommunities (list) - Optional list of SNMP community strings to try, overriding those set on the device class
Returns: deferred: Twisted deferred
result is None or a tuple containing (community, port, version, snmp name)

discoverDevice(self, ip, devicepath="/Discovered", prodState=1000)

source code 
Discover a device based on its IP address.
Parameters:
  • ip (string) - IP address
  • devicepath (string) - where in the DMD to put any discovered devices
  • prodState (integer) - production state (see Admin Guide for a description)
Returns: Python iterable
Twisted/Zenoss Python iterable

collectNet(self, driver)

source code 
Twisted driver class to iterate through networks
Parameters:
  • driver (Zenoss driver) - Zenoss driver
Returns: Twisted deferred
successful result is a list of IPs that were added

printResults(self, results)

source code 
Display the results that we've obtained
Parameters:
  • results (string) - what we've discovered

createDevice(self, driver)

source code 
Add a device to the system by name or IP.
Parameters:
  • driver (Twisted/Zenoss object) - driver object
Returns: Twisted deferred
Twisted deferred

walkDiscovery(self, driver)

source code 
Python iterable to go through discovery
Returns: Twisted deferred
Twisted deferred

getDeviceList(self)

source code 
Our device list comes from our list of newly discovered devices
Returns: Twisted succeed() object
list of discovered devices

autoAllocate(self, device=None)

source code 
Execute a script that will auto allocate devices into their Device Classes
Parameters:
  • device (device object) - device object
Returns: string
Device class path to put the new device

To Do: make it actually work