X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fmonitoring%2Fmyplugins.nix;h=864fa99b1b297ff8c0f93662b2b0de4ea80aecd2;hb=bd0cb07b13aecd16a0782492655843a1b699611d;hp=8c77ee77d3618ac8f88f076ffb9394116aa76b5a;hpb=acab8301f6a0a76d97b36d009a60d4172bf62981;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/monitoring/myplugins.nix b/modules/private/monitoring/myplugins.nix index 8c77ee7..864fa99 100644 --- a/modules/private/monitoring/myplugins.nix +++ b/modules/private/monitoring/myplugins.nix @@ -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 = { @@ -310,6 +303,7 @@ in postgresql = { commands = { check_postgresql_replication = "${sudo} -u postgres $USER2$/check_postgres_replication \"$ARG1$\" \"$ARG2$\" \"$ARG3$\""; + check_postgresql_database_count = "$USER2$/check_postgres_database_count \"$ARG1$\" \"$ARG2$\" \"$ARG3$\""; }; chunk = let postgresqlBinary = if config.myServices.databasesReplication.postgresql.enable @@ -323,6 +317,11 @@ in wrapProgram $out/check_postgres_replication --prefix PATH : ${lib.makeBinPath [ postgresqlBinary ]} + cp ${./plugins}/check_postgres_database_count $out/ + patchShebangs $out/check_postgres_database_count + wrapProgram $out/check_postgres_database_count --prefix PATH : ${lib.makeBinPath [ + postgresqlBinary + ]} ''; sudo = myplugins: { @@ -359,6 +358,7 @@ in zfs = { commands = { check_zfs = "$USER2$/check_zpool.sh -p ALL -w 80 -c 90"; + check_zfs_snapshot = "$USER2$/check_zfs_snapshot -d $ARG1$ -c 18000 -w 14400"; }; chunk = let zfsPlugin = pkgs.fetchurl { @@ -372,6 +372,11 @@ in wrapProgram $out/check_zpool.sh --prefix PATH : ${lib.makeBinPath [ pkgs.which pkgs.zfs pkgs.gawk ]} + cp ${./plugins}/check_zfs_snapshot $out + patchShebangs $out/check_zfs_snapshot + wrapProgram $out/check_zfs_snapshot --prefix PATH : ${lib.makeBinPath [ + pkgs.zfs pkgs.coreutils pkgs.gawk pkgs.gnugrep + ]} ''; }; }