I’m trying to configure Netdata to send an email when a monitoring alarm goes off. The nix package does have a configuration option netdata.config in which I can specify options. However, it seems that email configuration happens in a different configuration file health_alarm_notify.conf, which is written in Bash. Am I correct that there is no way to directly modify this file using nix? If not, what is the recommended way of patching the file manually?
Hi!
In order to create an email notification, you would need to firstly create (or use the default) alarms in the health_alarm_notify.conf file, exactly as you mentioned. But, in order to activate an alarming scheme, you have to modify the file alarm-notify.sh, in which you can specify alarming method and conditions.
You can read more about netdata health in the docs !
Oh yes, the email is in alarm-notify.sh. I understand how I would configure this on a traditional linux distribution. But it is not clear to me how to do it in nixos. As far as I can see, the nixpkg for netdata does not support modifying these files. What would your approach be for that?
Thanks for your help!
I had the same problem and used the following config to move it from the nix store to my configuration where I could edit it.
environment.etc."netdata/health_alarm_notify.conf".source = "/etc/nixos/modules/netdata/health_alarm_notify.conf";
Within the health_alarm_notify.conf file, this edit sendmail="/run/wrappers/bin/sendmail" got it to start sending emails. I also made these two changes, though it is less clear how essential they were:
date_format='+%x %X'
EMAIL_THREADING="YES"
Very interesting! I’ll have to take a look at this. Thanks for your post!