Need help with Alert Template for Apps (OS Updates, ZFS, etc.)

Hey there, I’ve been using LibreNMS for quite some time now but recently started customising the alert templates. I would really like alerts, letting me know how many OS Updates need to be installed.

As of now I have a template that let’s me know wether there are updates or not, but including the number of updates seems impossible to me. Any ideas on this?

Here is my template up until now:

{{ $alert->title }} 
<b>{{ $alert->display }}</b> @if($alert->state != 0) has updates available. @else is up to date. @endif
Timestamp: {{ $alert->timestamp }}

Okay, I seem to have gotten a little further. This Template now includes the Information I want (thanks to ./scripts/test-template.php I was able to find the value), but now telegram throws an error…

Template:

<b>{{ $alert->title }}</b>

<b>{{ $alert->display }}</b> @if($alert->state != 0) has @foreach($alert->faults as $key => $value){{ $value['app_status'] }} @endforeach updates available. @else is up to date. @endif

Timestamp: {{ $alert->timestamp }}

Telegram Error:

Could not issue recovery for rule 'Update available' to transport 'telegram' Error: HTTP Status code 400, Body {"ok":false,"error_code":400,"description":"Bad Request: can't parse entities: Unclosed end tag at byte offset 24"}

Any ideas?

Edit: I was missing > of </b> on the first line. Silly me. The template above works otherwise, altho the -p Telegram flag does not work within the test-template.php

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.