Stingray's sophisticated 'Event Handling' system allows an administrator to configure precisely what actions Stingray should take when a wide range of events occur. The range of events covers internal changes (configuration modified, SSL certificate timing out), external changes (back-end server failure, service-level class falling outside parameters) and traffic-initiated events (trafficscript rule raising an event due to certain user traffic).
Stingray can be configured to perform any of a range of actions when an event is raised - log a message, raise an SNMP trap or syslog alert, send an email or even run a custom script:
The Event Handler configuration maps groups of events to user-defined actions
Stingray already contains one built-in event handler that causes all events to be written to the global Event Log. This built-in handler and its "Log all Events" action can not be deleted, but you can add additional actions if required. You can add additional event handlers, such as the handler illustrated above that sends an email when there is a problem with a license key.
Each Event Handler is triggered by events of a particular type. When an event that matches the Event Type occurs, the Event Handler will invoke the Action it is configured to perform:
Information about the event is provided to the action that it triggered in the following format:
LEVEL (tab) [section] (tab) primary tag (tab) [tags (tab)]* text
LEVEL may be one of 'INFO' (for example, a configuration file was modified), 'WARNING' (for example, a node in a pool failed), 'SERIOUS' (for example, all of the nodes in a pool have failed) or 'FATAL' (a catastrophic error that prevents the traffic manager from functioning).
For example, if you stop a virtual server called 'Server1' the following event will be raised:
INFO (tab) vservers/Server1 (tab) vsstop (tab) Virtual server stopped
The first two components indicate that the event is an informational message about the virtual server "Server1". The primary tag, vsstop, defines what has happened to that virtual server. There are no additional tags because this event does not affect any other aspects of the configuration. Finally there is a human-readable description of the event that occurred.
You can find a full list of the events that may be raised in the Stingray UI:
Create a set of events: there are 100's of event that can be trapped and acted upon...
You can use the TrafficScript function 'event.emit()' to raise an event. For example, you may wish to log certain requests to the main Event Log, and this is an appropriate way to do so.