I need some help setting up email alerts

I have set up the email alerting and it works fine. I would like tho to have as Fault or Description of the problem the same text that I see in the Alerts in the web page. Those are really well structured and one can pretty much instantly figure out what’s going on.
I will give you an example :

10.3.1.42
#1:[Runtime
Current Value: 2 (runtime)
low: 5, low_warn: 10, high_warn: 2000, high: 3000

This is what an alert looks in the web’s alert tab
If I am using the default template for the same alert this is what the alert looks like in my email :

sysObjectID = .1.3.6.1.4.1.318.1.3.27; sysDescr = APC Web/SNMP
Management Card (MB:v4.1.0 PF:v6.4.0 PN:apc_hw05_aos_640.bin AF1:v6.4.0
AN1:apc_hw05_sumx_640.bin MN:AP9631 HR:08 SN: ZA1616004594 MD:04/29/2016)
(Embedded PowerNet SNMP Agent SW v2.2 compatible); location_id = 13;
sensor_id = 628; sensor_oid = .1.3.6.1.4.1.318.1.1.1.2.2.3.0; sensor_descr =
Runtime;

I am using the default template with the code :

@foreach ($alert->faults as $key => $value)
{{ $key }}: {{ $value[‘string’] }}
@endforeach

I’ve tried to figure out how to achieve the desired result reading the documentation but i couldn’t figure it out. So if anybody has a clue, please do share :slight_smile:

You need to make a new alert template and assign it to that alert rule.
Modify the template code inside the foreach to display the details and text you want. This is covered in the docs.

1 Like