};
};
};
- 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"; };
};
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;
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
# $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 = {
+++ /dev/null
-{ ... }:
-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/";
- })
- ];
-}
};
contactgroup = {
telio-tortay = { alias = "Telio Tortay"; members = "immae"; };
- tiboqorl = { alias = "Tiboqorl"; members = "immae"; };
+ tiboqorl = { alias = "Tiboqorl"; members = ""; };
};
}
+++ /dev/null
-#!/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
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;
};
security.acme.certs."${name}" = {
extraDomains."status.immae.eu" = null;
- extraDomains."status.eban.bzh" = null;
user = config.services.nginx.user;
group = config.services.nginx.group;
};