RTView® EM
User Guide


Configure Alert Notification

EM provides alerts concerning conditions in your Solution Packages through RTView alerts. This section describes how to configure the alerts to execute an automated action (such as sending an email alert). These actions are generated on the Central Alert Server.

By default, alerts execute a .bat script. The script, by default, is not configured to execute an automated action. However, you can uncomment a line in the script that prints alert data to standard output. Or, you can modify the script to execute an automated action.

The following figure illustrates the RTView EM components that are the subject of this section.  

This section includes:


Configure Central Alert Notification
This section describes how to configure alert notification on the Central Alert Server. NOTE: These instructions assume you use the project directory you created when you Configured the Central Servers.

At this point you have:

When you uncomment the line in the script that prints alert data to standard output, both the scripts and the Java command handler output alert information to standard output. The alert output appears in the Data Server log file, or in the command window or shell in which the Data Server was started. The following is a sample output from the alert command script:
   
  ----- Alert command script executed: DOMAINNAME=EM-PACKAGE, ALERTNAME=OcObjectCountDeltaUpCache, ALERTINDEX=sim19097~DistributedCache1~near-product-1-3, ALERTID=1075, ALERTSEVERITY=2, ALERTTEXT=High Alert Limit exceeded current value: 3054.0 limit: 2.0 #####

There are two options for configuring EM alert notification:

  • Using a batch file or shell script
    This technique requires switching to an OS-specific set of alert definitions that execute the appropriate file type. A sample batch file and a sample shell script are provided which can be customized as needed.
  • Using the Java command handler
    The Java source for the EM Java command handler is provided to facilitate customization.

Using a Batch File or Shell Script
A sample batch file, my_alert_actions.bat, and a sample shell script, my_alert_actions.sh, which are located in the rtvapm/common/bin directory, are provided as templates that you can modify as needed. Use the appropriate file for the platform that hosts the Central Alert Server. By default, both scripts send alert information to standard output.

To uncomment the line in the script so that alert data prints to standard output, see:

Windows Batch File
1. Copy the my_alert_actions.bat file, located in the rtvapm/common/bin directory, into your  project directory/servers/central directory.

2. Open the rtvapm.properties file, located in the rtvapm/common/conf/ directory, in a text editor.

3. Verify the following properties are set as shown:

 

# command to execute for new alerts
sl.rtview.alert.notifiercommandnew=system cmd '$alertActionScript.$scriptEnding $domainName +$alertName+ "+$alertIndex+" +$alertID+ +$alertSeverity+ +$alertText'
# command to execute on the first severity change
sl.rtview.alert.notifiercommandfirstsevchange=system cmd '$alertActionScript.$scriptEnding $domainName +$alertName+ "+$alertIndex+" +$alertID+ +$alertSeverity+ +$alertText'
# Substitutions to define the script executed by the above command
sl.rtview.cmd_line=-sub:$scriptEnding:bat
sl.rtview.cmd_line=-sub:$alertActionScript:my_alert_actions

4. Open the my_alert_actions.bat file, located in your project directory/servers/central directory, and uncomment the echo line (near the end of the file) to print alert information to standard output. Or, you can modify the script to execute an automated action (such as sending an email alert).

5. Open the emcommon.properties file, located in your project directory/conf directory, and verify the following are set as shown:

 

sl.rtview.alert.notifierenabled=false
AlertAggregator.sl.rtview.alert.notifierenabled=true

6. Restart the Central Alert Server.


UNIX/Linux Shell Script
1. Copy the my_alert_actions.sh file, located in the rtvapm/common/bin directory, into your  project directory/servers/central directory.

2. Open the rtvapm.properties file, located in the rtvapm/common/conf/ directory, in a text editor.

3. Verify the following properties are set as shown:

  # command to execute for new alerts
sl.rtview.alert.notifiercommandnew=system cmd '$alertActionScript.$scriptEnding $domainName +$alertName+ "+$alertIndex+" +$alertID+ +$alertSeverity+ +$alertText'
# command to execute on the first severity change
sl.rtview.alert.notifiercommandfirstsevchange=system cmd '$alertActionScript.$scriptEnding $domainName +$alertName+ "+$alertIndex+" +$alertID+ +$alertSeverity+ +$alertText'
# Substitutions to define the script executed by the above command
sl.rtview.cmd_line=-sub:$scriptEnding:bat
sl.rtview.cmd_line=-sub:$alertActionScript:my_alert_actions

4.    Open the rtview.properties file, located in your project directory/servers/central directory, and copy/paste the following into it:

  sl.rtview.cmd_line=-sub:$scriptEnding:bat

5.    Change the bat file suffix to sh, as follows:

  sl.rtview.cmd_line=-sub:$scriptEnding:sh

6. Save the rtview.properties file.

7. Open the my_alert_actions.sh file, located in your project directory/servers/central directory, and uncomment the echo line (near the end of the file) to print alert information to standard out. Or, you can modify the script to execute an automated action (such as sending an email alert).

8. Open the emcommon.properties file, located in your project directory/conf directory, and verify the following are set as shown:

 

sl.rtview.alert.notifierenabled=false
AlertAggregator.sl.rtview.alert.notifierenabled=true

9.    Restart the Central Alert Server.

Batch File or Shell Script Substitutions
The default my_alert_actions scripts use the substitutions described in the table below. When you customize the script, you can use a use substitution to get any of the columns in the alert table. To do this, modify the sl.rtview.alert.notifiercommandnew and  sl.rtview.alert.notifiercommandfirstsevchange properties from Step 3 (above) to replace the default substitutions with the substitutions you want to use. You must make corresponding modifications to your script to use modified substitution values.

The substitution names map to the names of the columns in the alert table. Convert the column name to camel case and if it does not start with Alert, prepend alert to it. For example, to use the value of the Alert Name column, use $alertName. To use the value of the ID column, use $alertID. To use the value of the Row Update Time column, use $alertRowUpdateTime. The following table contains the substitutions used by the default my_alert_actions scripts:

Argument Description Values
$alertId This substitution specifies the unique ID for the alert.

For example:
alertId = 1004

Text or Numeric

 

$alertIndex This substitution specifies which source triggered the alert. With tabular objects, the first column of data is typically the Index column. The value in the Index column is a name that uniquely identifies each table row. The alertIndex uses the Index column name.

For example, if the CapactityLimitAllCaches alert is configured to monitor all of your caches, and to trigger when any of the caches exceed the specified capacity threshold, the alertIndex indicates specifically which cache triggered the alert.

With scalar objects, which do not have a table and therefore do not have a column (the useTabularDataFlag property is False), the alertIndex is blank.

For example:
alertIndex = MyCache01

Text or Numeric

 

$alertName = This substitution specifies the name of the alert.

For example:
alertName = CapacityLimitAllCaches

Values vary.
$alertSeverity This substitution specifies the severity level of the alert.

0: The alert limit has not been exceeded therefore the alert is not activated.
1: The alert warning limit has been exceeded.
2: The alert alarm limit has been exceeded.

For example:
alertSeverity = 1

Numeric

 

$alertText This substitution specifies the text that is displayed when the alert executes.

For example:
alertText = High Warning Limit exceeded, current value: 0.9452 limit: 0.8

Text
$alertTime This value is the time the alert was initially generated. Text

 


Using the Java Command Handler
1. Open the custom_handlers.properties file, located in the rtvapm\common\conf directory, in a text editor.

2. Locate the following text in the custom_handlers.properties file and select it for copying:

 

#sl.rtview.alert.notifiercommandnew=system cust 'my_alert_notification.$domainName.$alertNotifyType.$alertNotifyCol' $alertNotifyTable
#sl.rtview.alert.notifiercommandfirstsevchange=system cust 'my_alert_notification.$domainName.$alertNotifyType.$alertNotifyCol' $alertNotifyTable

3. Open the rtview.properties file, located in your project directory/servers/central directory, and paste the selected text into it.

4. In the rtview.properties file, uncomment the line to enable the java command handler.

5. Verify that the rtvapm_custom.jar file is built per the Customizing the Java Command Handler instructions. 

6. Open the custom_handler.properties file and verify that the following line is the correct path to the rtvapm_custom.jar. If it is not the correct path, copy the line into the rtview.properties file in your project directory/servers/central directoryand edit the path as needed:

 

sl.rtview.cp=%RTVAPM_USER_HOME%/custom/lib/rtvapm_custom.jar

7. Save the rtview.properties file.

8. Restart the Central Alert Server using the following command line argument:

  Windows
   -properties:%RTVAPM_HOME%/common/conf/custom_handlers
   
  UNIX
  -properties:$RTVAPM_HOME/common/conf/custom_handlers

Customizing the Java Command Handler
The source for the EM Java handler is provided in the RtvApmCommandHandler.java file, located in
your project directory\custom\src\com\sl\rtvapm\custom directory. By default, the handler prints the alert data to standard output. To change this behavior perform the following steps:

1. Open the RtvApmCommandHandler.java file.

2. Modify the OutputAlertString method as needed. You can replace this method with your own if you modify the invokeCommand method to call it, and your method accepts the same arguments as OutputAlertString.

3. Save the RtvApmCommandHandler.java file.

4. Compile RtvApmCommandHandler.java and rebuild rtvapm_custom.jar using the supplied script (make_classes.bat or make_classes.sh) in your project directory\custom\src directory.

5. Restart the Central Alert Server using the following command line argument:

  Windows
   -properties:%RTVAPM_HOME%/common/conf/custom_handlers
   
  UNIX
  -properties:$RTVAPM_HOME/common/conf/custom_handlers

Java Command Handler Substitutions
When you customize the Java Command Handler, there is no need to modify the sl.rtview.alert.notifiercommandnew and sl.rtview.alert.notifiercommandfirstsevchange properties in the custom_handlers.properties file. The entire alert table row is passed into the Java Command Handler for each alert that notifies so that all information regarding those alerts is available. The following substitutions are used:

Argument Description
$alertNotifyType This substitution specifies to show the value of the notification type so you can use the same command for all notifications. Values are NEW_ALERT, CLEARED_ALERT, FIRST_SEV_CHANGE or COLUMN_CHANGED.
$alertNotifyCol This substitution only applies when the notifyType is COLUMN_CHANGED. Specifies to use a semi-colon delimited list of column names that changed from the alertNotifierColumns.
$alertNotifyTable This substitution specifies the row in the alert table that corresponds to this notification into the command.

 

Additional Optional Properties
sl.rtview.alert.notifiercommandcleared - Set this to the command to execute when an alert is cleared. By default, no command is configured. To execute a script, copy the notifiercommandnew line and replace $alertActionScript with the name of the script you want to execute. To execute a custom java command, see the example in common\conf\custom_handlers.properties.

sl.rtview.alert.notifiercommandchanged - Set this to the command to execute when a column in the alert table changes. To execute a script, copy the notifiercommandnew line and replace $alertActionScript with the name of the script you want to execute. To execute a custom java command, see the example in common\conf\custom_handlers.properties. This must be used in conjunction with the sl.rtview.alert.notifiercolumns property

sl.rtview.notifiercolumns - Set this to the name of one or more columns to execute the sl.rtview.alert.notifiercommandchanged notification when they change. For multiple columns, use a semi-colon delimited list. Note that this should be limited to the minimum number of necessary columns, preferably less than 5, as a large number of columns increases the persistence load on the central alert server.

Notification Persistence
To prevent duplication and missed notifications after restart or failover, you must configure the Central Alert Server for alert persistence and also add the following tables to your ALERTDEFS database:

  • ALERT_PERSIST_TABLE_CENTRAL
  • ALERT_NOTIF_PERSIST_TABLE: Notification information is persisted to this table.

The schemas for both tables are in %RTVAPM_HOME%\common\dbconfig. For ALERT_PERSIST_TABLE_CENTRAL, use the same schema as ALERT_PERSIST_TABLE. To enable notification persistence, override the following property in the emcommon.properties file, located in the projects\emsample\conf\ directory:

    AlertAggregator.sl.rtview.alert.persistAlerts=true

The notifiercommandfirstsevchange notification is not persisted and executes the first time the severity changes on an unacknowledged alert each time the Central Alert Server starts. This means that a notification is executed the first time it changes on a new alert, and again the first time it changes after the Central Alert Server is restarted or fails over.

Notification information is persisted to the ALERT_NOTIF_PERSIST_TABLE for each notification that is executed. In order to optimize performance of the central alert server, limit the number of columns specified in the sl.rtview.alert.notifiercolumns property to the minimum number of necessary columns, preferably less than 5. The more columns you notify on, the greater the number of notifications that are written to the database.



Configure Optional Backend Server Notification
The above sections describe configuring the Central Alert Server to execute all notifications. You may also configure any of the Solution Package Data Servers to notify on only the alerts in that server. To enable notification on a Solution Package Data Server, add the following property to the properties file for that Data Server:

    sl.rtview.alert.notifierenabled=true

This can be done in addition to the Central Alert Server notification. To disable the Central Alert Server notification, set the following property in emcommon.properties to false:

    AlertAggregator.sl.rtview.alert.notifierenabled=true


Upgrade Notes
In previous releases, alert notifications were executed in the solution package data servers, but now notifications are done centrally. In order to support this, the following properties from rtvapm\common\conf\rtvapm.properties have been removed or replaced. If you have modified any of these properties in rtvapm\common\conf\rtvapm.properties or overridden them in your properties file, you will need to make the following modifications:

  sl.rtview.alert.alertcommand - use sl.rtview.notifiercommandnew instead. Also set the same value on the sl.rtview.notifiercommandfirstsevchange property if you want to receive a notification the first time the severity changes on an alert. If you do not want to receive notifications the first time the severity changes on an alert, set sl.rtview.notifiercommandfirstsevchange to a blank value.
   
  sl.rtview.alert.renotficationcommand - This property is no longer supported.
   
  sl.rtview.alert.renotificationmode - This property is no longer supported.
   
  sl.rtview.alert.renotficationtime - This property is no longer supported.
   
  sl.rtview.alert.renotifyonsevchangedmode - This property is no longer supported. This property previously defaulted to 1. If you set it to 0, set the sl.rtview.notifiercommandfirstsevchange to a blank value. If you set it to 1, set the sl.rtview.alert.notifiercommandfirstsevchange to the same value as sl.rtview.notifiercommandnew. With this configuration, you will get a notification the first time the Severity changes. If you want to be notified every time the Severity changes, use the sl.rtview.alert.notifiercommandchanged property and set sl.rtview.alert.notifiercolumns to Severity.
   
  sl.rtview.alert.commentcommand - This property is no longer supported. To receive notifications when the comment changes, set the sl.rtview.alert.notifiercommandchanged to the value you previously used for the commentcommand property. Set the sl.rtview.alert.notifiercolumns property to Comments.
   
  sl.rtview.alert.alertclearedcommand - This property is no longer supported. Use the sl.rtview.alert.notifiercommandcleared property instead.

 

 

 
 
 
SL, SL-GMS, GMS, RTView, SL Corporation, and the SL logo are trademarks or registered trademarks of Sherrill-Lubinski Corporation in the United States and other countries. Copyright © 1998-2013 Sherrill-Lubinski Corporation. All Rights Reserved.
 
 
 

JMS, JMX and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. They are mentioned in this document for identification purposes only.

 
 
 

Third Party Notice Requirements