# Recommended monitoring tools for NixOS servers?

**URL:** https://discourse.nixos.org/t/recommended-monitoring-tools-for-nixos-servers/14848
**Category:** Help
**Created:** [September 3, 2021, 12:37pm UTC](https://discourse.nixos.org/t/recommended-monitoring-tools-for-nixos-servers/14848 "2021-09-03T12:37:05Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![stianlagstad](https://discourse.nixos.org/user_avatar/discourse.nixos.org/stianlagstad/32/2327_2.png) [@stianlagstad](https://discourse.nixos.org/u/stianlagstad)
#### Post date: [September 3, 2021, 12:37pm UTC](https://discourse.nixos.org/t/recommended-monitoring-tools-for-nixos-servers/14848/1 "2021-09-03T12:37:05Z")

</div>

Does anyone have any recommended monitoring tools used to monitor your NixOS servers? My need extends a tiny bit further than something like [https://uptimerobot.com/](https://uptimerobot.com/) - would be nice to be able to alert on high cpu usage, memory usage, etc.

---

<div class="post-metadata">

### Author: ![azazel75](https://discourse.nixos.org/user_avatar/discourse.nixos.org/azazel75/32/177_2.png) [@azazel75](https://discourse.nixos.org/u/azazel75)
#### Post date: [September 3, 2021, 2:06pm UTC](https://discourse.nixos.org/t/recommended-monitoring-tools-for-nixos-servers/14848/2 "2021-09-03T14:06:14Z")

</div>

NixOS has good support for [Prometheus](https://prometheus.io/docs/prometheus/latest/getting_started/) and I use it on some of my servers. Essentially you install the prometheus and alertmanager on a “check” server and then the [node exporter](https://prometheus.io/docs/guides/node-exporter/) on the servers you need to monitor. It’s not super easy, but it’s powerful.

---

<div class="post-metadata">

### Author: ![peterhoeg](https://discourse.nixos.org/user_avatar/discourse.nixos.org/peterhoeg/32/137_2.png) [@peterhoeg](https://discourse.nixos.org/u/peterhoeg)
#### Post date: [September 3, 2021, 2:07pm UTC](https://discourse.nixos.org/t/recommended-monitoring-tools-for-nixos-servers/14848/3 "2021-09-03T14:07:13Z")

</div>

We use prometheus extensively at $DAY\_JOB and then I use 80% of that to monitor things at home as well (obviously not at the same scale…)

I really like the separation of data capture and alerting as well as visualizing things with grafana. Cannot recommend it strongly enough.

We used sensu before, but this is _so_ much better.

---

<div class="post-metadata">

### Author: ![nixinator](https://discourse.nixos.org/user_avatar/discourse.nixos.org/nixinator/32/3859_2.png) [@nixinator](https://discourse.nixos.org/u/nixinator)
#### Post date: [September 3, 2021, 4:27pm UTC](https://discourse.nixos.org/t/recommended-monitoring-tools-for-nixos-servers/14848/4 "2021-09-03T16:27:46Z")

</div>

i’ve had good success with the zabbix … give it a whirl.

---

<div class="post-metadata">

### Author: ![stianlagstad](https://discourse.nixos.org/user_avatar/discourse.nixos.org/stianlagstad/32/2327_2.png) [@stianlagstad](https://discourse.nixos.org/u/stianlagstad)
#### Post date: [September 3, 2021, 7:52pm UTC](https://discourse.nixos.org/t/recommended-monitoring-tools-for-nixos-servers/14848/5 "2021-09-03T19:52:31Z")

</div>

Thanks for the suggesions! I found [https://christine.website/blog/prometheus-grafana-loki-nixos-2020-11-20](https://christine.website/blog/prometheus-grafana-loki-nixos-2020-11-20) (a great guide), but I’d like a simpler way to access grafana from my own computer. Any suggestions there? I don’t want to expose grafana on the internet. SSH port forwarding or something?

---

<div class="post-metadata">

### Author: ![samuela](https://discourse.nixos.org/user_avatar/discourse.nixos.org/samuela/32/2486_2.png) [@samuela](https://discourse.nixos.org/u/samuela)
#### Post date: [September 3, 2021, 7:58pm UTC](https://discourse.nixos.org/t/recommended-monitoring-tools-for-nixos-servers/14848/6 "2021-09-03T19:58:19Z")

</div>

In my experience Tailscale has been a convenient option for those kinds of scenarios where you don’t want to open up ports to the internet at large.

---

<div class="post-metadata">

### Author: ![TLATER](https://discourse.nixos.org/user_avatar/discourse.nixos.org/tlater/32/4257_2.png) [@TLATER](https://discourse.nixos.org/u/TLATER)
#### Post date: [September 3, 2021, 9:34pm UTC](https://discourse.nixos.org/t/recommended-monitoring-tools-for-nixos-servers/14848/7 "2021-09-03T21:34:01Z")

</div>

There’s also [services.icingaweb2.enable](https://search.nixos.org/options?channel=21.05&show=services.icingaweb2.enable&from=0&size=50&sort=relevance&type=packages&query=icinga) and its forks that see a fair bit of use and have a bunch of options available, though I still need to get around to configuring one of them to try personally.

---

<div class="post-metadata">

### Author: ![ryantm](https://discourse.nixos.org/user_avatar/discourse.nixos.org/ryantm/32/900_2.png) [@ryantm](https://discourse.nixos.org/u/ryantm)
#### Post date: [September 5, 2021, 1:20pm UTC](https://discourse.nixos.org/t/recommended-monitoring-tools-for-nixos-servers/14848/8 "2021-09-05T13:20:12Z")

</div>

I like the minimalism of [monit](https://search.nixos.org/options?channel=21.05&from=0&size=50&sort=relevance&type=packages&query=services.monit).

---

<div class="post-metadata">

### Author: ![nh2](https://discourse.nixos.org/user_avatar/discourse.nixos.org/nh2/32/631_2.png) [@nh2](https://discourse.nixos.org/u/nh2)
#### Post date: [September 5, 2021, 11:15pm UTC](https://discourse.nixos.org/t/recommended-monitoring-tools-for-nixos-servers/14848/9 "2021-09-05T23:15:40Z")

</div>

We use Grafana alerts + Prometheus + Loki and are happy with it so far.

It comes with automatic metrics for CPU, memory, temperature, and so on, so you just need to set your alert thresholds.

---

<div class="post-metadata">

### Author: ![peterhoeg](https://discourse.nixos.org/user_avatar/discourse.nixos.org/peterhoeg/32/137_2.png) [@peterhoeg](https://discourse.nixos.org/u/peterhoeg)
#### Post date: [September 6, 2021, 5:45am UTC](https://discourse.nixos.org/t/recommended-monitoring-tools-for-nixos-servers/14848/10 "2021-09-06T05:45:55Z")

</div>

grafana supports authentication either by itself or through oauth. For work we authenticate against Azure AD. Personally, I just use wireguard and then don’t expose grafana externally.

To add to nh2’s comment about grafana alerts. We looked at that too, but decided against it as Prometheus’s alert manager allows you to do grouping which means getting 1 notification saying 35 instances are down rather than 35 notifications…

---

<div class="post-metadata">

### Author: ![stianlagstad](https://discourse.nixos.org/user_avatar/discourse.nixos.org/stianlagstad/32/2327_2.png) [@stianlagstad](https://discourse.nixos.org/u/stianlagstad)
#### Post date: [September 8, 2021, 9:16am UTC](https://discourse.nixos.org/t/recommended-monitoring-tools-for-nixos-servers/14848/11 "2021-09-08T09:16:46Z")

</div>

Thank you for all the suggestions! I’ve gone with prometheus and grafana. Now I just need to figure out wireguard/tailscale 🙂

---

<div class="post-metadata">

### Author: ![davegallant](https://discourse.nixos.org/user_avatar/discourse.nixos.org/davegallant/32/2610_2.png) [@davegallant](https://discourse.nixos.org/u/davegallant)
#### Post date: [September 10, 2021, 2:12pm UTC](https://discourse.nixos.org/t/recommended-monitoring-tools-for-nixos-servers/14848/12 "2021-09-10T14:12:44Z")

</div>

I’d also suggest [netdata](https://search.nixos.org/packages?channel=unstable&show=netdata&from=0&size=50&sort=relevance&type=packages&query=netdata) for its simple setup.

---

<div class="post-metadata">

### Author: ![Mic92](https://discourse.nixos.org/user_avatar/discourse.nixos.org/mic92/32/5265_2.png) [@Mic92](https://discourse.nixos.org/u/Mic92)
#### Post date: [September 11, 2021, 1:36pm UTC](https://discourse.nixos.org/t/recommended-monitoring-tools-for-nixos-servers/14848/13 "2021-09-11T13:36:47Z")

</div>

Prometheus + telegraf is my current favorite. Telegraf can handle tons of things that you would usually set up dedicated exporters for in one binary: [https://github.com/Mic92/dotfiles/blob/c3449c4f7562857c54e99a5bd4bb3d14219ac68b/nixos/modules/telegraf.nix](https://github.com/Mic92/dotfiles/blob/c3449c4f7562857c54e99a5bd4bb3d14219ac68b/nixos/modules/telegraf.nix)  
It can even do blackbox exporter like functionality: [https://github.com/Mic92/dotfiles/blob/c3449c4f7562857c54e99a5bd4bb3d14219ac68b/nixos/modules/telegraf.nix](https://github.com/Mic92/dotfiles/blob/c3449c4f7562857c54e99a5bd4bb3d14219ac68b/nixos/modules/telegraf.nix)  
Than prometheus query language is very generic so you don’t have to repeat yourself setting up alerts: [https://github.com/Mic92/dotfiles/blob/c3449c4f7562857c54e99a5bd4bb3d14219ac68b/nixos/modules/telegraf.nix](https://github.com/Mic92/dotfiles/blob/c3449c4f7562857c54e99a5bd4bb3d14219ac68b/nixos/modules/telegraf.nix)

I tested netdata, zabbix, influxdb, grafana and icinga2 before, I sticked with prometheus.

---

<div class="post-metadata">

### Author: ![Mic92](https://discourse.nixos.org/user_avatar/discourse.nixos.org/mic92/32/5265_2.png) [@Mic92](https://discourse.nixos.org/u/Mic92)
#### Post date: [July 6, 2023, 9:19am UTC](https://discourse.nixos.org/t/recommended-monitoring-tools-for-nixos-servers/14848/14 "2023-07-06T09:19:57Z")

</div>

my generic telegraf setup is now also available in srvos: [https://github.com/numtide/srvos/blob/bf8ce44e0d1a380565c51bd6a707a75ac21c1a9a/nixos/mixins/telegraf.nix](https://github.com/numtide/srvos/blob/bf8ce44e0d1a380565c51bd6a707a75ac21c1a9a/nixos/mixins/telegraf.nix)

---

<div class="post-metadata">

### Author: ![dschrempf](https://discourse.nixos.org/user_avatar/discourse.nixos.org/dschrempf/32/3651_2.png) [@dschrempf](https://discourse.nixos.org/u/dschrempf)
#### Post date: [February 14, 2024, 9:07pm UTC](https://discourse.nixos.org/t/recommended-monitoring-tools-for-nixos-servers/14848/15 "2024-02-14T21:07:09Z")

</div>

FYI: This thread seduced me into trying Monit, thanks for the hint! After some initial issues, it was a real pleasure to set up to monitor my laptop and home server. If you are interested, I posted a [summary of my setup](https://dschrempf.github.io/linux/2024-02-14-monitoring-a-home-server/). Cheers!
