Definition file templates for event action customization
Ops Center Analyzer provides users with definition file templates that can be customized to run actions based on specific events along with email notifications.
Setting event actions
Setting event actions allows you to run a batch file for running an event action when an Ops Center Analyzer event is registered. You can enable automatic notifications when an error is detected by Ops Center Analyzer by defining commands to run when an event is registered in the batch file for running an event action.
Defining a file for running an event action
To run an event action, create a file that defines the commands to run when a specific event is registered.
You can specify any file name. However, the extension must be as follows:
- Windows:
.bat
- Linux:
.sh
In the file for running an event action, you can view information about the event that triggered an event action through environment variables. The following table shows the environment variables that you can specify in a file for running an event action.
Variable name |
Description |
ANALYTICS_SOURCE |
Device name |
ANALYTICS_DEVICE |
Device type |
ANALYTICS_DESCRIPTION |
Message |
ANALYTICS_CATEGORY |
Category |
ANALYTICS_SEVERITY |
Level |
ANALYTICS_DATE |
Registration date |
ANALYTICS_EVENTID |
Event ID |
ANALYTICS_GROUPSnnn |
Group name. Specify
|
ANALYTICS_NODEID |
Node ID |
ANALYTICS_COMPONENTID |
Component ID |
ANALYTICS_PERFCOMPONENTID |
Performance |
ANALYTICS_NAME |
Name of a host where Ops Center Analyzer is running |
Example of specifying an environment variable:
- Windows: %ANALYTICS_SOURCE%
- Linux: ${ANALYTICS_SOURCE}
Event action definition file format
The following describes the format used to enter data and the settings to specify in
EventAction.properties
. The timing when the specified definitions are applied is also described.
Format
specified-key-name=specified-value
File
EventAction.properties
Save the file in UTF-8 format. When you save the file, prevent a BOM (byte order mark) from being added to the file.
Folder
- For Windows:
Ops-Center-Analyzer-installation-folder\Analytics\conf
The default installation folder is C:\Program Files\HITACHI.
- For Linux:
Ops-Center-Analyzer-installation-folder/Analytics/conf
The default installation folder is /opt/hitachi.
- For Windows:
Update frequency
Ops Center Analyzer rereads the definition file if more than 5 minutes have elapsed since the previous reading before executing the event action.
Content to specify
Specify each key name and value on a single line. When you create the event action definition file, the following rules apply:
-
A line starting with # is treated as a comment line
-
Blank lines are ignored
-
The entered values are case-sensitive
-
If the same key is specified more than once in the same file, the last specification is valid
-
To specify a backslash (\), enter \\
-
To display %, specify %%
-
To specify an apostrophe ('), enter \'
-
To display a double quotation mark ("), specify \"
-
Specify only an absolute path. A path specified in an environment variable cannot be set for the path
-
Setting description
Key name
Setting description
Specifiable values
Default value
Optional or required
EventAction.cmd
Specifies the absolute path of the batch file for running an event action.
ASCII characters and characters in 260 bytes, excluding control characters.
Note: Spaces are excluded.
Null character
Optional
If this key is omitted, no event action will be run.
This key also enables or disables the function.
EventAction.maxCount
Specifies the maximum number of event actions that can be run simultaneously.
1 to 100
10
Optional
If this key is omitted, the default value will be used.
EventAction.timeOut
Specifies the timeout time for event actions (in milliseconds).
1 to 3,600,000
300,000
Optional
If this key is omitted, the default value will be used.
Format of the email template definition file
To create emails more efficiently, create an email template definition file and then use an email template to create emails from the Execute Action window. You can also create emails that contain Ops Center Analyzer-managed resource data. For example, you can create an email template that provides information on how to troubleshoot a resource failure. When a failure occurs, email templates allow you to create emails from the Execute Action window to quickly notify the system administrator.
Prerequisite
-
To send email messages from Ops Center Analyzer, configure the email server for Ops Center Analyzer.
-
Format
specified-key-name=specified-value
File
-
Use any file.
-
Save the file in UTF-8 format.
-
A maximum of 1,000 files can be set in Ops Center Analyzer. Files are loaded in alphabetical order by file name, and any files after the 1,000th file are not loaded.
-
Folder
- For Windows:
Ops-Center-Analyzer-installation-folder\Analytics\conf\template\mail
The default installation folder is C:\Program Files\HITACHI.
- For Linux:
Ops-Center-Analyzer-installation-folder/Analytics/conf/template/mail
The default installation folder is /opt/hitachi.
- For Windows:
Update frequency
When Ops Center Analyzer is started or the reloadtemplate command is run.
Content to specify
Specify each key name and value on a single line. When you create the email template definition file, the following rules apply:
-
A line starting with # is treated as a comment line
-
Blank lines are ignored
-
The entered values are case-sensitive
-
If the same key is specified more than once in the same file, the last specification is valid
-
To display \, specify \\
-
To display %, specify %%
-
If the filter condition SE.template.filter.xxxxxxx.string is specified more than once, settings will be displayed when all of the conditions are met
-
If you specify "LFCR" for the setting value, it displays in a new line in a preview window
-
Setting description
Key name
Setting description
Specifiable values
Default value
Optional or required
SE.template.name.string
Specify the action name.
Values of no more than 127 bytes that do not include control characters
Null character
Required
If this key is omitted, the processing to read files will fail.
The name of this key is the same as the name specified in a command template definition file.
SE.template.description.string
Specify a description of the action.
Values of no more than 255 bytes that do not include control characters
Null character
Optional
If this key is omitted, the default value will be used.
SE.mail.template.title.string
Specify the subject of the email template.
Values of no more than 255 bytes that do not include control characters
Null character
Optional
If this key is omitted, the default value will be used.
SE.mail.template.body.string
Specify the body of the email template.
Values of no more than 4,096 bytes that do not include control characters
Null character
Optional
If this key is omitted, the default value will be used.
SE.mail.template.address.string
Specify the address of the email template
Values of no more than 255 bytes that do not include control characters
Null character
Optional
If this key is omitted, the default value will be used.
SE.template.filter.resourceName.string
Specify conditions for the names of the resources that are starting points and that display in the action list during resource selection.1
Values of no more than 255 bytes that do not include control characters
Null character
Optional
If this key is omitted, the default value will be used, and the key will not be used as a filter condition.
SE.template.filter.resourceType.string
Specify conditions for the types of resource that are starting points and that display in the action list during resource selection.1
Values of no more than 32 bytes that do not include control characters
Null character
Optional
If this key is omitted, the default value will be used, and the key will not be used as a filter condition.
SE.template.filter.vmHostname.string
Specify conditions for the virtual machine names that display in the action list during resource selection.1
Values of no more than 64 bytes that do not include control characters
Null character
Optional
If this key is omitted, the default value will be used, and the key will not be used as a filter condition.
SE.template.filter.ipaddress.string
Specify conditions for the IP addresses that display in the action list during resource selection.1
Values of no more than 255 bytes that do not include control characters
Null character
Optional
If this key is omitted, the default value will be used, and the key will not be used as a filter condition.
SE.template.filter.upperResourceName.string
Specify conditions for the names of higher-level resources of a starting point that display in the action list during resource selection.1
Values of no more than 512 bytes that do not include control characters
Null character
Optional
If this key is omitted, the default value will be used, and the key will not be used as a filter condition.
SE.template.filter.upperResourceType.string
Specify conditions for the types of higher-level resources of a starting point that display in the action list during resource selection.1
Values of no more than 32 bytes that do not include control characters
Null character
Optional
If this key is omitted, the default value will be used, and the key will not be used as a filter condition.
1Settings display only when the Execute Action window is called from a resource that matches the specified conditions. By using variables, you can set information about a selected resource as the value of a setting.
Variable name
Description
Remarks
%ANALYTICS_RESOURCENAME%
Name of the selected resource
Not applicable
%ANALYTICS_UPPERRESOURCENAME%
Name of the higher-level resource of the selected resource
Not applicable
%ANALYTICS_IPADDRESS%
IP address
Not applicable
%ANALYTICS_VIRTUALMACHINENAME%
Name of the virtual host
Displays only when the resource is a virtual machine.
%ANALYTICS_RESOURCETYPE%
Resource type
Not applicable
%ANALYTICS_UPPERRESOURCETYPE%
Type of the higher-level resource
Not applicable
If no value is set for the selected resource, a null character displays.
To display information about virtual hosts and IP addresses, VMware Tools must be installed on virtual hosts.
The email template definition file restricts the maximum number of characters that can be displayed in the email editor.
If the maximum number of specifiable characters is exceeded in an email template's address, subject, and body, clicking Launch Mailer in the Execute Action dialog box might not start the email editor normally.
If the email editor does not start normally, manually start the email editor, and then copy the contents of the preview to use them.
The maximum number of specifiable characters depends on the web browser. As a guideline, the maximum number of characters for web browsers is 2059 for the Firefox browser, and 200 for the Internet Explorer 11 browser.
Command template definition files formats
If you create a command template definition file, use the Execute Action window to run commands of other products, user programs, and resources on the Ops Center Analyzer management server. If you want to run more than one command at the same time, you can create a batch or shell command.
Format
specified-key-name=specified-value
File
- Specify any file name and file extension.
- Save the file in UTF-8 format.
- The maximum number of files that can be set in Ops Center Analyzer (including the number of email template definition files) is 1,000. Files load in alphabetical order by file name, and any files after the 1,000th file are not loaded.
Folder
- For Windows:
Ops-Center-Analyzer-installation-folder\Analytics\conf\template\command
The default installation folder is C:\Program Files\HITACHI.
- For Linux:
Ops-Center-Analyzer-installation-folder/Analytics/conf/template/command
The default installation folder is /opt/hitachi.
- For Windows:
Update frequency
When Ops Center Analyzer is started or the reloadtemplate command is run.
Content to specify
Specify each key name and value on a single line. The following rules apply when specifying settings in a command template definition file:
- A line starting with # is treated as a comment line.
- Blank lines are ignored.
- The entered values are case-sensitive.
- If you specify an invalid value, the default value is used.
- If you specify the same key more than once in the same file, the last specification is valid.
- To display \, specify \\.
- To display %, specify %%.
- If you specify the filter condition
SE.template.filter.xxxxxxx.string
more than once, settings display when all of the conditions are met.
Setting descriptions
Key name
Setting description
Specifiable values
Default value
Optional or required
SE.template.name.string
Specify the action name.
Values of no more than 127 bytes that do not include control characters
This setting has no default value, because specifying this setting is required.
Required
SE.template.description.string
Specify a description of the action.
Values of no more than 255 bytes that do not include control characters
Null character
Optional
If this key is omitted, the default value is used.
SE.cmd.template.cmdName.string
Specify the name of the command to run by specifying the absolute path to the command. A command specified by its relative path might fail.
Values of no more than 255 bytes that do not include control characters
Do not specify the following strings:
& | ; $ > < ` ! ../ ..\ ( ) { }
This setting has no default value, because specifying this setting is required.
Required
SE.cmd.template.cmdArgs.string
Specify arguments for the command to run.
Values of no more than 4,096 bytes that do not include control characters
Do not specify the following strings:
& | ; $ > < ` ! ../ ..\ ( ) { }
Null character
Optional
If this key is omitted, the default value is used.
SE.cmd.template.timeOut.num
Specify the timeout period for the command to run (in milliseconds).
1 to 2,147,483,647
30,000
Optional
If this key is omitted, the default value is used.
SE.template.filter.resourceName.string
Specify conditions for the names of the resources that are starting points and that display in the action list during resource selection. 1
Values of no more than 255 bytes that do not include control characters
Null character
Optional
If this key is omitted, the default value is used.
SE.template.filter.resourceType.string
Specify conditions for the types of resources that are starting points and that display in the action list during resource selection.1
Values of no more than 32 bytes that do not include control characters
Null character
Optional
If this key is omitted, the default value is used.
SE.template.filter.vmHostname.string
Specify conditions for the virtual machine names that display in the action list during resource selection.*
Values of no more than 64 bytes that do not include control characters
Null character
Optional
If this key is omitted, the default value is used.
SE.template.filter.ipaddress.string
Specify conditions for the IP addresses that display in the action list during resource selection.1
Values of no more than 255 bytes that do not include control characters
Null character
Optional
If this key is omitted, the default value is used.
SE.template.filter.upperResourceName.string
Specify conditions for the names of higher-level resources of a starting point that display in the action list during resource selection.1
Values of no more than 512 bytes that do not include control characters
Null character
Optional
If this key is omitted, the default value is used.
SE.template.filter.upperResourceType.string
Specify conditions for the types of higher-level resources of a starting point that display in the action list during resource selection.1
Values of no more than 32 bytes that do not include control characters
Null character
Optional
If this key is omitted, the default value is used.
SE.template.filter.MultipleResources.boolean
Specify whether to execute for multiple resources.
true or false
false
Optional
If this key is omitted, the default value is used.
SE.cmd.template.usage.string
Specify how to use the command.
Values of no more than 4,096 bytes that do not include control characters
Null character
Optional
If this key is omitted, the default value is used.
* Settings display only when the Execute Action window is called from a resource that matches the specified conditions. By using variables, you can set information about a selected resource as the value of a setting.
The following table lists the variables you can use.
Variable name
Description
Remarks
%ANALYTICS_RESOURCENAME%
Name of the selected resource
N/A
%ANALYTICS_UPPERRESOURCENAME%
Name of the higher-level resource of the selected resource
N/A
%ANALYTICS_IPADDRESS%
IP address
N/A
%ANALYTICS_VIRTUALMACHINENAME%
Name of the virtual host
Displays only when the resource is a virtual machine.
%ANALYTICS_RESOURCETYPE%
Resource type
N/A
%ANALYTICS_UPPERRESOURCETYPE%
Type of the higher-level resource
N/A
If no value is set for the selected resource, a null character displays.
To display information about virtual hosts and IP addresses, VMware Tools must be installed on virtual hosts.
Definition example where the selected resource names are specified for command arguments
SE.template.name.string=001_task-execution SE.template.description.string=Executes the scheduled tasks SE.cmd.template.cmdName.string=schtasks SE.cmd.template.cmdArgs.string=/run /tn /*TaskName*/ /s %ANALYTICS_RESOURCENAME% /*User*/