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

Class zenprocess

source code

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

Daemon class to connect to an SNMP agent and determine the processes that are running on that server.

Instance Methods [hide private]
 
__init__(self, noopts=False)
Initializer for common SNMP daemon classes
source code
dictionary of device name, device object
devices(self)
Return the list of devices that are available
source code
Twisted deferred
fetchConfig(self)
Get configuration values from zenhub
source code
 
remote_deleteDevice(self, doomed)
Called from zenhub to remove a device from our configuration
source code
 
remote_updateDeviceList(self, devices)
Called from zenhub to update the devices to monitor
source code
 
clearSnmpError(self, name, message)
Send an event to clear other events.
source code
 
remote_updateDevice(self, cfg)
Twisted remote callback, to allow zenhub to remotely update this daemon.
source code
 
updateDevices(self, cfgs, fetched)
Called when the zenhub service getSnmpStatus completes.
source code
 
start(self, driver)
Read the basic config needed to do anything, and to reread the configuration information on a periodic basis.
source code
 
updateSnmpStatus(self, updates)
Called when the zenhub service getSnmpStatus completes.
source code
 
updateProcessStatus(self, status)
Called when the zenhub service getProcessStatus completes.
source code
Twisted deferred object
oneDevice(self, device)
Contact one device and return a deferred which gathers data from the device.
source code
Twisted deferred
scanDevice(self, device)
Fetch all the process info for a device using SNMP table gets
source code
 
deviceFailure(self, reason, device)
Twisted errBack to log the exception for a single device.
source code
dictionary, dictionary, dictionary, list of tuples
mapResultsToDicts(self, results)
Parse the process tables and reconstruct the list of processes that are on the device.
source code
 
showProcessList(self, device_name, procs)
Display the processes in a sane manner.
source code
 
storeProcessNames(self, results, device)
Parse the process tables and reconstruct the list of processes that are on the device.
source code
 
periodic(self, unused=None)
Main loop that drives all other processing.
source code
 
fetchPerf(self, device)
Get performance data for all the monitored processes on a device
source code
 
storePerfStats(self, results, device)
Save the process performance data in RRD files
source code
 
save(self, deviceName, pidName, statName, value, rrdType, min='U', max='U')
Save a value into an RRD file
source code
 
heartbeat(self)
Twisted keep-alive mechanism to ensure that we're still connected to zenhub.
source code
 
connected(self)
Gather our configuration and start collecting status information.
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]
  statusEvent = {'eventClass': Status_OSProcess, 'eventGroup': '...
  initialServices = SnmpDaemon.initialServices+ ['ProcessConfig']
  processConfigInterval = 20* 60
  processCycleInterval = 5* 60
  properties = SnmpDaemon.properties+('processCycleInterval',)
  missing = 0
  restarted = 0
  parallelJobs = 10

Inherited from SnmpDaemon.SnmpDaemon: heartbeatTimeout, snmpCycleInterval

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

Method Details [hide private]

__init__(self, noopts=False)
(Constructor)

source code 
Initializer for common SNMP daemon classes
Overrides: SnmpDaemon.SnmpDaemon.__init__
(inherited documentation)

devices(self)

source code 
Return the list of devices that are available
Returns: dictionary of device name, device object
device list

fetchConfig(self)

source code 
Get configuration values from zenhub
Returns: Twisted deferred
Twisted deferred

remote_deleteDevice(self, doomed)

source code 
Called from zenhub to remove a device from our configuration
Parameters:
  • doomed (string) - device to delete

remote_updateDeviceList(self, devices)

source code 
Called from zenhub to update the devices to monitor
Parameters:
  • devices (list of (device, changetime) tuples) - devices to monitor
Overrides: RRDDaemon.RRDDaemon.remote_updateDeviceList

clearSnmpError(self, name, message)

source code 
Send an event to clear other events.
Parameters:
  • name (string) - device for which the event applies
  • message (string) - clear text

remote_updateDevice(self, cfg)

source code 
Twisted remote callback, to allow zenhub to remotely update this daemon.
Parameters:
  • cfg (object) - configuration information returned from zenhub

updateDevices(self, cfgs, fetched)

source code 
Called when the zenhub service getSnmpStatus completes.
Parameters:
  • cfgs (list of objects) - configuration information returned from zenhub
  • fetched (list of strings) - names we want zenhub to return information about

updateSnmpStatus(self, updates)

source code 
Called when the zenhub service getSnmpStatus completes.
Parameters:
  • updates (list of (string, int)) - List of names and error counts

updateProcessStatus(self, status)

source code 
Called when the zenhub service getProcessStatus completes.
Parameters:
  • status (list of (string, string, int)) - List of names, component names and error counts

oneDevice(self, device)

source code 
Contact one device and return a deferred which gathers data from the device.
Parameters:
  • device (Device object) - proxy object to the remote computer
Returns: Twisted deferred object
job to scan a device

scanDevice(self, device)

source code 
Fetch all the process info for a device using SNMP table gets
Parameters:
  • device (Device object) - proxy connection object
Returns: Twisted deferred
Twisted deferred

deviceFailure(self, reason, device)

source code 
Twisted errBack to log the exception for a single device.
Parameters:
  • reason (Twisted error instance) - explanation of the failure
  • device (Device object) - proxy connection object

mapResultsToDicts(self, results)

source code 
Parse the process tables and reconstruct the list of processes that are on the device.
Parameters:
  • results (dictionary of dictionaries) - results of SNMP table gets ie (OID + pid, value)
Returns: dictionary, dictionary, dictionary, list of tuples
maps relating names and pids to each other

showProcessList(self, device_name, procs)

source code 
Display the processes in a sane manner.
Parameters:
  • device_name (string) - name of the device
  • procs (list of tuples) - list of (pid, (name, args))

storeProcessNames(self, results, device)

source code 
Parse the process tables and reconstruct the list of processes that are on the device.
Parameters:
  • results (dictionary of dictionaries) - results of SNMP table gets
  • device (Device object) - proxy connection object

fetchPerf(self, device)

source code 
Get performance data for all the monitored processes on a device
Parameters:
  • device (Device object) - proxy object to the remote computer

storePerfStats(self, results, device)

source code 
Save the process performance data in RRD files
Parameters:
  • results (list of (success, result) tuples) - results of SNMP table gets
  • device (Device object) - proxy object to the remote computer

save(self, deviceName, pidName, statName, value, rrdType, min='U', max='U')

source code 
Save a value into an RRD file
Parameters:
  • deviceName (string) - name of the remote device (ie a hostname)
  • pidName (string) - process id of the monitored process
  • statName (string) - metric name
  • value (number) - data to be stored
  • rrdType (string) - RRD data type (eg ABSOLUTE, DERIVE, COUNTER)
  • min (number) - minimum value acceptable for this metric
  • max (number) - maximum value acceptable for this metric

connected(self)

source code 
Gather our configuration and start collecting status information. Called after connected to the zenhub service.

buildOptions(self)

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

Class Variable Details [hide private]

statusEvent

Value:
{'eventClass': Status_OSProcess, 'eventGroup': 'Process'}