How To
Summary
This document introduce how to create UDA(User-Defined Alert) in Data Server Manager
Steps
Step1. Create a user-defined alert
On the DSM console, go to Monitor>User-Defined Alerts page. Then click Add Alert Type button to create a alert. In the next window, enter the required information and select SQL Only Script.

On the Script page, type the SQL script that is used to trigger alerts. In this example, the SQL-only script generates a warning alert if the level of 'W' (Warning) is recorded in the DB2 general diagnostic logs, and a critical alert if the recored level is 'E' (Error), 'C' (Critical), or 'S' (Severe). You can find more alert script examples on this page.

On the Schedules page, select when the alert starts to be triggered, and how often it repeats. Then, click Apply Changes button so that the settings can be saved. You can click Add Schedule button to define another rule for the alert.

Now, select the database to activate the alert. You can choose a single database or multiple ones, and provide the user ID and password that provides sufficient privilege to run the SQL script on the target database.
Note: If you create a user defined alert with the Executable/Shell script type, the user ID and password that you entered must have the root or administrator privilege on the database host.

Again, make sure you click Save All button so that all the settings are saved. Then you can use Test Script button to test the SQL script on the select database, and click Logs tab to check the script result.

Step2. Set up the email server
Once the script can be run, you can set up email alert to send emails whenever an alert is triggered by the script. Go to Settings>Product Setup page, and select Email Server tab to enter the settings for the email server for notifications, such as email server host name, sender email ID, and so on.

Click Save Email Settings button to save the changes.
Step3. Configure alerts recipients
Now, go to Settings->Monitoring Profiles page, and select the profile that is assigned to the target database for the alert. The click Edit button to update the profile properties.

Select Notification tab, specify email addresses for alert recipients and other required information. Note that you need to make sure the the SQL script only alert under the Customized Alert type category is selected. You can use comma to separate multiple recipient email addresses.
Was this topic helpful?
Document Information
Modified date:
10 October 2018
UID
ibm10734585