How to customize alert notifications

Ops Center Protector User Guide

Version
7.7.x
Audience
anonymous
Part Number
MK-99PRT002-08
ft:lastEdition
2023-10-26

If your site must receive alert notifications based on real-time or audit log events, then you can create a custom configuration file with instructions for which script/program Ops Center Protector must run as an event handler, and the arguments to pass to it.

Custom event handlers are added to the Notification Wizard as checkboxes in the Notification Method area.

By default, all Ops Center Protector notification handler configuration files are stored relative to the installation directory:

\db\config\notification

The path to the handler executable must be relative to the \bin directory where Ops Center Protector is installed. The default locations are as follows:

For Windows:

C:\Program Files\Hitachi\Protector\bin

For Linux:

/opt/hitachi/protector/bin

The built-in Email and System Event notification methods are configured by email.cfg and systemlog.cfg and implemented by nehemail.exe and neheventlog.exe, respectively (we recommend using the prefix neh to identify notification event handlers).

The first parameter passed to the handler is always the path to a log message file (About the notifications log message file). You can also specify your own additional arguments for Windows and Linux that are stored separately, so the same configuration file can be reused on both operating systems.

The custom hander is specified in the format shown in the following example (customeventhandler.cfg):

<cofioxmllist>
	<!-- text for custom notification method check box --> 
	<item name="HandlerName" argtype="single" >
		<value type="string" >Custom</value>
	</item>
		
	<!-- default state of custom notification method check box -->
	<item name="Default" argtype="single" >
		<value type="bool" >False</value>
 </item>
		
	<!-- handler executable or script name -->
	<item name="HandlerExecutable" argtype="list" >
		<item name="WinExecutable" argtype="single" >
			<value type="string" >nehcustom.exe</value>
		</item>
		<item name="UnixExecutable" argtype="single" >
			<value type="string" >nehcustom</value>
		</item>
	</item>

	<!-- arguments 2, 3, ..., n passed to custom handler -->
	<item name="WinHandlerArgs" argtype="list" >
  <item name="HandlerArg" argtype="single" >
  	<value type="string">windows custom arg</value>
  </item>
 </item>
 <item name="UnixHandlerArgs" argtype="list" >
  <item name="HandlerArg" argtype="single" >
  	<value type="string">unix custom arg</value>
  </item>
 </item>
</cofioxmllist>

Any text printed to the standard output device by the handler will be included as an attachment to an error log message:

handler name notifier failed. (Attachment 1) *** Attachment count 1 ***"

The exit code of the handler is ignored.