Chapter 16 Event Handling

Note

MySQL Enterprise Monitor is available as part of the MySQL Enterprise subscription, learn more at http://www.mysql.com/products/.

The rule-based event handling is flexible and may be configured using groups. Notifications may be sent via email (SMTP) or SNMP.

Event Handlers

In our example, we will set up a notification group titled "DBA" and then assign it an email address:

Figure 16.1 Creating an Email Notification Group

Creating an email notification group

Now we can assign this new "DBA" notification group to an Event Handler. To handle events, you set up a series of filters using Assets Groups, Advisors, and Event Statuses, which are defined by choosing "Any" or specific items. MySQL Enterprise Monitor will perform a defined action if all of the selected filter conditions are true.

Note

Leaving a field blank defines a filter as all. For example, leaving the Advisors filter blank means the event handler will be triggered from all advisors.

For example, previously we defined "Development" and "Production" server groups, along with "Developer" and "DBA" notification groups. Let's now configure the Service Manager to email the DBA group whenever Critical or Emergency events are discovered on a production server:

Figure 16.2 Creating an Event Handler

Creating an Event Handler

Email Settings

Configure the From Address and SMTP Server settings for the MySQL Enterprise Service Manager. If your server requires authorization, complete the necessary server login details, and whether SSL is required.

Ensure that the Enable Email Notifications checkbox is checked, and enter information as appropriate.

The default value for the SMTP port is 25. If your mail server runs on a different port, specify the port, separated from the server name by a colon. For example, if your mail server runs on port 587, enter email.myserver.com:587 into the SMTP Server text box.

Note

An email server must be available for sending email alerts.

The SMTP client uses Transport Layer Security (TLS) if the SMTP server supports it.

If your SMTP server incorrectly indicates that it supports TLS, check the Disable JavaMail TLS/SSL check box.

To enter the SMTP server password, check the Update Password On Save box first. When you return to this dialog to update settings other than the SMTP password, leave this box unchecked to avoid blanking out the saved password. If the SMTP password does change later, check the box again and enter the new password.

To test your configuration immediately, add an email address to the On Save, Send Test Email Message to box. Click Save Email Settings to save the settings.

Email Notification Status

Reports the last successful email, and also the last email failure.

SNMP Settings

This section lets you enable Simple Network Management Protocol (SNMP) so that your Network Management System (NMS) can handle MySQL Enterprise Monitor events. SNMP notifications are off by default. First, enable these notifications by checking the Enable SNMP Notifications checkbox.

MySQL Enterprise Service Manager includes support for both SNMPv1 and SNMPv2. You can select the SNMP version to use by clicking the corresponding Use SNMPv1 or Use SNMPv2 radio button.

In the Target 1 or Target 2 text box, enter the IP address or hostnames of your NMS listeners. The port number defaults to the well-known SNMP port, 162. If you are not using this port, enter the port that your Network Management System is listening on.

Enter the appropriate community string in the Community String text box. The default value for this string is public.

For the trap address for Advisor traps, you can optionally elect to use the address of the agent that triggered the alert, rather than the address of the MySQL Enterprise Service Manager. To do this, click the Use the remote MySQL agent host IP address as the SNMP trap agent address for Advisor traps. For internally generated SNMP traps (that is, with MySQL Enterprise Service Manager) you can also specify an alternate address by putting the IP address in the SNMP trap agent address for internally generated traps box.

To ensure that the specified target is valid, check the On Save, Send Test Trap check box. Be sure to save your settings before exiting.

To enable, check the Enable SNMP Notifications checkbox, then enable SNMP when creating an Event Handler.

The Management Information Base (MIB) file associated with SNMP trapping is called MONITOR.MIB. For the location this file see Section C.1.4, “The Management Information Base (MIB) File”.

Note

The MIB file supplied with MySQL Enterprise Service Manager is not directly compatible with OpenNMS. For a sample of the modifications to make, see the comments for Bug #41714.

SNMP Notification Status

Reports the last successful SNMP Trap, and also the last SNMP Trap failure.

Event Action Log

If an event handler is triggered, the action taken is displayed in the Action Log [n] section at the bottom of the expanded event, where [n] represents the number of actions logged for that event.

The Action Log [n] lists the time the action was taken, the type of action (SMTP or SNMP), the failure or success of the action, and the triggering policy used to trigger the event. The Triggering Policy column lists the names of the event handlers which triggered the actions.