1
0
Fork 0

Try a bunch of rule improvements

This commit is contained in:
Malte Brandy 2020-12-01 12:17:10 +01:00
parent ce44ee1c3a
commit c7d4e2ca4c
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9
5 changed files with 48 additions and 38 deletions

View file

@ -5,18 +5,20 @@ with lib;
{ {
config = { config = {
m-0.monitoring = [{ m-0.monitoring = [
host = "apollo:9100"; {
name = "apollo"; host = "apollo:9100";
}{ name = "apollo";
name = "ved server"; }
host = "bach.vocalensemble-darmstadt.de:9100"; {
} name = "ved server";
{ host = "bach.vocalensemble-darmstadt.de:9100";
name = "ved postfix"; }
host = "bach.vocalensemble-darmstadt.de:9154"; {
} name = "ved postfix";
]; host = "bach.vocalensemble-darmstadt.de:9154";
}
];
}; };
options = { options = {
@ -33,6 +35,10 @@ with lib;
options = { options = {
name = mkOption { type = types.str; }; name = mkOption { type = types.str; };
host = mkOption { type = types.str; }; host = mkOption { type = types.str; };
container = mkOption {
type = types.bool;
default = false;
};
}; };
}); });
default = [ ]; default = [ ];
@ -45,29 +51,29 @@ with lib;
apollo-p = "${p}::1"; apollo-p = "${p}::1";
wg-p = "${p}::100"; wg-p = "${p}::100";
v4-p = "10.0.0"; v4-p = "10.0.0";
in rec { in rec {
hera = "${p}::1"; hera = "${p}::1";
hera-wg-host = "${p}::100:0:1"; hera-wg-host = "${p}::100:0:1";
hera-v4 = "213.136.94.190"; hera-v4 = "213.136.94.190";
hera-wg = "${wg-p}:1"; hera-wg = "${wg-p}:1";
apollo-wg = "${wg-p}:2"; apollo-wg = "${wg-p}:2";
hera-intern = "${hera-p}:1"; hera-intern = "${hera-p}:1";
git = "${hera-p}:2"; git = "${hera-p}:2";
borg = "${hera-p}:3"; borg = "${hera-p}:3";
matrix = "${hera-p}:8"; matrix = "${hera-p}:8";
cloud = "${hera-p}:9"; cloud = "${hera-p}:9";
chor-cloud = "${hera-p}:b"; chor-cloud = "${hera-p}:b";
apollo = apollo-wg; apollo = apollo-wg;
hera-intern-v4 = "${v4-p}.1"; hera-intern-v4 = "${v4-p}.1";
cloud-intern-v4 = "${v4-p}.2"; cloud-intern-v4 = "${v4-p}.2";
chor-cloud-intern-v4 = "${v4-p}.3"; chor-cloud-intern-v4 = "${v4-p}.3";
matrix-intern-v4 = "${v4-p}.4"; matrix-intern-v4 = "${v4-p}.4";
}; };
}; };
}; };

View file

@ -165,19 +165,21 @@ in {
}; };
m-0.monitoring = [ m-0.monitoring = [
{ {
name = "chor-cloud"; name = "chor-cloud container";
host = "chor-cloud:9100"; host = "chor-cloud:9100";
container = true;
} }
{ {
name = "chor-cloud-nginx"; name = "chor-cloud nginx";
host = "chor-cloud:9113"; host = "chor-cloud:9113";
} }
{ {
name = "cloud"; name = "cloud container";
host = "cloud:9100"; host = "cloud:9100";
container = true;
} }
{ {
name = "cloud-nginx"; name = "cloud nginx";
host = "cloud:9113"; host = "cloud:9113";
} }
]; ];

View file

@ -5,8 +5,9 @@ in {
m-0.monitoring = [ m-0.monitoring = [
{ {
name = "mail-server"; name = "mail container";
host = "hera-intern:9101"; host = "hera-intern:9101";
container = true;
} }
{ {
name = "hera postfix"; name = "hera postfix";

View file

@ -34,6 +34,7 @@
labels = { labels = {
inherit name; inherit name;
inherit alert_type; inherit alert_type;
inherit container;
}; };
}]; }];
}) config.m-0.monitoring; }) config.m-0.monitoring;

View file

@ -30,12 +30,12 @@ groups:
annotations: annotations:
description: 'service {{$labels.exported_name}} on {{$labels.name}} failed.' description: 'service {{$labels.exported_name}} on {{$labels.name}} failed.'
- alert: out_of_diskspace - alert: out_of_diskspace
expr: ((min by (device, name) (node_filesystem_avail_bytes{device!="tmpfs",name!="cloud",name!="chor-cloud",name!="mail-server"}) * 100) / max by (device,name) (node_filesystem_size_bytes) < 10) and (max by (device,name) (node_filesystem_avail_bytes) / 1024 / 1024 / 1024) < 100 expr: min by (device, name) (node_filesystem_avail_bytes{device!="tmpfs",container!=true}) / max by (device,name) (node_filesystem_size_bytes) < 0.1
for: 5m for: 5m
labels: labels:
severity: warning severity: warning
annotations: annotations:
description: "{{ $labels.device }} on {{ $labels.name }} has less than 10% free diskspace." description: "{{ $labels.device }} on {{ $labels.name }} has only {{ $value | humanizePercentage }} free diskspace."
- alert: out_of_inodes - alert: out_of_inodes
expr: node_filesystem_files_free{fstype!="tmpfs"} / node_filesystem_files{fstype!="tmpfs"} * 100 < 10 expr: node_filesystem_files_free{fstype!="tmpfs"} / node_filesystem_files{fstype!="tmpfs"} * 100 < 10
for: 5m for: 5m
@ -49,4 +49,4 @@ groups:
labels: labels:
severity: warning severity: warning
annotations: annotations:
description: "mail queue {{ $labels.queue }} on {{ $labels.name }} has accumulated a waiting time of {{ $value }}s." description: "mail queue {{ $labels.queue }} on {{ $labels.name }} has accumulated a waiting time of {{ $value | humanizeDuration }}."