},
"locked": {
"lastModified": 1,
- "narHash": "sha256-N8FlN9eUGGmz7MevjaGC7Y07AEebJGRzcESmOW87/0Q=",
+ "narHash": "sha256-W4TIMgSVOiYTGt6hXrMNVxrJ9QZaQrL+awvGLk2UXjU=",
"path": "../flakes",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "../../flakes/private/monitoring",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "../../flakes/private/monitoring",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "../../flakes/private/monitoring",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "../../flakes/private/monitoring",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-B2JdIp5q/8/LurN4lXB17C1+mpEKeqPzObmNOObO5rQ=",
+ "narHash": "sha256-KL5aC6l/mM+ucHadjCtlSY6iBZ9/VKRf2Rgw2tjwfqo=",
"path": "../systems/backup-2",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-dWAbGxB91utxwTlxsJZdp2OSaIAo8y5LXjdTCFMRn+4=",
+ "narHash": "sha256-VliQ62boc8jNgPCBX6JjVS/pA6YoikZVkvE1xxHAITk=",
"path": "../systems/dilion",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-OvT4dJGxdFBUgwjTu6FzejI/euWYXWsX1vD952B8934=",
+ "narHash": "sha256-YVJi4KPT8rsGNzZshYfUyz9l27QGAEsb8Iyu3O0/bMA=",
"path": "../systems/eldiron",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-6hqQjoy1lyIJziqe0AJ62aq62soi5D14NKOzNEY3SsQ=",
+ "narHash": "sha256-HiDwzScPHp084MwtWET+17WbrWf3zs9qJzv/EqNaSqM=",
"path": "../systems/monitoring-1",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-yBuAfW59X0e840QBFtQrefG3T/IQIQSXiZ4WU2/+gBI=",
+ "narHash": "sha256-YWEuXALLICHE+WsMtMuiCm6b2IRQyJrFpfMgH6ZLD0A=",
"path": "../systems/quatresaisons",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "../../flakes/private/monitoring",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "./private/monitoring",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-N8FlN9eUGGmz7MevjaGC7Y07AEebJGRzcESmOW87/0Q=",
+ "narHash": "sha256-W4TIMgSVOiYTGt6hXrMNVxrJ9QZaQrL+awvGLk2UXjU=",
"path": "./flakes",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "../../flakes/private/monitoring",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "../../flakes/private/monitoring",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "../../flakes/private/monitoring",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "../../flakes/private/monitoring",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-B2JdIp5q/8/LurN4lXB17C1+mpEKeqPzObmNOObO5rQ=",
+ "narHash": "sha256-KL5aC6l/mM+ucHadjCtlSY6iBZ9/VKRf2Rgw2tjwfqo=",
"path": "../systems/backup-2",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-dWAbGxB91utxwTlxsJZdp2OSaIAo8y5LXjdTCFMRn+4=",
+ "narHash": "sha256-VliQ62boc8jNgPCBX6JjVS/pA6YoikZVkvE1xxHAITk=",
"path": "../systems/dilion",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-OvT4dJGxdFBUgwjTu6FzejI/euWYXWsX1vD952B8934=",
+ "narHash": "sha256-YVJi4KPT8rsGNzZshYfUyz9l27QGAEsb8Iyu3O0/bMA=",
"path": "../systems/eldiron",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-6hqQjoy1lyIJziqe0AJ62aq62soi5D14NKOzNEY3SsQ=",
+ "narHash": "sha256-HiDwzScPHp084MwtWET+17WbrWf3zs9qJzv/EqNaSqM=",
"path": "../systems/monitoring-1",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-yBuAfW59X0e840QBFtQrefG3T/IQIQSXiZ4WU2/+gBI=",
+ "narHash": "sha256-YWEuXALLICHE+WsMtMuiCm6b2IRQyJrFpfMgH6ZLD0A=",
"path": "../systems/quatresaisons",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "../../flakes/private/monitoring",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "./private/monitoring",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "../../flakes/private/monitoring",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "../../flakes/private/monitoring",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "../../flakes/private/monitoring",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "../../flakes/private/monitoring",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-B2JdIp5q/8/LurN4lXB17C1+mpEKeqPzObmNOObO5rQ=",
+ "narHash": "sha256-KL5aC6l/mM+ucHadjCtlSY6iBZ9/VKRf2Rgw2tjwfqo=",
"path": "../systems/backup-2",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-dWAbGxB91utxwTlxsJZdp2OSaIAo8y5LXjdTCFMRn+4=",
+ "narHash": "sha256-VliQ62boc8jNgPCBX6JjVS/pA6YoikZVkvE1xxHAITk=",
"path": "../systems/dilion",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-OvT4dJGxdFBUgwjTu6FzejI/euWYXWsX1vD952B8934=",
+ "narHash": "sha256-YVJi4KPT8rsGNzZshYfUyz9l27QGAEsb8Iyu3O0/bMA=",
"path": "../systems/eldiron",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-6hqQjoy1lyIJziqe0AJ62aq62soi5D14NKOzNEY3SsQ=",
+ "narHash": "sha256-HiDwzScPHp084MwtWET+17WbrWf3zs9qJzv/EqNaSqM=",
"path": "../systems/monitoring-1",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-yBuAfW59X0e840QBFtQrefG3T/IQIQSXiZ4WU2/+gBI=",
+ "narHash": "sha256-YWEuXALLICHE+WsMtMuiCm6b2IRQyJrFpfMgH6ZLD0A=",
"path": "../systems/quatresaisons",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "../../flakes/private/monitoring",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "./private/monitoring",
"type": "path"
},
]}
'';
};
+ smartctl = {
+ commands = {
+ check_smartctl = "$USER2$/check_smartctl -i auto -d $ARG1$";
+ };
+ chunk = let
+ smartPlugin = pkgs.fetchurl {
+ url = "https://www.claudiokuenzler.com/monitoring-plugins/check_smart.pl";
+ sha256 = "sha256-gxGkzyycUl+I3WziKhOnZSoQjpqbPqjbunfUQxmeb7w=";
+ };
+ in ''
+ cp ${smartPlugin} $out/check_smartctl
+ chmod +x $out/check_smartctl
+ patchShebangs $out
+ substituteInPlace $out/check_smartctl --replace "/usr/bin /bin /usr/sbin /sbin /usr/local/bin /usr/local/sbin" "${pkgs.smartmontools}/bin"
+ substituteInPlace $out/check_smartctl --replace "sudo" "${sudo}"
+ '';
+
+ sudo = _: {
+ commands = [
+ { command = "${pkgs.smartmontools}/bin/smartctl *"; options = [ "NOPASSWD" ]; }
+ ];
+ runAs = "root";
+ };
+ };
mysql = {
commands = {
check_mysql_replication = "${sudo} -u mysql $USER2$/check_mysql_replication \"$ARG1$\" \"$ARG2$\"";
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "../../flakes/private/monitoring",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "../../flakes/private/monitoring",
"type": "path"
},
};
in
{
- config.myServices.monitoring.activatedPlugins = [ "memory" "command" "bandwidth" "mdadm" "zfs" "notify-secondary"];
+ config.myServices.monitoring.activatedPlugins = [ "memory" "command" "bandwidth" "mdadm" "zfs" "notify-secondary" "smartctl" ];
config.myServices.monitoring.objects = lib.mkMerge [
(monitoring.lib.objectsCommon {
inherit hostFQDN;
{
service = [
+ {
+ service_description = "Disk /dev/disk/by-id/ata-Micron_1100_MTFDDAK512TBN_171216BD2A4B is sane";
+ use = "local-service";
+ check_command = [ "check_smartctl" "/dev/disk/by-id/ata-Micron_1100_MTFDDAK512TBN_171216BD2A4B" ];
+ __passive_servicegroups = "webstatus-resources";
+
+ check_interval = 60;
+ }
+ {
+ service_description = "Disk /dev/disk/by-id/ata-Micron_1100_MTFDDAK512TBN_171216BD2A70 is sane";
+ use = "local-service";
+ check_command = [ "check_smartctl" "/dev/disk/by-id/ata-Micron_1100_MTFDDAK512TBN_171216BD2A70" ];
+ __passive_servicegroups = "webstatus-resources";
+
+ check_interval = 60;
+ }
+ {
+ service_description = "Disk /dev/disk/by-id/ata-TOSHIBA_MG04ACA400N_96K1K87YFVLC is sane";
+ use = "local-service";
+ check_command = [ "check_smartctl" "/dev/disk/by-id/ata-TOSHIBA_MG04ACA400N_96K1K87YFVLC" ];
+ __passive_servicegroups = "webstatus-resources";
+
+ check_interval = 60;
+ }
+ {
+ service_description = "Disk /dev/disk/by-id/ata-WDC_WD3000FYYZ-01UL1B2_WD-WMC1F0E4X6WP is sane";
+ use = "local-service";
+ check_command = [ "check_smartctl" "/dev/disk/by-id/ata-WDC_WD3000FYYZ-01UL1B2_WD-WMC1F0E4X6WP" ];
+ __passive_servicegroups = "webstatus-resources";
+
+ check_interval = 60;
+ }
{
service_description = "No mdadm array is degraded";
use = "local-service";
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "../../flakes/private/monitoring",
"type": "path"
},
emailCheck = monitoring.lib.emailCheck config.myEnv.monitoring.email_check;
in
{
- config.myServices.monitoring.activatedPlugins = [ "memory" "command" "bandwidth" "emails" "mdadm" "postfix" "postgresql" "zfs" "notify-secondary"];
+ config.myServices.monitoring.activatedPlugins = [ "memory" "command" "bandwidth" "emails" "mdadm" "postfix" "postgresql" "zfs" "notify-secondary" "smartctl" ];
config.myServices.monitoring.pluginsArgs.postgresql.package = config.myServices.databases.postgresql.package;
config.myServices.monitoring.objects = lib.mkMerge [
(monitoring.lib.objectsCommon {
{
service = [
+ {
+ service_description = "Disk /dev/disk/by-id/ata-ST33000650NS_Z29540DM is sane";
+ use = "local-service";
+ check_command = [ "check_smartctl" "/dev/disk/by-id/ata-ST33000650NS_Z29540DM" ];
+ __passive_servicegroups = "webstatus-resources";
+
+ check_interval = 60;
+ }
+ {
+ service_description = "Disk /dev/disk/by-id/ata-ST33000650NS_Z296JGJ4 is sane";
+ use = "local-service";
+ check_command = [ "check_smartctl" "/dev/disk/by-id/ata-ST33000650NS_Z296JGJ4" ];
+ __passive_servicegroups = "webstatus-resources";
+
+ check_interval = 60;
+ }
+ {
+ service_description = "Disk /dev/disk/by-id/ata-SAMSUNG_MZ7LM480HMHQ-00005_S2UJNX0HA05895 is sane";
+ use = "local-service";
+ check_command = [ "check_smartctl" "/dev/disk/by-id/ata-SAMSUNG_MZ7LM480HMHQ-00005_S2UJNX0HA05895" ];
+ __passive_servicegroups = "webstatus-resources";
+
+ check_interval = 60;
+ }
+ {
+ service_description = "Disk /dev/disk/by-id/ata-Micron_5200_MTFDDAK480TDC_18011BEE03B3 is sane";
+ use = "local-service";
+ check_command = [ "check_smartctl" "/dev/disk/by-id/ata-Micron_5200_MTFDDAK480TDC_18011BEE03B3" ];
+ __passive_servicegroups = "webstatus-resources";
+
+ check_interval = 60;
+ }
{
service_description = "No mdadm array is degraded";
use = "local-service";
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "../../flakes/private/monitoring",
"type": "path"
},
},
"locked": {
"lastModified": 1,
- "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=",
+ "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=",
"path": "../../flakes/private/monitoring",
"type": "path"
},