summaryrefslogtreecommitdiff
path: root/flora/services/monit.nix
diff options
context:
space:
mode:
authorstuebinm2024-02-29 16:48:59 +0100
committerstuebinm2024-02-29 16:48:59 +0100
commitffa6d5eb82c3f71cfaf60c98dfc3d82276497ac5 (patch)
treea52b879ca2ea93578af3e7ada6e99397160ac95c /flora/services/monit.nix
parent86ced9c8aa3afef3d6cefb38328ed03f38bdfbf0 (diff)
flora: monit via ntfy sh
so it turns out ntfy can run a little smtp server, which monit can send its alerts to, resulting in a halfway okayish monitoring setup. It doesn't even require mucking about with `sendmail'! Downside: this is still monit. Upside: from what I've heard, the other monitoring tools don't actually seem to be all that much better? Now I only have to come up with reasonable checks for the stuff I want to actually keep an eye on …
Diffstat (limited to '')
-rw-r--r--flora/services/monit.nix32
1 files changed, 32 insertions, 0 deletions
diff --git a/flora/services/monit.nix b/flora/services/monit.nix
new file mode 100644
index 0000000..c8f7b3f
--- /dev/null
+++ b/flora/services/monit.nix
@@ -0,0 +1,32 @@
+{ config, lib, pkgs, ... }:
+
+{
+ # includes mail address, which includes ntfy token
+ sops.secrets."monit/mail" = {};
+
+ services.monit = {
+ enable = true;
+
+ config = ''
+ include /run/secrets/monit/mail
+
+ set daemon 120 with start delay 60
+ set mailserver
+ localhost
+ port 2525
+
+ set httpd port 2812 and use address localhost
+ allow localhost
+ allow admin:obwjoawijerfoijsiwfj29jf2f2jd
+
+ check filesystem root with path /
+ if space usage > 80% then alert
+ if inode usage > 80% then alert
+
+ check host stuebinm.eu with address stuebinm.eu
+ if failed
+ port 443 protocol https
+ then alert
+ '';
+ };
+}