Macros in Alerts & Policies
You can customize your alert messages by including pre-defined Macros. These Macros serve as placeholders that are automatically replaced with actual values when the alert is triggered. By leveraging Macros, you can tailor your alert messages to provide precise information about the event that triggered the alert, facilitating quicker and more informed decision-making.
Navigation
While configuring a policy, click on the to modify the default alert messages. Here, you can use the pre-defined macros to customize the alert message and the subject.
How to Use Macros
To use Macros in your alert messages, simply include the Macros within your customized alert message. When the alert is triggered, these Macros will be replaced with the actual values associated with the event.
Below is an example of how you can incorporate Macros in your alert message:
An alert $$$policy.name$$$
was triggered with $$$severity$$$
severity for the monitor $$$object.name$$$ (IP: $$$object.ip$$$)
because the $$$counter$$$
breached the threshold with the value $$$value$$$
.
Supported Macros
Motadata AIOps supports all instance level counters as macros. Let's understand how to use instance counters as macros using an example:
For this scenario, assume you have created a policy for interface.in.traffic.utilization.percent
. Thus, you can mention the below instance counters as macros in your alert message:
Instances |
---|
interface.sent.discard.packets |
interface.in.packets |
interface.packets |
interface.error.packets |
interface.sent.error.packets |
interface.received.discard.packets |
interface.received.octets |
interface.bit.type |
interface.status |
interface.out.packets |
interface.operational.status |
interface.admin.status |
interface.sent.octets |
interface.last.change |
interface.received.error.packets |
interface.discard.packets |
interface.in.traffic.utilization.percent |
interface.out.traffic.utilization.percent |
Below is an example of how you can incorporate instance counters as macros in your alert message:
$$$counter$$$
has entered into $$$severity$$$
state with value $$$value$$$
on instance $$$instance$$$
with interface alias $$$interface.alias$$$
and description $$$interface.description$$$
for parent object $$$object.host$$$($$$object.ip$$$)
At the same time interface out utilization was $$$interface.out.traffic.utilization.percent$$$
Mentioned below is the message which will be received when the alert is triggered:
interface~in.traffic.utilization.percent has entered into major state with value 0.0 on instance Et0/3-4 with interface alias test-eth0/3 and description Ethernet0/3 for parent object g4.g4.com(172.16.9.225). At the same time interface out utilization was 0.
With these Macros, you can create customized alert messages tailored to your specific requirements, ensuring that you receive the most relevant information when alerts are triggered.