summary refs log tree commit diff
path: root/nixos/modules/services/monitoring/kapacitor.nix
diff options
context:
space:
mode:
authorSander van der Burg <svanderburg@gmail.com>2018-11-08 22:34:23 +0100
committerSander van der Burg <svanderburg@gmail.com>2018-11-08 22:34:23 +0100
commit530b4bcadd3228a82588911e248f7cffec74c0cc (patch)
tree4f86fd790586c9c597a0e9c70e7c9268eadf3853 /nixos/modules/services/monitoring/kapacitor.nix
parent1ac07c82e18d63d9cbb246b88807cab47f37a0d3 (diff)
downloadnixpkgs-530b4bcadd3228a82588911e248f7cffec74c0cc.tar
nixpkgs-530b4bcadd3228a82588911e248f7cffec74c0cc.tar.gz
nixpkgs-530b4bcadd3228a82588911e248f7cffec74c0cc.tar.bz2
nixpkgs-530b4bcadd3228a82588911e248f7cffec74c0cc.tar.lz
nixpkgs-530b4bcadd3228a82588911e248f7cffec74c0cc.tar.xz
nixpkgs-530b4bcadd3228a82588911e248f7cffec74c0cc.tar.zst
nixpkgs-530b4bcadd3228a82588911e248f7cffec74c0cc.zip
nixos/alerta: create new module + add kapacitor integration
Diffstat (limited to 'nixos/modules/services/monitoring/kapacitor.nix')
-rw-r--r--nixos/modules/services/monitoring/kapacitor.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/nixos/modules/services/monitoring/kapacitor.nix b/nixos/modules/services/monitoring/kapacitor.nix
index 1de0a8d5af2..a4bdfa8f805 100644
--- a/nixos/modules/services/monitoring/kapacitor.nix
+++ b/nixos/modules/services/monitoring/kapacitor.nix
@@ -42,6 +42,15 @@ let
           password = "${cfg.defaultDatabase.password}"
       ''}
 
+      ${optionalString (cfg.alerta.enable) ''
+        [alerta]
+          enabled = true
+          url = "${cfg.alerta.url}"
+          token = "${cfg.alerta.token}"
+          environment = "${cfg.alerta.environment}"
+          origin = "${cfg.alerta.origin}"
+      ''}
+
       ${cfg.extraConfig}
     '';
   };
@@ -120,6 +129,35 @@ in
         type = types.string;
       };
     };
+
+    alerta = {
+      enable = mkEnableOption "kapacitor alerta integration";
+
+      url = mkOption {
+        description = "The URL to the Alerta REST API";
+        default = "http://localhost:5000";
+        example = "http://localhost:5000";
+        type = types.string;
+      };
+
+      token = mkOption {
+        description = "Default Alerta authentication token";
+        type = types.str;
+        default = "";
+      };
+
+      environment = mkOption {
+        description = "Default Alerta environment";
+        type = types.str;
+        default = "Production";
+      };
+
+      origin = mkOption {
+        description = "Default origin of alert";
+        type = types.str;
+        default = "kapacitor";
+      };
+    };
   };
 
   config = mkIf cfg.enable {