Class ZenHub
source code
Products.ZenUtils.ZCmdBase.ZCmdBase --+
|
ZenHub
Listen for changes to objects in the Zeo database and update the
collectors' configuration.
The remote collectors connect the ZenHub and request configuration
information and stay connected. When changes are detected in the Zeo
database, configuration updates are sent out to collectors
asynchronously. In this way, changes made in the web GUI can affect
collection immediately, instead of waiting for a configuration cycle.
Each collector uses a different, pluggable service within ZenHub to
translate objects into configuration and data. ZenPacks can add services
for their collectors. Collectors communicate using Twisted's Perspective
Broker, which provides authenticated, asynchronous, bidirectional method
invocation.
ZenHub also provides an XmlRPC interface to some common services to
support collectors written in other languages.
|
__init__(self)
Hook ourselves up to the Zeo database and wait for collectors to
connect. |
source code
|
|
|
getRRDStats(self)
Return the most recent RRD statistic information. |
source code
|
|
|
zeoConnect(self)
Override the kind of zeo connection we have so we can listen to
Zeo object updates. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
giveWorkToWorkers(self)
Parcel out a method invocation to an available worker process |
source code
|
|
|
|
|
|
|
heartbeat(self)
Since we don't do anything on a regular basis, just push
heartbeats regularly. |
source code
|
|
|
|
|
buildOptions(self)
Adds our command line options to ZCmdBase command line
options. |
source code
|
|
|
totalTime = 0.
|
|
totalEvents = 0
|
|
totalCallTime = 0.
|
|
name = 'zenhub'
|
Override the kind of zeo connection we have so we can listen to Zeo
object updates. Updates comes as OID invalidations.
- Returns:
- None
|
Periodically (once a second) process database changes
- Returns:
- None
|
Perform one cycle of update notifications.
- Returns:
- None
|
Useful method for posting events to the EventManager.
- Parameters:
kw (keywords (dict)) - the values for an event: device, summary, etc.
- Returns:
- None
|
Load the password file
- Returns:
- an object satisfying the ICredentialsChecker interface using a
password file or an empty list if the file is not available.
Uses the file specified in the --passwd command line option.
|
Helper method to load services dynamically for a collector. Returned
instances are cached: reconnecting collectors will get the same service
object.
- 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.
|
Take a remote request and queue it for worker processes.
- Parameters:
args (tuple) - the arguments to the remote_execute() method in the worker
- Returns:
- a Deferred for the eventual results of the method call
|
Start a worker subprocess
- Returns:
- None
|
Since we don't do anything on a regular basis, just push heartbeats
regularly.
- Returns:
- None
|