Package ZenRRD :: Module zenperfsnmp :: Class zenperfsnmp
[hide private]
[frames] | no frames]

Class zenperfsnmp

source code

Products.ZenHub.PBDaemon.PBDaemon --+        
                                    |        
                  RRDDaemon.RRDDaemon --+    
                                        |    
                    SnmpDaemon.SnmpDaemon --+
                                            |
                                           zenperfsnmp

Periodically query all devices for SNMP values to archive in RRD files

Instance Methods [hide private]
 
__init__(self, noopts=0)
Create any base performance directories (if necessary), load cached configuration data and clean up any old RRD files (if specified by --checkAgingFiles)
source code
 
pickleName(self, id)
Return the path to the pickle file for a device
source code
 
loadConfigs(self)
Read cached configuration values from pickle files at startup.
source code
 
cleanup(self, fullPath)
Delete an old RRD file
source code
 
reportOldFile(self, fullPath)
Add an RRD file to the list of files to be removed
source code
 
remote_updateDeviceList(self, devices)
Gather the list of devices from zenhub, update all devices config in the list of devices, and remove any devices that we know about, but zenhub doesn't know about.
source code
 
startUpdateConfig(self, driver)
Periodically ask the Zope server for basic configuration data.
source code
 
updateDeviceList(self, responses, requested)
Update the config for devices
source code
SnmpConnInfo class
updateAgentProxy(self, deviceName, snmpConnInfo)
Create or update proxy
source code
 
updateSnmpStatus(self, status)
Update the SNMP failure counts from Status database
source code
 
remote_deleteDevice(self, doomed)
Allows zenhub to delete a device from our configuration
source code
 
remote_updateDeviceConfig(self, snmpTargets)
Allows zenhub to update our device configuration
source code
 
updateDeviceConfig(self, configs)
Examine the given device configuration, and if newer update the device as well as its pickle file.
source code
 
scanCycle(self, *unused) source code
 
setUnresponsiveDevices(self, arg)
Remember all the unresponsive devices
source code
 
readDevices(self, unused=None)
Periodically fetch the performance values from all known devices
source code
 
reportRate(self, *unused)
Finished reading all the devices, report stats and maybe stop
source code
 
checkOldFiles(self)
Send an event showing whether we have old files or not
source code
 
startReadDevice(self, deviceName)
Initiate a request (or several) to read the performance data from a device
source code
 
badOid(self, deviceName, oid)
Report any bad OIDs (eg to a file log and Zenoss event) and then remove the OID so we dont generate any further errors.
source code
 
storeValues(self, updates, deviceName)
Decode responses from devices and store the elements in RRD files
source code
 
storeRRD(self, device, oid, value)
Store a value into an RRD file
source code
 
connected(self)
Run forever, fetching and storing
source code
 
buildOptions(self)
Build a list of command-line options
source code

Inherited from SnmpDaemon.SnmpDaemon: setPropertyItems

Inherited from RRDDaemon.RRDDaemon: error, errorStop, getDevicePingIssues, logError, model, remote_setPropertyItems, sendThresholdEvent

Class Variables [hide private]
  maxRrdFileAge = 30*(24* 60* 60)
  perfsnmpConfigInterval = 20* 60
  perfsnmpCycleInterval = 5* 60
  properties = SnmpDaemon.properties+('perfsnmpCycleInterval',)
  initialServices = SnmpDaemon.initialServices+ ['SnmpPerfConfig']

Inherited from SnmpDaemon.SnmpDaemon: heartbeatTimeout, snmpCycleInterval

Inherited from RRDDaemon.RRDDaemon: configCycleInterval, rrd, shutdown, thresholds

Method Details [hide private]

__init__(self, noopts=0)
(Constructor)

source code 
Create any base performance directories (if necessary), load cached configuration data and clean up any old RRD files (if specified by --checkAgingFiles)
Overrides: SnmpDaemon.SnmpDaemon.__init__

loadConfigs(self)

source code 

Read cached configuration values from pickle files at startup.

NB: We cache in pickles to get a full collect cycle, because
    loading the initial config can take several minutes.

remote_updateDeviceList(self, devices)

source code 

Gather the list of devices from zenhub, update all devices config in the list of devices, and remove any devices that we know about, but zenhub doesn't know about.

NB: This is callable from within zenhub.
Overrides: RRDDaemon.RRDDaemon.remote_updateDeviceList

updateAgentProxy(self, deviceName, snmpConnInfo)

source code 
Create or update proxy
Parameters:
  • deviceName (string) - device name known by zenhub
  • snmpConnInfo (class SnmpConnInfo from Products/ZenHub/services/PerformanceConfig.py) - object information passed from zenhub
Returns: SnmpConnInfo class
connection information from the proxy

updateDeviceConfig(self, configs)

source code 
Examine the given device configuration, and if newer update the device as well as its pickle file. If no SNMP proxy created for the device, create one.

storeRRD(self, device, oid, value)

source code 
Store a value into an RRD file
Parameters:
  • device (string) - remote device name
  • oid (string) - SNMP OID used as our performance metric
  • value (number) - data to be stored

buildOptions(self)

source code 
Build a list of command-line options
Overrides: RRDDaemon.RRDDaemon.buildOptions