Email Notification - Client Specific Naming in Subject / Body

Hello,

After considerable digging around I am not finding where I can make overrides to the alarm notifications that would make it clear which server this is coming from.

We have 4 client servers and are not connected to the cloud service. We are getting notifications however since all 4 servers have a hostname of ‘servermatter’ we can’t tell which one the email is coming from.

We have learned and tested if we run the command:
/usr/libexec/netdata/plugins.d/alarm-notify.sh sysadmin MYDOMAIN.COM 1 1 1 1661824572 test_alarm test.chart test.family WARNING CLEAR 100 90 /usr/libexec/netdata/plugins.d/alarm-notify.sh 1 1 units ‘ServerMatter Alarm - This Is Only A Test Verifying Notifications Work’ ‘PASSED’ ‘old value’ ‘evaluated expression’ ‘expression variable values’ 0 0

It succeeds in accomplishing our goal:
2022-12-18 21:38:59: alarm-notify.sh: INFO: sent email notification for: MYDOMAIN.COM test.chart.test_alarm is WARNING to ‘admin@servermatter.com’

However we have not been able to find where to insert this type of customization for all our ‘real’ alarms.

What sayeth the group?

Thanks.

Jay
CompuMatter

Using version 1.37 of Netdata.

Hi @servermatter !

Can you try the following if it works for you?

In each node’s /etc/netdata/netdata.conf, can you edit (and uncomment) the entry registry hostname and add there a custom hostname for each?

It should then use that for notifications on the subject in place of Critical, disk_space_usage = 100%, on XXXXXXX. The same string should appear in place of now servermatter under the disk_space_usage.

Hello and thanks for the response. Very much appreciated.

I would not want to completely replace the entire line 'Critical, disk_space_usage = 100%, on XXXXXXX` but only the XXXXXXX portion of it. Is that what you mean?

I am testing it now.

OK, follow up. I interpreted hostname as using my own desired hostname. However you started me in the right direction. I found this page Registry | Learn Netdata and ended up getting the following to work as perfectly as I’d hoped

[registry]
    registry hostname = mydesiredidhere

Thank you. Impressive response time which is rare in todays world.

1 Like

You’re welcome! Hope you enjoy Netdata!