]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Update eban domain
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Thu, 23 Dec 2021 12:58:43 +0000 (13:58 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 9 Apr 2023 15:16:13 +0000 (17:16 +0200)
modules/private/environment.nix
modules/private/monitoring/default.nix
modules/private/monitoring/myplugins.nix
modules/private/monitoring/objects_eban.nix [deleted file]
modules/private/monitoring/objects_monitoring-1.nix
modules/private/monitoring/plugins/notify_eban_url [deleted file]
modules/private/monitoring/status.nix

index 14fbd621ff6cc308c5b787fdd3ffc7568cb4c9c1..e52665f818adcac79ce2cde1826109f6a5ce5158 100644 (file)
@@ -575,15 +575,6 @@ in
               };
             };
           };
-          eban = mkOption {
-            description = "Eban credentials for webhook";
-            type = submodule {
-              options = {
-                user = mkOption { type = str; description = "User"; };
-                password = mkOption { type = str; description = "Password"; };
-              };
-            };
-          };
           nrdp_tokens = mkOption { type = listOf str; description = "Tokens allowed to push status update"; };
           slack_url = mkOption { type = str; description = "Slack webhook url to push status update"; };
           slack_channel = mkOption { type = str; description = "Slack channel to push status update"; };
index 0783c2ff33be9ee5fcfe1201c6cc8fd0a2af307c..2e0773a2e05aa0900deedb717eebbfcfea77a33e 100644 (file)
@@ -91,7 +91,7 @@ let
     };
   otherObjects = map
     (n: (pkgs.callPackage (./. + "/objects_" + n + ".nix") { inherit emailCheck; }))
-    [ "ulminfo-fr" "phare" "eban" ];
+    [ "ulminfo-fr" "phare" ];
   masterObjects = pkgs.callPackage ./objects_master.nix { inherit config; };
   commonObjects = pkgs.callPackage ./objects_common.nix ({
     master = cfg.master;
index e59ddc402f1793365feb14e504f3b8c804f4d6f0..864fa99b1b297ff8c0f93662b2b0de4ea80aecd2 100644 (file)
@@ -23,8 +23,6 @@ in
     resources = {
       USER206 = config.myEnv.monitoring.slack_channel;
       USER207 = config.myEnv.monitoring.slack_url;
-      USER210 = config.myEnv.monitoring.eban.user;
-      USER211 = config.myEnv.monitoring.eban.password;
     };
     commands = {
       # $OVE is to force naemon to run via shell instead of execve which fails here
@@ -32,21 +30,16 @@ in
       # $OVE is to force naemon to run via shell instead of execve which fails here
       notify-service-by-email = "ADMINEMAIL=\"$ADMINEMAIL$\" SERVICENOTIFICATIONID=\"$SERVICENOTIFICATIONID$\" SERVICEDESC=\"$SERVICEDESC$\" SERVICESTATE=\"$SERVICESTATE$\" SERVICEOUTPUT=\"$SERVICEOUTPUT$\" $USER2$/notify_by_email service \"$NOTIFICATIONTYPE$\" \"$HOSTALIAS$\" \"$LONGDATETIME$\" \"$CONTACTEMAIL$\" $OVE";
       notify-by-slack = "HOST=\"$HOSTALIAS$\" SERVICESTATE=\"$SERVICESTATE$\" SERVICEDESC=\"$SERVICEDESC$\" SERVICEOUTPUT=\"$SERVICEOUTPUT$\" $USER2$/notify_by_slack \"$ARG1$\" \"$ARG2$\"";
-      notify-host-eban-url = "STATUS_NAME=\"Server\" USER=\"$USER210$\" PASSWORD=\"$USER211$\" HOSTSTATE=\"$HOSTSTATE$\" $USER2$/notify_eban_url";
-      notify-service-eban-url = "STATUS_NAME=\"$_SERVICEWEBSTATUS_NAME$\" USER=\"$USER210$\" PASSWORD=\"$USER211$\" SERVICESTATE=\"$SERVICESTATE$\" $USER2$/notify_eban_url";
     };
     chunk = ''
-      cp ${./plugins}/{notify_by_email,notify_by_slack,notify_eban_url} $out
-      patchShebangs $out/{notify_by_email,notify_by_slack,notify_eban_url}
+      cp ${./plugins}/{notify_by_email,notify_by_slack} $out
+      patchShebangs $out/{notify_by_email,notify_by_slack}
       wrapProgram $out/notify_by_email --prefix PATH : ${lib.makeBinPath [
         pkgs.mailutils
       ]}
       wrapProgram $out/notify_by_slack --prefix PATH : ${lib.makeBinPath [
         pkgs.curl pkgs.jq
       ]}
-      wrapProgram $out/notify_eban_url --prefix PATH : ${lib.makeBinPath [
-        pkgs.curl
-      ]}
     '';
   };
   bandwidth = {
diff --git a/modules/private/monitoring/objects_eban.nix b/modules/private/monitoring/objects_eban.nix
deleted file mode 100644 (file)
index df54f6a..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-{ ... }:
-let
-  serviceTemplate = rest: {
-    host_name = "eban.bzh";
-    use = "external-web-service";
-    contacts = "eban";
-    contact_groups = "null";
-    check_interval = "15";
-
-    servicegroups = "webstatus-resources";
-    _webstatus_namespace = "eban";
-  } // rest;
-in
-{
-  activatedPlugins = [ "http" ];
-  contact = {
-    eban = {
-      use = "generic-contact";
-      host_notification_commands = "notify-host-eban-url";
-      service_notification_commands = "notify-service-eban-url";
-    };
-  };
-  host = {
-    "eban.bzh" = {
-      alias = "eban.bzh";
-      address = "eban.bzh";
-      use = "linux-server";
-      hostgroups = "webstatus-hosts";
-      contacts = "eban";
-      contact_groups = "null";
-      _webstatus_name = "Eban";
-      _webstatus_vhost = "status.eban.bzh";
-      _webstatus_namespace = "eban";
-    };
-  };
-  service = [
-    (serviceTemplate {
-      service_description = "Eban website is up and running";
-      check_command = ["check_https" "eban.bzh" "/" "<title>"];
-      _webstatus_name = "Main Website";
-      _webstatus_url = "https://eban.bzh/";
-    })
-    (serviceTemplate {
-      service_description = "Eban blog is up and running";
-      check_command = ["check_https" "blog.eban.bzh" "/" "<title>"];
-      _webstatus_name = "Blog";
-      _webstatus_url = "https://blog.eban.bzh/";
-    })
-    (serviceTemplate {
-      service_description = "Eban gitea is up and running";
-      check_command = ["check_https" "git.eban.bzh" "/" "<title>"];
-      _webstatus_name = "Git";
-      _webstatus_url = "https://git.eban.bzh/";
-    })
-    (serviceTemplate {
-      service_description = "I Learned website is up and running";
-      check_command = [ "check_https" "ilearned.eu.org" "/" "<title" ];
-
-      _webstatus_name = "I Learned website";
-      _webstatus_url = "https://ilearned.eu.org/";
-    })
-    (serviceTemplate {
-      service_description = "I Learned gitea is up and running";
-      check_command = [ "check_https" "git.ilearned.eu.org" "/" "<title" ];
-
-      _webstatus_name = "I Learned Git";
-      _webstatus_url = "https://git.ilearned.eu.org/";
-    })
-  ];
-}
index 563be167657b63d6ceadadb2f09baf8e21da6923..73431f5a927f2fccde9af506e3412aca546739e0 100644 (file)
   };
   contactgroup = {
     telio-tortay = { alias = "Telio Tortay"; members = "immae"; };
-    tiboqorl = { alias = "Tiboqorl"; members = "immae"; };
+    tiboqorl = { alias = "Tiboqorl"; members = ""; };
   };
 }
diff --git a/modules/private/monitoring/plugins/notify_eban_url b/modules/private/monitoring/plugins/notify_eban_url
deleted file mode 100755 (executable)
index 107b5de..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/env bash
-
-if [ "$SERVICESTATE" = "CRITICAL" -o "$SERVICESTATE" = "UNKNOWN" -o "$HOSTSTATE" = "DOWN" -o "$HOSTSTATE" = "UNREACHABLE" ]; then
-  MESSAGE="$STATUS_NAME seems down!"
-  curl -X GET -G --data-urlencode "user=$USER" --data-urlencode "pass=$PASSWORD" --data-urlencode "msg=$MESSAGE" https://smsapi.free-mobile.fr/sendmsg
-fi
index ab0290c3909fc2eed700287906b5c6decbd4e6e3..420124bf2880542979927b26562d4f8592ccb4d0 100644 (file)
       upstreams."netdata".extraConfig = ''
         keepalive 64;
         '';
-      virtualHosts."status.eban.bzh" = {
-        acmeRoot = config.myServices.certificates.webroot;
-        useACMEHost = name;
-        forceSSL = true;
-        locations."/".proxyPass = "http://unix:/run/naemon-status/socket.sock:/";
-      };
       virtualHosts."status.immae.eu" = {
         acmeRoot = config.myServices.certificates.webroot;
         useACMEHost = name;
@@ -63,7 +57,6 @@
     };
     security.acme.certs."${name}" = {
       extraDomains."status.immae.eu" = null;
-      extraDomains."status.eban.bzh" = null;
       user = config.services.nginx.user;
       group = config.services.nginx.group;
     };