Package ZenEvents :: Module EventManagerBase
[hide private]
[frames] | no frames]

Module EventManagerBase

source code

Data connector to backend of the event management system.


Version: 1.6

Classes [hide private]
  EventManagerBase
Data connector to backend of the event management system.
Functions [hide private]
 
evtprep(evts)
Prepares data from Products.ZenEvents.EventManagerBase.getEventSummary for rendering in the eventrainbow template macro.
source code
Variables [hide private]
  log = logging.getLogger("zen.Events")
  RELMETATYPES = ('ToOneRelationship', 'ToManyContRelationship',...
Function Details [hide private]

evtprep(evts)

source code 

Prepares data from Products.ZenEvents.EventManagerBase.getEventSummary for rendering in the eventrainbow template macro.

Each cell of the old-style event rainbow needs a CSS class specified in order to render its color, fill and border style. evtprep determines the proper class and returns it, along with a string representation of the number of live and acknowledged events.
>>> from Products.ZenEvents.EventManagerBase import evtprep
>>> evtprep(['zenevents_5_noack noack', 2, 2])
{'cssclass': 'zenevents_5_noack noack empty thin', 'data': '2/2'}
>>> evtprep(['zenevents_5_noack noack', 1, 2])
{'cssclass': 'zenevents_5_noack noack', 'data': '1/2'}
Parameters:
  • evts (tuple) - A tuple of the form (Severity string, Number Acknowledged int, Number Live int)
Returns:
A dictionary of the form {'cssclass': Class string, 'data': Event count representation string}

Variables Details [hide private]

RELMETATYPES

Value:
('ToOneRelationship', 'ToManyContRelationship', 'ToManyRelationship')