aboutsummaryrefslogtreecommitdiff
path: root/modules/private
diff options
context:
space:
mode:
Diffstat (limited to 'modules/private')
-rw-r--r--modules/private/monitoring/default.nix18
-rw-r--r--modules/private/monitoring/objects_common.nix1
-rw-r--r--modules/private/monitoring/objects_quatresaisons.nix6
3 files changed, 25 insertions, 0 deletions
diff --git a/modules/private/monitoring/default.nix b/modules/private/monitoring/default.nix
index 73e4275..342c7f7 100644
--- a/modules/private/monitoring/default.nix
+++ b/modules/private/monitoring/default.nix
@@ -20,11 +20,28 @@ let
20 url = "https://www.claudiokuenzler.com/monitoring-plugins/check_zpools.sh"; 20 url = "https://www.claudiokuenzler.com/monitoring-plugins/check_zpools.sh";
21 sha256 = "0p9ms9340in80jkds4kfspw62xnzsv5s7ni9m28kxyd0bnzkbzhf"; 21 sha256 = "0p9ms9340in80jkds4kfspw62xnzsv5s7ni9m28kxyd0bnzkbzhf";
22 }; 22 };
23 megacli = pkgs.megacli.overrideAttrs(old: { meta = old.meta // { license = null; }; });
24 megaCliPlugin = pkgs.runCommand "megaCliPlugin" {
25 plugin = pkgs.fetchurl {
26 name = "check_megaraid_sas";
27 url = "https://exchange.nagios.org/components/com_mtree/attachment.php?link_id=6381&cf_id=24";
28 sha256 = "0yf60p4c0hb4q3fng9fc14qc89bqm0f1sijayzygadaqcl44jx4p";
29 };
30 } ''
31 mkdir $out
32 cp $plugin $out/check_megaraid_sas
33 chmod +x $out/check_megaraid_sas
34 patchShebangs $out
35 substituteInPlace $out/check_megaraid_sas --replace /usr/sbin/MegaCli ${megacli}/bin/MegaCli64
36 substituteInPlace $out/check_megaraid_sas --replace 'sudo $megacli' '/run/wrappers/bin/sudo $megacli'
37 sed -i -e "s/use utils qw(%ERRORS);/my %ERRORS = ('OK' => 0, 'WARNING' => 1, 'CRITICAL' => 2, 'UNKNOWN' => 3);/" $out/check_megaraid_sas
38 '';
23 myplugins = pkgs.runCommand "buildplugins" { 39 myplugins = pkgs.runCommand "buildplugins" {
24 buildInputs = [ pkgs.makeWrapper pkgs.perl ]; 40 buildInputs = [ pkgs.makeWrapper pkgs.perl ];
25 } '' 41 } ''
26 mkdir $out 42 mkdir $out
27 cp ${zfsPlugin} $out/check_zpool.sh && chmod +x $out/check_zpool.sh 43 cp ${zfsPlugin} $out/check_zpool.sh && chmod +x $out/check_zpool.sh
44 cp ${megaCliPlugin}/check_megaraid_sas $out/
28 cp ${./plugins}/* $out/ 45 cp ${./plugins}/* $out/
29 patchShebangs $out 46 patchShebangs $out
30 wrapProgram $out/check_command --prefix PATH : ${config.security.wrapperDir} 47 wrapProgram $out/check_command --prefix PATH : ${config.security.wrapperDir}
@@ -226,6 +243,7 @@ in
226 commands = [ 243 commands = [
227 { command = "${pkgs.mdadm}/bin/mdadm --monitor --scan -1"; options = [ "NOPASSWD" ]; } 244 { command = "${pkgs.mdadm}/bin/mdadm --monitor --scan -1"; options = [ "NOPASSWD" ]; }
228 { command = "${pkgs.postfix}/bin/mailq"; options = [ "NOPASSWD" ]; } 245 { command = "${pkgs.postfix}/bin/mailq"; options = [ "NOPASSWD" ]; }
246 { command = "${megacli}/bin/MegaCli64"; options = [ "NOPASSWD" ]; }
229 ]; 247 ];
230 users = [ "naemon" ]; 248 users = [ "naemon" ];
231 runAs = "root"; 249 runAs = "root";
diff --git a/modules/private/monitoring/objects_common.nix b/modules/private/monitoring/objects_common.nix
index df378b5..4b44e56 100644
--- a/modules/private/monitoring/objects_common.nix
+++ b/modules/private/monitoring/objects_common.nix
@@ -136,6 +136,7 @@ in
136 check_command_status = "$USER2$/check_command -c \"$ARG1$\" -s \"$ARG2$\" $ARG3$"; 136 check_command_status = "$USER2$/check_command -c \"$ARG1$\" -s \"$ARG2$\" $ARG3$";
137 check_ntp = "$USER1$/check_ntp_time -t 30 -q -H 0.arch.pool.ntp.org"; 137 check_ntp = "$USER1$/check_ntp_time -t 30 -q -H 0.arch.pool.ntp.org";
138 check_mailq = "$USER1$/check_mailq -s -w 1 -c 2"; 138 check_mailq = "$USER1$/check_mailq -s -w 1 -c 2";
139 check_megaraid = "$USER2$/check_megaraid_sas --sudo";
139 check_mysql_replication = "${sudo} -u mysql $USER2$/check_mysql_replication \"$ARG1$\" \"$ARG2$\""; 140 check_mysql_replication = "${sudo} -u mysql $USER2$/check_mysql_replication \"$ARG1$\" \"$ARG2$\"";
140 check_postgresql_replication = "${sudo} -u postgres $USER2$/check_postgres_replication \"$ARG1$\" \"$ARG2$\" \"$ARG3$\""; 141 check_postgresql_replication = "${sudo} -u postgres $USER2$/check_postgres_replication \"$ARG1$\" \"$ARG2$\" \"$ARG3$\"";
141 check_openldap_replication = "${sudo} -u openldap $USER2$/check_openldap_replication \"$ARG1$\" \"$ARG2$\" \"$ARG3$\" \"$ARG4$\" \"$ARG5$\""; 142 check_openldap_replication = "${sudo} -u openldap $USER2$/check_openldap_replication \"$ARG1$\" \"$ARG2$\" \"$ARG3$\" \"$ARG4$\" \"$ARG5$\"";
diff --git a/modules/private/monitoring/objects_quatresaisons.nix b/modules/private/monitoring/objects_quatresaisons.nix
index 3927ef5..de0ce86 100644
--- a/modules/private/monitoring/objects_quatresaisons.nix
+++ b/modules/private/monitoring/objects_quatresaisons.nix
@@ -12,5 +12,11 @@ let
12in 12in
13{ 13{
14 service = [ 14 service = [
15 {
16 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-resources"; };
17 service_description = "No RAID device is degraded";
18 use = "local-service";
19 check_command = ["check_megaraid"];
20 }
15 ]; 21 ];
16} 22}