Previous Topic: Configure AlertsNext Topic: Create Remediation Script Using DM Script


Create DM Script-based Alerts

You can create custom alerts based on DM Script. Deploy the script to Script Directory, which is configured at Configuration Policy, DSM, Health Monitoring, Health Monitoring Agent, ScriptDir, on the agent machines before applying the configuration related to these alerts.

Follow these steps:

  1. Navigate to Control Panel, Configuration, Configuration Policy, DSM, Health Monitoring, Alert Configuration, and Alerts.
  2. Select Add to create an alert based on a script and leave the template name field empty.
  3. Specify the DM script name that is deployed to the agent machines.
  4. Specify the parameters in the Parameters fields.
  5. In the message field, add any text related to the alert (have parameters if needed).
  6. Set other alert parameters and apply to the agents for monitoring.

DM Script Alert Example:

The following DM script reports the presence or absence of alert condition to the HM agent by invoking hmAlertOPFormatter. For example,

'Do your alert condition checking here.
'...
' At bottom of your DM script, execute hmAlertOPFormatter
' to create the alert XML output.
dim ret as integer
ret = Exec("hmAlertOPFormatter.exe alertconditionexist=1 raisealertnow=1 ""param1=" + argv(1)  + ",param2=" + argv(2) + """ additionalinfo=this is some additional text for script with Args", true)
print "hmAlertOPFormatter.exe: " + str(ret)

To create an XML file for HM Agent to process when invoked for monitoring alerts, execute the following command in the DM script:

hmAlertOPFormatter executable
hmAlertOPFormatter.exe alertconditionexist=0|1 [raisealertnow=0|1] [PARAM1=data1,PARAM2=data2,..,PARAMX=datax] [additional info=Additional Info]
alertconditionexist=0|1

Use value 0 when your DM script has not determined any alert condition. Use value 1 when your script has determined an alert condition.

raisealertnow=0|1

(optional) the default value is 0. Use value 1 to raise the alert immediately.

PARAM1=data1,PARAM2=data2 .. PARAMX=datax - 

(optional) These key value pairs indicate the parameters and values in the alert message. The sequence of key value pairs is separated by a comma (,) where keys and values are separated by an equal sign (=).

additionalinfo=<Additional Info> 

(optional) This parameter is the last one on the command line. All the rest of the command line after equal sign (=) is accumulated together as one field of resulting alert XML.