Package Products :: Package ZenStatus :: Module zenstatus :: Class ZenStatus |
[hide private]
[frames] | no frames]

# Class ZenStatus

source code

                     object --+
                              |
       ZenUtils.CmdBase.CmdBase --+
                                  |
       ZenUtils.ZenDaemon.ZenDaemon --+
                                      |
    twisted.spread.pb.Referenceable --+
                                      |
               ZenHub.PBDaemon.PBDaemon --+
                                          |
                                         ZenStatus

Daemon class to attach to zenhub and pass along device configuration information.

Instance Methods | [hide private]
__init__(self) Initializer that takes care of basic daemon options. | source code
Twisted deferred |
configService(self) Return a connection to a status service. | source code
startScan(self, ignored=None) Start gathering status information, taking care of the case where we are invoked as a daemon or for a single run. | source code
connected(self) Gather our configuration and start collecting status information. | source code
configError(self, why) Log errors that have occurred gathering our configuration | source code
remote_notifyConfigChanged(self) Procedure called from zenhub to get us to re-gather all of our configuration. | source code
remote_setPropertyItems(self, items) Procedure called from zenhub to pass in new properties. | source code
setPropertyItems(self, items) Extract configuration elements used by this server. | source code
remote_deleteDevice(self, device) Remove any devices that zenhub tells us no longer exist. | source code
configCycle(self, driver) Get our configuration from zenhub | source code
reconfigure(self, driver) Contact zenhub and gather our configuration again. | source code
error(self, why) Log errors that have occurred | source code
scanCycle(self, driver) Go through all devices and start determining the status of each TCP service. | source code
heartbeat(self) Twisted keep-alive mechanism to ensure that we're still connected to zenhub. | source code
runSomeJobs(self) Run IP service tests with the maximum parallelization allowed. | source code
processTest(self, job) Test a connection to a device. | source code
processError(self, error) Log errors that have occurred from testing TCP services | source code
buildOptions(self) Build our list of command-line options | source code
Inherited from `ZenHub.PBDaemon.PBDaemon`: `connect`, `connectTimeout`, `eventService`, `getInitialServices`, `getService`, `getServiceNow`, `gotPerspective`, `pushEvents`, `pushEventsLoop`, `remote_getName`, `remote_shutdown`, `remote_updateThresholdClasses`, `run`, `sendEvent`, `sendEvents`, `setExitCode`, `sigTerm`, `stop` Inherited from `ZenUtils.ZenDaemon.ZenDaemon`: `becomeDaemon`, `becomeWatchdog`, `changeUser`, `niceDoggie`, `openPrivilegedPort`, `setupLogging`, `sighandler_USR1`, `watchdogCycleTime`, `watchdogMaxRestartTime`, `watchdogStartTimeout`, `writePidFile` Inherited from `ZenUtils.CmdBase.CmdBase`: `buildParser`, `checkLogpath`, `generate_configs`, `generate_xml_configs`, `generate_xml_table`, `getConfigFileDefaults`, `parseOptions`, `pretty_print_config_comment`

Class Variables | [hide private]
| agent = `"zenstatus"`
| name = `"zenstatus"`
| initialServices = `['EventService', 'StatusConfig']`
| statusCycleInterval = `300`
| configCycleInterval = `20`
| properties = `'statusCycleInterval', 'configCycleInterval'`
| reconfigureTimeout = `None`
Inherited from `ZenHub.PBDaemon.PBDaemon`: `heartbeatEvent`, `heartbeatTimeout` Inherited from `ZenHub.PBDaemon.PBDaemon` (private): `_customexitcode`, `_sendingEvents` Inherited from `ZenUtils.ZenDaemon.ZenDaemon`: `pidfile` Inherited from `ZenUtils.CmdBase.CmdBase`: `doesLogging`

Method Details | [hide private]

### __init__(self) (Constructor) | source code
Initializer that takes care of basic daemon options. Creates a PID file. Overrides: ZenUtils.CmdBase.CmdBase.__init__

### configService(self) | source code
Return a connection to a status service. Returns: Twisted deferred service to gather configuration

### connected(self) | source code
Gather our configuration and start collecting status information. Called after connected to the zenhub service. Overrides: ZenHub.PBDaemon.PBDaemon.connected

### configError(self, why) | source code
Log errors that have occurred gathering our configuration Parameters: `why` (Twisted error instance) - error message

### remote_setPropertyItems(self, items) | source code
Procedure called from zenhub to pass in new properties. Parameters: `items` (list) - items to update Overrides: ZenHub.PBDaemon.PBDaemon.remote_setPropertyItems

### setPropertyItems(self, items) | source code
Extract configuration elements used by this server. Parameters: `items` (list) - items to update

### remote_deleteDevice(self, device) | source code
Remove any devices that zenhub tells us no longer exist. Parameters: `device` (string) - name of device to delete

### configCycle(self, driver) | source code
Get our configuration from zenhub Parameters: `driver` (Twisted deferred object) - object

### reconfigure(self, driver) | source code
Contact zenhub and gather our configuration again. Parameters: `driver` (Twisted deferred object) - object

### error(self, why) | source code
Log errors that have occurred Parameters: `why` (Twisted error instance) - error message

### scanCycle(self, driver) | source code
Go through all devices and start determining the status of each TCP service. Parameters: `driver` (Twisted deferred object) - object

### heartbeat(self) | source code
Twisted keep-alive mechanism to ensure that we're still connected to zenhub. Overrides: ZenHub.PBDaemon.PBDaemon.heartbeat

### processTest(self, job) | source code
Test a connection to a device. Parameters: `job` (ZenTcpClient object) - device and TCP service to test

### processError(self, error) | source code
Log errors that have occurred from testing TCP services Parameters: `error` (Twisted error instance) - error message

### buildOptions(self) | source code
Build our list of command-line options Overrides: ZenUtils.CmdBase.CmdBase.buildOptions