Package ZenEvents :: Module zensyslog :: Class ZenSyslog
[hide private]
[frames] | no frames]

Class ZenSyslog

source code

twisted.internet.protocol.AbstractDatagramProtocol --+    
                                                     |    
            twisted.internet.protocol.DatagramProtocol --+
                                                         |
            Products.ZenEvents.EventServer.EventServer --+
                                                         |
                                                        ZenSyslog

ZenSyslog

Instance Methods [hide private]
 
__init__(self) source code
Twisted deferred object
configure(self)
Initialize the daemon
source code
string
expand(self, msg, client_address)
Expands a syslog message into a string format suitable for writing to the filesystem such that it appears the same as it would had the message been logged by the syslog daemon.
source code
 
datagramReceived(self, msg, client_address)
Consume the network packet
source code
 
gotHostname(self, response, data)
Send the resolved address, if possible, and the event via the thread
source code
 
buildOptions(self)
Command-line options
source code

Inherited from twisted.internet.protocol.DatagramProtocol: connectionRefused

Inherited from twisted.internet.protocol.AbstractDatagramProtocol: __getstate__, doStart, doStop, makeConnection, startProtocol, stopProtocol

Class Variables [hide private]
  name = 'zensyslog'
  SYSLOG_DATE_FORMAT = '%b %d %H:%M:%S'
  SAMPLE_DATE = 'Apr 10 15:19:22'

Inherited from twisted.internet.protocol.AbstractDatagramProtocol: noisy, numPorts

Instance Variables [hide private]

Inherited from twisted.internet.protocol.DatagramProtocol: transport

Method Details [hide private]

configure(self)

source code 
Initialize the daemon
Returns: Twisted deferred object
Twisted deferred object

expand(self, msg, client_address)

source code 
Expands a syslog message into a string format suitable for writing to the filesystem such that it appears the same as it would had the message been logged by the syslog daemon.
Parameters:
  • msg (string) - syslog message
  • client_address (tuple of (string, number)) - IP info of the remote device (ipaddr, port)
Returns: string
message

datagramReceived(self, msg, client_address)

source code 
Consume the network packet
Parameters:
  • msg (string) - syslog message
  • client_address (tuple of (string, number)) - IP info of the remote device (ipaddr, port)
Overrides: twisted.internet.protocol.AbstractDatagramProtocol.datagramReceived

gotHostname(self, response, data)

source code 
Send the resolved address, if possible, and the event via the thread
Parameters:
  • response (Twisted response) - Twisted response
  • data (tuple of (string, string, datetime object)) - (msg, ipaddr, rtime)