Custom events are a unique type of event to initiate events from scripts.
This type of event is different from other event types because it controls event generation as opposed to other events that trigger events by a certain occurrence.
Custom events are used to generate an event whenever the API function monitor_custom_event() is called from the PHP script.
This event type enables the generation of an event on occurrences that are not necessarily built-in events (error and performance issues). Custom events are used whenever you decide that it is significant to generate an event in a certain situation. Each event type is given a name for easy identification ($class).
monitor_custom_event(string $class, string $text[, integer $severe, mixed $user_data])
$class - helps to define several types of custom events. This description will be showed in the Event List and in the Event Details.
$text - error text used to describe the reason for the event. This text will appear in the Event Details.
$severe - (Optional) the severity level of the triggered event, where default the value is Severe.
$user_data - adds a PHP variable that will be viewed in the Event Details (in Event Context-> Variables->User Defined). This forms the stored event data (similar to the information obtained in a PHP error event).
Aggregation takes place for these events when two events occur in the same place and have the same $class $text $sever(ity)
Action Rules defined for these events should be set to "send to URL" rather than "sending by e-mail" as there is only one definition for these events and event reports sent to a URL can be easily forwarded elsewhere. This is to prevent the overloading of e-mail. If we use the e-mail action, for every custom event, e-mail will be sent, and there can be many classes of custom events. However, if the URL action is used, a script can be used to identify the event’s class and different behaviors can be implemented according to class.