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
Twisted deferred object |
doTask(self) Contact to one device and return a deferred which gathers data from the device. | source code
_collectCallback(self) Callback called after a connect or previous collection so that another collection can take place. | source code
_finished(self) Callback activated when the task is complete | source code
cleanup(self) | source code
capturePacket(self, hostname, data) Store SNMP results into files for unit-testing. | source code
sendRestartEvents(self, afterByConfig, beforeByConfig, restarted) | source code
sendFoundProcsEvents(self, afterByConfig, restarted) | source code
_parseProcessNames(self, results) Parse the process tables and reconstruct the list of processes that are on the device. | source code
sendMissingProcsEvents(self, missing) | source code
_sendProcessEvents(self, results) | source code
_determineProcessStatus(self, procs) Determine the up/down/restarted status of processes. | source code
_splitPStatMatchers(self) | source code
_fetchPerf(self) 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
openProxy(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
_sendSnmpError(self, message, eventKey=None, **kwargs) | source code
_clearSnmpError(self, message, eventKey=None) 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` Inherited from `ZenUtils.observable.ObservableMixin` (private): `_doSetattr`

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'`
| STATE_PARSING_TABLE_DATA = `'PARSING_TABLE_DATA'`
| statusEvent = `{'eventClass': Status_OSProcess, 'eventGroup': '`...``

Method Details | [hide private]

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

### 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 Decorators: `@defer.inlineCallbacks`

### _collectCallback(self) | source code
Callback called after a connect or previous collection so that another collection can take place. Decorators: `@defer.inlineCallbacks`

### _parseProcessNames(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

### _determineProcessStatus(self, procs) | source code
Determine the up/down/restarted status of processes. Parameters: `procs` (list) - array of pid, (name, args) info

### _fetchPerf(self) | source code
Get performance data for all the monitored processes on a device Parameters: `results` (list of (success, result) tuples) - results of SNMP table gets Decorators: `@defer.inlineCallbacks`

### _storePerfStats(self, results) | source code
Save the process performance data in RRD files Parameters: `results` (list of {oid:value} dictionaries) - 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, eventKey=None) | source code
Send an event to clear other events. Parameters: `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'}