Execute Java Code

This alert notification action allows you to implement your alert notification actions using Java code. It executes the my_alert_notification.$domainName.$alertNotifyType.$alertNotifyCol command in your Custom Command Handler and passes the row from the alert table that corresponds to the alert.

This action can only be added once per notification type. In addition to selecting this action the Configuration Application you must also modify the custom command handler to execute the actions for your notification. A sample custom command handler is included under projects/custom. It prints the alert notification to the console. You will modify this command handler to implement your own notification actions.

Make the following entries:

Note that if you can only have one custom command handler per Data Server, so changing these settings for one notification event will change them for the rest of the notification events.

Customizing the Custom Command Handler

The source for the Custom Command handler is provided in the RtvApmCommandHandler.java file, located in the RTViewEnterpriseMonitor\projects\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_all.bat or make_all.sh) in projects\custom\src directory.

Return to Alert Event Options.