Package ZenEvents :: Module zenactions :: Class ZenActions
[hide private]
[frames] | no frames]

Class ZenActions

source code

Products.ZenUtils.CmdBase.CmdBase --+        
                                    |        
Products.ZenUtils.ZenDaemon.ZenDaemon --+    
                                        |    
      Products.ZenUtils.ZCmdBase.ZCmdBase --+
                                            |
                                           ZenActions

Take actions based on events in the event manager. Start off by sending emails and pages.

Instance Methods [hide private]
 
__init__(self) source code
 
loadActionRules(self)
Load the ActionRules into the system.
source code
 
execute(self, stmt) source code
 
query(self, stmt) source code
 
getUrl(self, evid) source code
 
getEventsUrl(self, device) source code
 
getAckUrl(self, evid) source code
 
getDeleteUrl(self, evid) source code
 
getUndeleteUrl(self, evid) source code
 
processRules(self, zem)
Run through all rules matching them against events.
source code
 
checkVersion(self, zem) source code
 
processEvent(self, zem, context, action) source code
 
maintenance(self, zem)
Run stored procedures that maintain the events database.
source code
 
heartbeatEvents(self)
Create events for failed heartbeats.
source code
 
runEventCommand(self, cmd, data, clear=None) source code
 
eventCommands(self, zem) source code
 
mainbody(self)
main loop to run actions.
source code
 
runCycle(self) source code
 
run(self) source code
 
sendEvent(self, evt)
Send event to the system.
source code
 
sendHeartbeat(self)
Send a heartbeat event for this monitor.
source code
 
stop(self) source code
 
format(self, action, data, clear) source code
 
stripTags(self, data)
A quick html => plaintext converter that retains and displays anchor hrefs
source code
 
sendPage(self, action, data, clear=None)
Send and event to a pager.
source code
 
sendEmail(self, action, data, clear=None)
Send an event to an email address.
source code
 
buildOptions(self)
basic options setup sub classes can add more options here
source code
 
sigTerm(self, signum, frame)
controlled shutdown of main loop on interrupt
source code

Inherited from Products.ZenUtils.ZCmdBase.ZCmdBase: closeAll, closedb, findDevice, getConnection, getContext, getDataRoot, getDmdObj, login, logout, opendb, syncdb, zeoConnect

Inherited from Products.ZenUtils.ZenDaemon.ZenDaemon: becomeDaemon, changeUser, setupLogging

Inherited from Products.ZenUtils.CmdBase.CmdBase: buildParser, generate_configs, generate_xml_table, parseOptions, pretty_print_config_comment

Class Variables [hide private]
  lastCommand = None
  addstate = 'INSERT INTO alert_state VALUES (\'%s\', \'%s\', \'...
  clearstate = 'DELETE FROM alert_state WHERE evid=\'%s\' AN...
  newsel = 'SELECT %s, evid FROM status WHERE %s AND evid NOT IN...
  clearsel = 'SELECT %s, h.evid FROM history h, alert_state a W...
  clearEventSelect = 'SELECT %s FROM history clear, history ev...

Inherited from Products.ZenUtils.ZenDaemon.ZenDaemon: pidfile

Inherited from Products.ZenUtils.CmdBase.CmdBase: doesLogging

Method Details [hide private]

__init__(self)
(Constructor)

source code 
Overrides: Products.ZenUtils.ZCmdBase.ZCmdBase.__init__

sendPage(self, action, data, clear=None)

source code 
Send and event to a pager. Return True if we think page was sent, False otherwise.

sendEmail(self, action, data, clear=None)

source code 
Send an event to an email address. Return True if we think the email was sent, False otherwise.

buildOptions(self)

source code 
basic options setup sub classes can add more options here
Overrides: Products.ZenUtils.ZCmdBase.ZCmdBase.buildOptions
(inherited documentation)

sigTerm(self, signum, frame)

source code 
controlled shutdown of main loop on interrupt
Overrides: Products.ZenUtils.ZenDaemon.ZenDaemon.sigTerm

Class Variable Details [hide private]

addstate

Value:
'INSERT INTO alert_state VALUES (\'%s\', \'%s\', \'%s\', NULL) ON DUPL\
ICATE KEY UPDATE lastSent = now()'

clearstate

Value:
'DELETE FROM alert_state  WHERE evid=\'%s\'    AND userid=\'%s\'    AN\
D rule=\'%s\''

newsel

Value:
'SELECT %s, evid FROM status WHERE %s AND evid NOT IN  (SELECT evid FR\
OM alert_state   WHERE userid=\'%s\' AND rule=\'%s\' %s)'

clearsel

Value:
'SELECT %s, h.evid FROM history h, alert_state a  WHERE h.evid=a.evid \
AND a.userid=\'%s\' AND a.rule=\'%s\''

clearEventSelect

Value:
'SELECT %s   FROM history clear, history event  WHERE clear.evid = eve\
nt.clearid    AND event.evid = \'%s\''