
Chapter 11 263
Utilities
Event processing
Event processing
This section discusses three event processing utilities:
• event_logger
• log_event
event_logger
The event_logger utility is the teststation Event Logger and has a
format as follows:
event_logger [-d]
event_logger receives messages from diagnostic utilities through rpc
calls and writes them to the event log for later review or processing.
The -d option keeps event_logger from running as a daemon which is
useful for debugging.
event_logger is a background daemon and is started by init through
inittab. event_logger receives messages for the event_log via two
different mechanisms. Teststation utilities programs send events to the
event_logger through rpc calls. OS events on the other hand, use UDP
datagrams that are sent out over a specific port. These must be detected
and logged as well. Upon receiving an OS event, the event travels the
same path as a teststation event.
On reception of an event, the event is written to a complex-specific
event_log file at /spp/data/<COMPLEX_NAME>/event_log. When the
event_log reaches the maximum size (approximately one Mbyte), the
event_logger compresses the event_log, then truncates the file and
continue logging events.
Other programs can request that events be sent via rpc to them. These
programs can use the libevent_client library to establish a service
and notify the event_logger what events it would like to see with a fair
degree of simplicity. On reception of an event, once the log file is written,
the linked list of interested programs is searched to see if the event
matches the criterion requested. If there is a match, the event is sent to
that program.