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

# Class PBDaemon

source code

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

Known Subclasses:
  - DataCollector.zenmodeler.ZenModeler
  - , ZenEvents.EventServer.EventServer
  - , ZenRRD.RRDDaemon.RRDDaemon

Instance Methods | [hide private]
__init__(self, noopts=0, keeproot=False, name=None) Initializer that takes care of basic daemon options. | source code
connecting(self) Called when about to connect to zenhub | source code
gotPerspective(self, perspective) This gets called every time we reconnect. | source code
connect(self) | source code
connectTimeout(self) | source code
eventService(self) | source code
getServiceNow(self, svcName) | source code
getService(self, serviceName, serviceListeningInterface=None) Attempt to get a service from zenhub. | source code
getInitialServices(self) After connecting to zenhub, gather our initial list of services. | source code
connected(self) | source code
run(self) | source code
sigTerm(self, signum=None, frame=None) Signal handler for the SIGTERM signal. | source code
setExitCode(self, exitcode) | source code
stop(self, ignored='') | source code
sendEvents(self, events) | source code
sendEvent(self, event, **kw) Add event to queue of events to be sent. | source code
generateEvent(self, event, **kw) Add event to queue of events to be sent. | source code
_trimEventQueue(self, maxOver=0) | source code
_performanceEvents(self) | source code
_getPerformanceEventsChunk(self) | source code
pushEventsLoop(self) Periodially, wake up and flush events to ZenHub. | source code
pushEvents(self, driver) Flush events to ZenHub. | source code
heartbeat(self) if cycling, send a heartbeat, else, shutdown | source code
saveCounters(self) | source code
loadCounters(self) | source code
remote_getName(self) | source code
remote_shutdown(self, unused) | source code
remote_setPropertyItems(self, items) | source code
remote_updateThresholdClasses(self, classes) | source code
buildOptions(self) Standard set of command-line options. | source code
Inherited from `ZenUtils.ZenDaemon.ZenDaemon`: `audit`, `becomeDaemon`, `becomeWatchdog`, `changeUser`, `convertSocketOption`, `logname`, `niceDoggie`, `openPrivilegedPort`, `setupLogging`, `sighandler_USR1`, `watchdogCycleTime`, `watchdogMaxRestartTime`, `watchdogStartTimeout`, `writePidFile` Inherited from `ZenUtils.ZenDaemon.ZenDaemon` (private): `_sigUSR1_called` Inherited from `ZenUtils.CmdBase.CmdBase`: `buildParser`, `checkLogpath`, `generate_configs`, `generate_xml_configs`, `generate_xml_table`, `getConfigFileDefaults`, `getGlobalConfigFileDefaults`, `getParamatersFromConfig`, `loadConfigFile`, `parseOptions`, `pretty_print_config_comment`, `validateConfigFile`

Class Variables | [hide private]
| name = `'pbdaemon'`
| initialServices = `['EventService']`
| heartbeatEvent = `{'eventClass': Heartbeat}`
| heartbeatTimeout = `60* 3`
| _customexitcode = `0`
| _sendingEvents = `False`
Inherited from `ZenUtils.ZenDaemon.ZenDaemon`: `pidfile` Inherited from `ZenUtils.CmdBase.CmdBase`: `doesLogging`

Method Details | [hide private]

### __init__(self, noopts=0, keeproot=False, name=None) (Constructor) | source code
Initializer that takes care of basic daemon options. Creates a PID file. Overrides: ZenUtils.CmdBase.CmdBase.__init__

### gotPerspective(self, perspective) | source code
This gets called every time we reconnect. Parameters: `perspective` (Twisted perspective object) - Twisted perspective object

### getService(self, serviceName, serviceListeningInterface=None) | source code
Attempt to get a service from zenhub. Returns a deferred. When service is retrieved it is stashed in self.services with serviceName as the key. When getService is called it will first check self.services and if serviceName is already there it will return the entry from self.services wrapped in a defer.succeed

### sigTerm(self, signum=None, frame=None) | source code
Signal handler for the SIGTERM signal. Overrides: ZenUtils.ZenDaemon.ZenDaemon.sigTerm (inherited documentation)

### sendEvent(self, event, **kw) | source code
Add event to queue of events to be sent. If we have an event service then process the queue.

### generateEvent(self, event, **kw) | source code
Add event to queue of events to be sent. If we have an event service then process the queue.

### _performanceEvents(self) | source code
Decorators: `@property`

### remote_updateThresholdClasses(self, classes) | source code
Decorators: `@translateError`

### buildOptions(self) | source code
Standard set of command-line options. Overrides: ZenUtils.CmdBase.CmdBase.buildOptions (inherited documentation)