Package ZenEvents :: Module MySqlSendEvent :: Class MySqlSendEventMixin
[hide private]
[frames] | no frames]

Class MySqlSendEventMixin

source code

Known Subclasses:
MySqlSendEvent, MySqlEventManager'.MySqlEventManager

Mix-in class that takes a mysql db connection and builds inserts that send the event to the backend.

Instance Methods [hide private]
 
sendEvent(self, event)
Send an event to the backend.
source code
 
doSendEvent(self, event) source code
 
_findByIp(self, ipaddress)
Find and ip by looking up it up in the Networks catalog.
source code
 
applyEventContext(self, evt)
Apply event and devices contexts to the event.
source code
 
applyDeviceContext(self, device, evt)
Apply event attributes from device context.
source code
 
_sendHeartbeat(self, event)
Build insert to add heartbeat record to heartbeat table.
source code
 
buildStatusInsert(self, statusdata, table, evid)
Build an insert statement for the status table that looks like this: insert into status set device='box', count=1, ...
source code
 
buildDetailInsert(self, evid, detaildict)
Build an insert to add detail values from an event to the details table.
source code
 
buildInsert(self, datadict, table)
Build a insert statement for that looks like this: insert into status set field='value', field=1, ...
source code
 
buildClearUpdate(self, evt, clearcls)
Build an update statement that will clear related events.
source code
 
eventDataMaps(self, event)
Return tuple (statusdata, detaildata) for this event.
source code
 
escape(self, value)
Prepare string values for db by escaping special characters.
source code
Method Details [hide private]

applyEventContext(self, evt)

source code 
Apply event and devices contexts to the event. Only valid if this object has zeo connection.

buildStatusInsert(self, statusdata, table, evid)

source code 

Build an insert statement for the status table that looks like this:
insert into status set device='box', count=1, ...
    on duplicate key update count=count+1, lastTime=23424.34;