# Netdata email alarm configuration

**URL:** https://discourse.nixos.org/t/netdata-email-alarm-configuration/8636
**Category:** Help
**Created:** [August 19, 2020, 12:23am UTC](https://discourse.nixos.org/t/netdata-email-alarm-configuration/8636 "2020-08-19T00:23:09Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![LasseBlaauwbroek](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/l/ce73a5/32.png) [@LasseBlaauwbroek](https://discourse.nixos.org/u/LasseBlaauwbroek)
#### Post date: [August 19, 2020, 12:23am UTC](https://discourse.nixos.org/t/netdata-email-alarm-configuration/8636/1 "2020-08-19T00:23:09Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![OdysLam](https://discourse.nixos.org/user_avatar/discourse.nixos.org/odyslam/32/2878_2.png) [@OdysLam](https://discourse.nixos.org/u/OdysLam)
#### Post date: [August 19, 2020, 2:16pm UTC](https://discourse.nixos.org/t/netdata-email-alarm-configuration/8636/2 "2020-08-19T14:16:53Z")

</div>

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](https://learn.netdata.cloud/docs/agent/health/quickstart) !

---

<div class="post-metadata">

### Author: ![LasseBlaauwbroek](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/l/ce73a5/32.png) [@LasseBlaauwbroek](https://discourse.nixos.org/u/LasseBlaauwbroek)
#### Post date: [August 19, 2020, 3:41pm UTC](https://discourse.nixos.org/t/netdata-email-alarm-configuration/8636/3 "2020-08-19T15:41:24Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![cleve](https://discourse.nixos.org/user_avatar/discourse.nixos.org/cleve/32/2612_2.png) [@cleve](https://discourse.nixos.org/u/cleve)
#### Post date: [November 26, 2020, 7:21pm UTC](https://discourse.nixos.org/t/netdata-email-alarm-configuration/8636/4 "2020-11-26T19:21:49Z")

</div>

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.

```auto
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:

```auto
date_format='+%x %X'
EMAIL_THREADING="YES"

```

---

<div class="post-metadata">

### Author: ![LasseBlaauwbroek](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/l/ce73a5/32.png) [@LasseBlaauwbroek](https://discourse.nixos.org/u/LasseBlaauwbroek)
#### Post date: [November 27, 2020, 4:34am UTC](https://discourse.nixos.org/t/netdata-email-alarm-configuration/8636/5 "2020-11-27T04:34:20Z")

</div>

Very interesting! I’ll have to take a look at this. Thanks for your post!
