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

Class ZenActions

CmdBase --+        
          |        
  ZenDaemon --+    
              |    
       ZCmdBase --+
                  |
                 ZenActions


Take actions based on events in the event manager. Start off by sending emails and pages.
Method Summary
  __init__(self)
  buildOptions(self)
basic options setup sub classes can add more options here
  checkVersion(self, zem)
  eventCommands(self, zem)
  execute(self, stmt)
  format(self, action, data, clear)
  getAckUrl(self, evid)
  getDeleteUrl(self, evid)
  getEventsUrl(self, device)
  getUndeleteUrl(self, evid)
  getUrl(self, evid)
  heartbeatEvents(self)
Create events for failed heartbeats.
  loadActionRules(self)
Load the ActionRules into the system.
  mainbody(self)
main loop to run actions.
  maintenance(self, zem)
Run stored procedures that maintain the events database.
  processEvent(self, zem, context, action)
  processRules(self, zem)
Run through all rules matching them against events.
  query(self, stmt)
  run(self)
  runCycle(self)
  runEventCommand(self, cmd, data, clear)
  sendEmail(self, action, data, clear)
Send an event to an email address.
  sendEvent(self, evt)
Send event to the system.
  sendHeartbeat(self)
Send a heartbeat event for this monitor.
  sendPage(self, action, data, clear)
Send and event to a pager.
  sigTerm(self, signum, frame)
controlled shutdown of main loop on interrupt
  stop(self)
  stripTags(self, data)
A quick html => plaintext converter that retains and displays anchor hrefs
Inherited from ZCmdBase: closeAll, closedb, findDevice, getConnection, getContext, getDataRoot, getDmdObj, login, logout, opendb, syncdb, zeoConnect
Inherited from ZenDaemon: becomeDaemon, changeUser, setupLogging
Inherited from CmdBase: buildParser, parseOptions

Class Variable Summary
str addstate = "INSERT INTO alert_state VALUES ('%s', '%s', ...
str clearEventSelect = "SELECT %s   FROM history clear, hist...
str clearsel = "SELECT %s, h.evid FROM history h, alert_stat...
str clearstate = "DELETE FROM alert_state  WHERE evid='%s'  ...
NoneType lastCommand = None                                                                  
str newsel = "SELECT %s, evid FROM status WHERE %s AND evid ...
Inherited from ZenDaemon: pidfile
Inherited from CmdBase: doesLogging

Method Details

buildOptions(self)

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

heartbeatEvents(self)

Create events for failed heartbeats.

loadActionRules(self)

Load the ActionRules into the system.

mainbody(self)

main loop to run actions.

maintenance(self, zem)

Run stored procedures that maintain the events database.

processRules(self, zem)

Run through all rules matching them against events.

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

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

sendEvent(self, evt)

Send event to the system.

sendHeartbeat(self)

Send a heartbeat event for this monitor.

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

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

sigTerm(self, signum, frame)

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

stripTags(self, data)

A quick html => plaintext converter that retains and displays anchor hrefs

Class Variable Details

addstate

Type:
str
Value:
"INSERT INTO alert_state VALUES ('%s', '%s', '%s')"                    

clearEventSelect

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

clearsel

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

clearstate

Type:
str
Value:
"DELETE FROM alert_state  WHERE evid='%s'    AND userid='%s'    AND ru\
le='%s'"                                                               

lastCommand

Type:
NoneType
Value:
None                                                                  

newsel

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

Generated by Epydoc 2.1 on Thu Aug 16 09:55:08 2007 http://epydoc.sf.net