Alert Template sysContact not showing

====================================

Component Version
LibreNMS 22.8.0
DB Schema 2022_07_03_1947_add_app_data (244)
PHP 8.0.22
Python 3.10.5
Database MariaDB 10.5.16-MariaDB-1:10.5.16+maria~focal
RRDTool 1.7.2
SNMP 5.9.3

====================================

[OK] Installed from package; no Composer required
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK]
[OK] Database schema correct
[OK] MySQl and PHP time match
[OK] Active pollers found
[OK] Dispatcher Service is enabled
[OK] Locks are functional
[OK] No python wrapper pollers found
[OK] Redis is functional
[OK] rrd_dir is writable
[OK] rrdtool version ok
[WARN] Non-git install, updates are manual or from package

Hi

A little confused with Alert Templates with one of the outputs:

I am using the variable $alert->sysContact but it is not showing anything on the output.

e.g.

if ($alert->sysContact == ‘’) Contact: Unknown else Contact: {{ $alert->sysContact }} endif

(Had to remove the @ symbols on the if, else and endif

The output is coming out as Contact: Unknown when there is data in that field on the device.

I then check to see if it was a mistake on the if statement so I tried

Contact: {{ $alert->sysContact }}

But that came back as Contact:

I think it may be to do with the sysContact override which I am using on most of my devices as many of them are ping only thus do not inherit a sysContact.

All other parts of my alert template work ok producing all relevant data.

Is there a variable or syntax I am missing?

Thanks in advance.

I would check the device to make sure it has a sysContact.

The device has a sysContact via the use of the override. See example device.

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