Oracle Coherence Monitor

User Guide

 


Configuring Alert Notification
The OC Monitor provides alerts concerning conditions in a Coherence cluster through RTView alerts.
 This section describes how to configure the alerts to execute an automated action.

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 (such as sending an email alert).

There are two options for configuring OC Monitor alert notification:

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=SL-OCMON-1, 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 #####

 


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 common/bin directory, are provided as templates that you can modify as needed. Use the appropriate file for the platform that hosts OC Monitor processes. 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 in:

Windows Batch File
1. Copy the my_alert_actions.bat file, located in the common/bin directory,into your project 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 follows:

 

# 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'

4.    Open the my_alert_actions.bat file, located in your project 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.    Restart the Data Server.


UNIX/Linux Shell Script
1. Copy the my_alert_actions.sh file, located in the common/bin directory, into your project 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 follows:

 

# 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'

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

 

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

5. Change the bat suffix to sh.

6. Save the rtview.properties file.   

7. Open the my_alert_actions.sh file, located in your project 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.    Restart the Data 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. For details, see OCM alerts.
$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, and paste the selected text into it.

4. In the rtview.properties file, uncomment the lines you just pasted 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 and edit the path as needed.

 

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

7. Save the rtview.properties file.

8. Restart the Data 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 OC Monitor Java handler is provided in the RtvApmCommandHandler.java file, located in the \projects\sample\custom\src\com\sl\rtvapm\custom directory of your OC Monitor installation 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 the \projects\sample\custom\src directory.

5. Restart the Data 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 Data Server for alert persistence.


Upgrade Notes
In order to support better integration with RTView EM, 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.


 


 

 

 

 


 

RTView contains components licensed under the Apache License Version 2.0.

 

Treemap Algorithms v1.0  is used without modifications and licensed by MPL Version 1.1. Copyright © 2001 University of Maryland, College Park, MD

 

Datejs is licensed under MIT. Copyright © Coolite Inc.

 

jQuery is licensed under MIT. Copyright © John Resig,

 

JCalendar 1.3.2 is licensed under LGPL. Copyright © Kai Toedter.

 

jQuery is licensed under MIT. Copyright (c) 2009 John Resig, http://jquery.com/ JCalendar 1.3.2 is licensed under LGPL. Copyright © Kai Toedter.

 

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. 

 

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.