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

# Class ZenProcessTask

source code

                             object --+
                                      |
    ZenUtils.observable.ObservableMixin --+
                                          |
                                         ZenProcessTask

A scheduled task that finds instances of configure processes and collects metrics on the processes

Instance Methods | [hide private]
__init__(self, deviceId, taskName, scheduleIntervalSeconds, taskConfig) | source code
_failure(self, reason) Twisted errBack to log the exception for a single device. | source code
_connectCallback(self, result) Callback called after a successful connect to the remote device. | source code
_collectCallback(self, result) Callback called after a connect or previous collection so that another collection can take place. | source code
_finished(self, result) Callback activated when the task is complete | source code
cleanup(self) | source code
Twisted deferred object |
doTask(self) Contact to one device and return a deferred which gathers data from the device. | source code
_storeProcessNames(self, results) Parse the process tables and reconstruct the list of processes that are on the device. | source code
_fetchPerf(self, results) Get performance data for all the monitored processes on a device | source code
_storePerfStats(self, results) Save the process performance data in RRD files | source code
Twisted deferred |
_getTables(self, oids) Perform SNMP getTable for specified OIDs | source code
Twisted deferred |
_get(self, oids) Perform SNMP get for specified OIDs | source code
_connect(self) Create a connection to the remote device | source code
_close(self) Close down the connection to the remote device | source code
_showProcessList(self, procs) Display the processes in a sane manner. | source code
_clearSnmpError(self, message) Send an event to clear other events. | source code
_save(self, pidName, statName, value, rrdType, min='U') Save a value into an RRD file | source code
Inherited from `ZenUtils.observable.ObservableMixin`: `__setattr__`, `attachAttributeObserver`, `detachAttributeObserver`, `notifyAttributeChange`

Class Variables | [hide private]
| DEVICE_STATS = `{}`
| RESTARTED = `0`
| MISSING = `0`
| STATE_CONNECTING = `'CONNECTING'`
| STATE_SCANNING_PROCS = `'SCANNING_PROCESSES'`
| STATE_FETCH_PERF = `'FETCH_PERF_DATA'`
| STATE_STORE_PERF = `'STORE_PERF_DATA'`
| statusEvent = `{'eventClass': Status_OSProcess, 'eventGroup': '`...``

Method Details | [hide private]

### __init__(self, deviceId, taskName, scheduleIntervalSeconds, taskConfig) (Constructor) | source code
Overrides: ZenUtils.observable.ObservableMixin.__init__

### _failure(self, reason) | source code
Twisted errBack to log the exception for a single device. Parameters: `reason` (Twisted error instance) - explanation of the failure

### doTask(self) | source code
Contact to one device and return a deferred which gathers data from the device. Returns: Twisted deferred object job to scan a device

### _storeProcessNames(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 `device` (Device object) - proxy connection object

### _fetchPerf(self, results) | 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) | 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

### _getTables(self, oids) | source code
Perform SNMP getTable for specified OIDs Parameters: `oids` (list of strings) - OIDs to gather Returns: Twisted deferred Twisted deferred

### _get(self, oids) | source code
Perform SNMP get for specified OIDs Parameters: `oids` (list of strings) - OIDs to gather Returns: Twisted deferred Twisted deferred

### _showProcessList(self, procs) | source code
Display the processes in a sane manner. Parameters: `procs` (list of tuples) - list of (pid, (name, args))

### _clearSnmpError(self, message) | source code
Send an event to clear other events. Parameters: `name` (string) - device for which the event applies `message` (string) - clear text

### _save(self, pidName, statName, value, rrdType, min='U') | source code
Save a value into an RRD file Parameters: `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)

Class Variable Details | [hide private]

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