Alert Transport Template variables not working - showing as literals

Hi I am running a freshly installed LibreNMS on Ubuntu 20.04. Alerting works fine with the built in email alerting. When I use hte Alert Transport Template for using a web API for alerting it seems the template variables are not interpreted. Am I doing something wrong or is this a bug?

In the screenshot below I have scrolled down to the line that gets to be the message. There is also a key and a phonenumber as options, but there is no need to share that with the world :slight_smile:

The sms that I receive
Screenshot 2021-11-11 at 22.40.26

Version 21.10.0-103-g905918f2e - Wed Nov 10 2021 23:39:37 GMT+0100
Database Schema 2021_25_01_0129_isis_adjacencies_nullable (224)
Web Server Apache/2.4.41 (Ubuntu)
PHP 7.4.3
Python 3.8.10
MySQL 10.3.31-MariaDB-0ubuntu0.20.04.1
Laravel 8.65.0
RRDtool 1.7.2

Please let me know if you need any more information.

Thank you!

Are you sure that Alert Template variables should work in Alert Transports ? I was under the impression they are only for Alert Templates, which is where you format what your alert subject and body looks like.

Although I don’t use the API transport type, (only Email and Pushover) I would assume that the Alert Transport is only to configure the delivery of messages via the API not to configure how the messages appear.

Formatting of the messages and delivering information by way of Alert Template variables is done using the Alert Templates that are attached to the Alert rules.

Alert Rules → What events trigger alerts, in other words alert criteria.
Alert Templates → How alert data is presented and formatted and which data is sent in the alert (variables etc) These are attached to specific Alert Rules.
Alert Transports → How to deliver the alert, eg email server, push notification, API etc. These are also attached to specific Alert Rules.

Ah, I should remove the Alert-> prefix, I did not read the documentation carefully enough.

" The API-Option fields can be directly built from the variables defined in Template-Syntax but without the ‘alert->’ prefix."

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