diff options
Diffstat (limited to 'modules/private/monitoring')
-rw-r--r-- | modules/private/monitoring/objects_backup-2.nix | 5 | ||||
-rw-r--r-- | modules/private/monitoring/objects_monitoring-1.nix | 4 | ||||
-rwxr-xr-x | modules/private/monitoring/plugins/check_emails | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/modules/private/monitoring/objects_backup-2.nix b/modules/private/monitoring/objects_backup-2.nix index 52289dd..927cc25 100644 --- a/modules/private/monitoring/objects_backup-2.nix +++ b/modules/private/monitoring/objects_backup-2.nix | |||
@@ -1,4 +1,4 @@ | |||
1 | { config, pkgs, lib, hostFQDN, ... }: | 1 | { config, pkgs, lib, hostFQDN, emailCheck, ... }: |
2 | let | 2 | let |
3 | defaultPassiveInfo = { | 3 | defaultPassiveInfo = { |
4 | filter = lib.attrsets.filterAttrs | 4 | filter = lib.attrsets.filterAttrs |
@@ -12,6 +12,9 @@ let | |||
12 | in | 12 | in |
13 | { | 13 | { |
14 | service = [ | 14 | service = [ |
15 | (emailCheck "backup-2" hostFQDN // { | ||
16 | passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-email"; freshness_threshold = "1350"; }; | ||
17 | }) | ||
15 | { | 18 | { |
16 | passiveInfo = defaultPassiveInfo; | 19 | passiveInfo = defaultPassiveInfo; |
17 | service_description = "Size on /backup2 partition"; | 20 | service_description = "Size on /backup2 partition"; |
diff --git a/modules/private/monitoring/objects_monitoring-1.nix b/modules/private/monitoring/objects_monitoring-1.nix index f69d3ff..3200d5c 100644 --- a/modules/private/monitoring/objects_monitoring-1.nix +++ b/modules/private/monitoring/objects_monitoring-1.nix | |||
@@ -1,4 +1,4 @@ | |||
1 | { config, pkgs, ... }: | 1 | { config, pkgs, hostFQDN, emailCheck, ... }: |
2 | { | 2 | { |
3 | host = { | 3 | host = { |
4 | # Dummy host for testing | 4 | # Dummy host for testing |
@@ -22,6 +22,8 @@ | |||
22 | # check_command = "check_critical"; | 22 | # check_command = "check_critical"; |
23 | # } | 23 | # } |
24 | 24 | ||
25 | (emailCheck "monitoring-1" hostFQDN) | ||
26 | |||
25 | { | 27 | { |
26 | service_description = "ftp has access to database for authentication"; | 28 | service_description = "ftp has access to database for authentication"; |
27 | host_name = "eldiron.immae.eu"; | 29 | host_name = "eldiron.immae.eu"; |
diff --git a/modules/private/monitoring/plugins/check_emails b/modules/private/monitoring/plugins/check_emails index 0ee3e4e..5a8453e 100755 --- a/modules/private/monitoring/plugins/check_emails +++ b/modules/private/monitoring/plugins/check_emails | |||
@@ -37,7 +37,7 @@ my @emails_to_expect = split(/,/, $opts{'f'}); | |||
37 | 37 | ||
38 | my $cmd_result; | 38 | my $cmd_result; |
39 | if ($local_directory ne '') { | 39 | if ($local_directory ne '') { |
40 | if (! -d $local_directory) { | 40 | if (@emails_to_expect and ! -d $local_directory) { |
41 | print "Emails $host UNKNOWN - Could not find local directory"; | 41 | print "Emails $host UNKNOWN - Could not find local directory"; |
42 | exit($STATE_UNKNOWN); | 42 | exit($STATE_UNKNOWN); |
43 | } | 43 | } |