Prior to Junos OS Release 8.3, not all syslog messages were combined in eventd and we were not able to write event-policy for all the syslog messages. With Junos OS Relase 8.3 and later, after merging syslogd and eventd into one process, all the syslog messages are routed to eventd. However, not all the syslog messages have a proper event-id, and changing all the existing syslog messages to have proper event-ids is not possible.
So, for all syslog messages that do not have a proper event-id, eventd groups them under pseudo-events based on the origin of the messages.
The following pseudo-event-ids are assigned:
Each of these pseudo-event-ids has a special attribute named 'message'. The value of the attribute will be the syslog message. Using this pseduo-event-id and its attribute, we can write policy to match any syslog messages that do not have a proper event-id. For example, to generate an event policy to capture a daemon crash, whenever any daemon crashes, "init" generates a message like the following:
Feb 09 05:07:34.643 2012 candyman init: routing (PID 4016) terminated by signal number 11. Core dumped!
This means that the routing process has generated a core dump because of signal 11. We can use this error message to find out the daemon crash.
The init process does not use the ERRMSG() macro to send messages to eventd.
So, there is no proper event-id for this message.
We can write an event-policy using the pseudo-event-id, something like the following:
This policy will match for pseudo-event SYSTEM and the line matching the above regular expression. As an action, the policy event-script will get executed and the error message will be passed as an argument to the event-script.
Within the event-script, using the error message argument we can figure out the daemon name and the signal number.
Something like the following:
Here $ret will be "daemon name" and $ret will be "signal number".