Set System Alerts Using a Business Rule
In addition to the metrics in the Configuration pane, you can further customize your system monitoring by using business rules. The measurements taken by these business rules is added to the results file specified in the Output Path field in the Configuration pane. To configure system alerts using business rules, do the following.
Note: To perform this task, you must be signed in as the SystemAdmin or SuperAdmin user. For more information, see
- Go to System
- In the Monitor by Business Rules pane, click Add Business Rule.
- In the dialog box, navigate to and select the business rule to use for monitoring, and then click OK.
Tip: For information on the monitoring business rule, see Monitoring Business Rule Syntax.
- In the Event Name field, enter the event that triggers the business rule to run.
- To add another business rule, repeat steps 2 through 4. Business rules are run in the order that they are displayed.
- Click Save.
Monitoring Business Rule Syntax
Measurement results must use the following syntax in the data map.
- ALERT/0/actualLevel
- ALERT/0/alertLevel
- ALERT/0/areaName
- ALERT/0/details
- ALERT/0/warnLevel
- INFORMATIONAL/0/actualLevel
- INFORMATIONAL/0/alertLevel
- INFORMATIONAL/0/areaName
- INFORMATIONAL/0/warnLevel
- INFORMATIONAL/1/actualLevel
- INFORMATIONAL/1/alertLevel
- INFORMATIONAL/1/areaName
- INFORMATIONAL/1/warnLevel
- WARNING/0/actualLevel
- WARNING/0/alertLevel
- WARNING/0/areaName
- WARNING/0/warnLevel
Example
The following script can be used in a Run Data Map Script block in a monitoring business rule.
// Check for keys create where needed.
if(!MAP.keyExists("/INFORMATIONAL")){
MAP.putValue("/INFORMATIONAL",null,null,"override","mergeNone");
}
if(!MAP.keyExists("/WARNING")){
MAP.putValue("/WARNING",null,null,"override","mergeNone");
}
if(!MAP.keyExists("/ALERT")){
MAP.putValue("/ALERT",null,null,"override","mergeNone");
}
var alertLevel = 10;
var warnLevel = 5;
var actualLevel = 11;
var alertEntry = MAP.createNode();
alertEntry.addEntry("areaName","Number I wrote");
alertEntry.addEntry("alertLevel",alertLevel);
alertEntry.addEntry("warnLevel",warnLevel);
alertEntry.addEntry("actualLevel", actualLevel);
if(actualLevel > alertLevel){
MAP.addRow("/ALERT",alertEntry);
}else if(actualLevel > warnLevel){
MAP.addRow("/WARNING",alertEntry);
}else{
MAP.addRow("/INFORMATIONAL",alertEntry);
}
function printMap() {
LOG.error(" -------------- Data Map dump START ---------------- ");
// LOG.error(MAP.getValue("/").convertToRawNode());
var store = new com.loftware.webservices.dto.document.SimpleDataMapStore();
store.push(MAP.getValue("/").convertToRawNode() ,"/");
LOG.error(store.getDebugString());
LOG.error(" -------------- Data Map dump END ---------------- ");
}
printMap();