Email Alert Hostname

Is there anyway to modify the email alert to send the hostname of the devices along with the IP address. Right now it just has
Alert for Device “ip address” - Anyway to have hostname and IP address displayed?

How did you add your devices? By IP address or DNS name?

By ip address. We have a lot of devices to add by DNS name

Ok if you added the device by IP by it will only show the IP address in the Alert.

The devices you added by IP, do they have DNS records? If they do Libre NMS should be able to resolve them.

No they do not have a DNS record for network equipment.

You can create your own template and use %sysName in it to show that.

Is there a how to on that, or where is the existing file located for the template. Can I just modify that file?

http://docs.librenms.org/Extensions/Alerting/#templates

Thanks for all the help. I was able to get the alerts working properly. Anyway to get a URL in the body of the text to link to the specific device page? ex: http://libaddress/device/device=604/ ??

Also maybe a graph of the port affected or tempeature affected

Conditional formatting example, will display a link to the host in email or just the hostname in any other transport:

{if %transport == mail}%hostname{else}%hostname{/if}
Note the use of double-quotes. Single quotes (’) in templates will be escaped (replaced with ') in the output and should therefore be avoided.

http://docs.librenms.org/Extensions/Alerting/#templates

Sweet Worked great! I must have missed that in the doc. Sorry.
Anything about attaching the graph for instance Temp High, or Port utilization graph?

You could just use regular HTML (for email at least). I have the following in my device alert template:

<img src="https://monitoring.$YOURDOMAIN/graph.php?width=459&height=213&lazy_w=552&from=end-24h&device=%value.device_id&type=device_bits&legend=yes">

Note: You have to allow anonymous external graph access for this to display in your email client.

Yeah im looking for more of an attachment of the graph. I played around with Observium before deciding on LibreNMS and one of the features they had was the graph attached in the body of the message.

We don’t support that at present

1 Like