HealthPluginManager
index

 
Modules
       
HealthLogicFramework
copy
os
sys
threading
time

 
Classes
       
Cluster
HealthLogicStorage
HealthPlugin
threading.Thread(threading._Verbose)
HealthPluginLoop
HealthPluginThread

 
class Cluster
    Represents a cluster
 
  Methods defined here:
__init__(self, name, nodes, refreshTime, checkWith, logger)
check(self)
check()
Check for new metrics

 
class HealthLogicStorage
    Stores values for HealthLogicFramework. Can be used as a storage for one metric and one node
 
  Methods defined here:
__init__(self, length)
fetch(self)
fetch()
get a list with all values.
IMPORTANT: list is not sorted by age!
initialize(self, default)
initiate(float default)
initialize storage with a default value
update(self, value)
update(float value)
Insert a new value in storage

 
class HealthPlugin
    Represents one health plugin. Only to store data
 
  Methods defined here:
__init__(self, name, logger, plugin)

 
class HealthPluginLoop(threading.Thread)
    
Method resolution order:
HealthPluginLoop
threading.Thread
threading._Verbose
__builtin__.object

Methods defined here:
__init__(self, plugins)
HealthPluginLoop(list plugins)
intitiates HealthPluginLoop thread. Uses a list of plugins 'plugins'
check(self, plugin)
check(HealthPlugin plugin)
run check of plugin. If sucess, retun 1. 
If failed critical (syntax errors etc) return -1 (the health file will not be executed again)
Otherwise return 0 (the plugin may get executed another time)
clusterFailure(self, plugin, cluster)
clusterFailure(HealthPlugin plugin, Cluster cluster)
The cluster 'cluster' from plugin 'plugin' could not be reached.
Tell this to the plugin
collectMetrics(self, plugin)
collectMetrics(HealthPlugin plugin)
Collect the metrics for the clusters defined in 'plugin',
and opreoare (if possible) some special metrics
collectServices(self)
collectServices()
collect the services provided by all the plugins and gnmond
prepareCheck(self, plugin, first=False)
prepareCheck(HealthPlugin plugin [,bool firdt])
preapres plugin to be checked. If first=True, this is the first thime the plugin will be checked
This is importatnt to set up the storage
run(self)
run()
main function for HealthPluginLoop

Methods inherited from threading.Thread:
__repr__(self)
getName(self)
isAlive(self)
isDaemon(self)
join(self, timeout=None)
setDaemon(self, daemonic)
setName(self, name)
start(self)

Data and other attributes inherited from threading._Verbose:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of '_Verbose' objects>
list of weak references to the object (if defined)

 
class HealthPluginThread(threading.Thread)
    Every health Plugin will have it's own thread,
to prevent them from destroying the hole system.
This thread can be killed by set the toBeKilled flag
 
 
Method resolution order:
HealthPluginThread
threading.Thread
threading._Verbose
__builtin__.object

Methods defined here:
__init__(self, analyseFunc, metrics, logger)
run(self)
run()
main function of thread. sets trace function to kill it if nesessairy
If error occours, return it isnsted of nagiosServices

Methods inherited from threading.Thread:
__repr__(self)
getName(self)
isAlive(self)
isDaemon(self)
join(self, timeout=None)
setDaemon(self, daemonic)
setName(self, name)
start(self)

Data and other attributes inherited from threading._Verbose:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of '_Verbose' objects>
list of weak references to the object (if defined)

 
Functions
       
openHealthPlugin(name, logger)
list[HealthPlugin] openHealthPlugins(str name, GnmondLogger logger)
opens a sepcific health plugin, initialises it and returns it as a list
Could raise Exceptions
searchForHealthPlugins(logger)
list[HealthPluginsearchForHealthPlugins(GnmondLogger logger)
searches for all health plugins available, initialises them and returnes them as a list

 
Data
        HEALTH_PLUGINS_DIR = 'Plugins/Health'
NAGIOS_CRITICAL = 2
NAGIOS_OK = 0
NAGIOS_UNKNOW = 3
NAGIOS_WARNING = 1
allowedServers = []
services = []