Email Notifications Not Showing Data in Body of Email

Email notifications no longer work for me. We did not change the template but now receive emails with the data like the image below.

52%20PM

I am not using any alert templates only alert rules.
Any ideas?

You forgot to update your templates.

Hi I guess I am unsure of how the template relates. I never messed with the templates… so I was unaware if they had anything to do with the alert rules I set up. I did convert the default template because there was the actual code to use. I was unsure on the other templates… such as the port one. I saw LibreNMS had a port utilization example but I am not sure if the old alert template for ports was for utilization, for port up/down, or both. Is it enough to just change the default template?

Take a look here and scroll down to examples https://docs.librenms.org/Alerting/Templates/ it has the port utilization and other examples in new format. Then you must map these templates to your alert rule that you created.

The template in the image above only shows “Ports” not “Port Utilization” but Port Utilization is the only example in the link you sent. Is there a generic “Ports” updated template that anyone has that I could use?

Am I correct in assuming that the alert rules pull from these templates or are they separate?

Ahh miss-read the post, your port template is old format still? Is there not a convert button at the bottom when you go to edit it ? You will need to convert all your templates that are used not just the default template.

My converted ports template was this (i don’t use default ports template so can’t verify):

{{ $alert->title }}\r\n
Severity: {{ $alert->severity }}\r\n
 @if ($alert->state == 0) Time elapsed: {{ $alert->elapsed }} @endif 
Timestamp: {{ $alert->timestamp }}
Unique-ID: {{ $alert->uid }}
Rule:  @if ($alert->name) {{ $alert->name }} @else {{ $alert->rule }} @endif \r\n
 @if ($alert->faults) Faults:\r\n
 @foreach ($alert->faults as $key => $value)\r\n
#{{ $key }}: {{ $value['string'] }}\r\n
Port: {{ $value['ifName'] }}\r\n
Port Name: {{ $value['ifAlias'] }}\r\n
Port Status: {{ $value['message'] }}\r\n
 @endforeach \r\n
 @endif 

After creating the alert rule, you go into alert templates edit -> Attach template to rules: and start typing the alert rule in and it should pop up.

I converted all my templates.

In the past, I never attached any alert template to an alert rule. All my alert templates are as-is from LibreNMS with no rules attached… I never messed with them in the past. In that case, is only the default template being automatically used for all my alert rules?

Also, I received a device up/down alert e-mail that is now working.

Good that its working now,

Yes #https://docs.librenms.org/Alerting/Templates/

default template which is used for any rule that isn’t associated with a template

Ok great. Thanks for your help!