Package Products :: Package ZenHub :: Module zenhubworker :: Class zenhubworker |
[hide private]
[frames] | no frames]

# Class zenhubworker

source code

                  object --+
                           |
    ZenUtils.CmdBase.CmdBase --+
                               |
    ZenUtils.ZenDaemon.ZenDaemon --+
                                   |
          ZenUtils.ZCmdBase.ZCmdBase --+
                                       |
     twisted.spread.pb.Referenceable --+
                                       |
                                      zenhubworker

Execute ZenHub requests in separate process

Instance Methods | [hide private]
__init__(self) Initializer that takes care of basic daemon options. | source code
gotPerspective(self, perspective) Once we are connected to zenhub, register ourselves | source code
_getService(self, name, instance) Utility method to create the service (like PingConfig) for instance (like localhost) | source code
remote_execute(self, service, instance, method, args) Execute requests on behalf of zenhub | source code
buildOptions(self) Options, mostly to find where zenhub lives These options should be passed (by file) from zenhub. | source code
Inherited from `ZenUtils.ZCmdBase.ZCmdBase`: `closeAll`, `closedb`, `findDevice`, `getConnection`, `getContext`, `getDataRoot`, `getDmdObj`, `login`, `logout`, `opendb`, `sigTerm`, `syncdb`, `zeoConnect` 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]
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__

### _getService(self, name, instance) | source code
Utility method to create the service (like PingConfig) for instance (like localhost) Parameters: `name` (string) - the dotted-name of the module to load (uses @Products.ZenUtils.Utils.importClass) `instance` - string `instance` - each service serves only one specific collector instances (like 'localhost'). instance defines the collector's instance name. Returns: a service loaded from ZenHub/services or one of the zenpacks.

### remote_execute(self, service, instance, method, args) | source code
Execute requests on behalf of zenhub Parameters: `service` (string) - the name of a service, like PingConfig `instance` (string) - each service serves only one specific collector instances (like 'localhost'). instance defines the collector's instance name. `method` (string) - the name of the called method, like getPingTree `args` (tuple) - arguments to the method `kw` (dictionary) - keyword arguments to the method Decorators: `@translateError`

### buildOptions(self) | source code
Options, mostly to find where zenhub lives These options should be passed (by file) from zenhub. Overrides: ZenUtils.CmdBase.CmdBase.buildOptions