AutoPatrol
191
edits
Line 157: | Line 157: | ||
You can select situation to update, and enter instance name and attributes to be set. In instance name and attributes' values you can use same macros as in alarm generation. | You can select situation to update, and enter instance name and attributes to be set. In instance name and attributes' values you can use same macros as in alarm generation. | ||
== Macros for Event Processing == | |||
On various stages of event processing you may need to use macros to include information like event source, severity, or parameter in your event texts, alarms, or actions. You may use the following macros to accomplish this: | |||
{| class="wikitable" style="width: 70%" | |||
! Macro || Description | |||
|- | |||
| %n | |||
| Name of event source object. | |||
|- | |||
| %a | |||
| IP address of event source object. | |||
|- | |||
| %i | |||
| Unique ID of event source object. | |||
|- | |||
| %t | |||
| Event's timestamp is a form ''day-month-year hour:minute:second''. | |||
|- | |||
| %T | |||
| Event's timestamp as a number of seconds since epoch (as returned by time() function). | |||
|- | |||
| %c | |||
| Event's code. | |||
|- | |||
| %N | |||
| Event's name. | |||
|- | |||
| %s | |||
| Event's severity code as number. Possible values are: | |||
{| class="wikitable" | |||
| 0 | |||
| Normal | |||
|- | |||
| 1 | |||
| Warning | |||
|- | |||
| 2 | |||
| Minor | |||
|- | |||
| 3 | |||
| Major | |||
|- | |||
| 4 | |||
| Critical | |||
|} | |||
|- | |||
| %S | |||
| Event's severity code as text. | |||
|- | |||
| %v | |||
| NetXMS server's version. | |||
|- | |||
| %u | |||
| User tag associated with the event. | |||
|- | |||
| %m | |||
| Event's message text (meaningless in event template). | |||
|- | |||
| %A | |||
| Alarm's text (can be used only in actions to put text of alarm from the same event processing policy rule). | |||
|- | |||
| %M | |||
| Custom message text. Can be set in filtering script by setting CUSTOM_MESSAGE variable. | |||
|- | |||
| <nowiki>%[</nowiki>''name''] | |||
| Value returned by script. You should specify name of the script from script library. | |||
|- | |||
| %{''name''} | |||
| Value of custom attribute. | |||
|- | |||
| <nowiki>%<</nowiki>''name''> | |||
| Event's parameter with given name. | |||
|- | |||
| %1 - %99 | |||
| Event's parameter number 1 .. 99. | |||
|- | |||
| %% | |||
| Insert % character. | |||
|} | |||
If you need to insert special characters (like carriage return) you can use the following notations: | |||
{| class="wikitable" | |||
! Char || Description | |||
|- | |||
| \t | |||
| Tab character | |||
|- | |||
| \n | |||
| CR/LF character pair | |||
|- | |||
| \\ | |||
| Backslash character | |||
|} |