Fixes error when testing syslog-based recipients

This commit is contained in:
Luca Deri 2020-08-04 10:24:29 +02:00
parent 2a80a7e57f
commit 9f5dd2022a

View file

@ -2162,7 +2162,7 @@ function alert_utils.formatAlertNotification(notif, options)
local msg = string.format("[%s][%d][%s]%s[%s]",
formatEpoch(notif.alert_tstamp or 0),
notif.ifid,
notif.ifid or -1, -- Use -1 to avoid issues with interfaceless use cases (for instance notification test)
getInterfaceName(notif.ifid),
ternary(options.show_severity == false, "", "[" .. alert_consts.alertSeverityLabel(notif.alert_severity, options.nohtml) .. "]"),
alert_consts.alertTypeLabel(notif.alert_type, options.nohtml))