profiles/monitoring-server: Monitor http
This commit is contained in:
@@ -25,6 +25,48 @@
|
|||||||
fail_if_not_ssl: true
|
fail_if_not_ssl: true
|
||||||
fail_if_body_not_matches_regexp:
|
fail_if_body_not_matches_regexp:
|
||||||
- "Synapse is running"
|
- "Synapse is running"
|
||||||
|
headers:
|
||||||
|
User-Agent: "monitoring.clerie.de, blackbox exporter"
|
||||||
|
http4:
|
||||||
|
prober: http
|
||||||
|
http:
|
||||||
|
preferred_ip_protocol: ip4
|
||||||
|
ip_protocol_fallback: false
|
||||||
|
fail_if_ssl: true
|
||||||
|
follow_redirects: false
|
||||||
|
valid_status_codes: [ 200, 204, 301, 302, 303, 307, 308 ]
|
||||||
|
headers:
|
||||||
|
User-Agent: "monitoring.clerie.de, blackbox exporter"
|
||||||
|
http6:
|
||||||
|
prober: http
|
||||||
|
http:
|
||||||
|
preferred_ip_protocol: ip6
|
||||||
|
ip_protocol_fallback: false
|
||||||
|
fail_if_ssl: true
|
||||||
|
follow_redirects: false
|
||||||
|
valid_status_codes: [ 200, 204, 301, 302, 303, 307, 308 ]
|
||||||
|
headers:
|
||||||
|
User-Agent: "monitoring.clerie.de, blackbox exporter"
|
||||||
|
https4:
|
||||||
|
prober: http
|
||||||
|
http:
|
||||||
|
preferred_ip_protocol: ip4
|
||||||
|
ip_protocol_fallback: false
|
||||||
|
fail_if_not_ssl: true
|
||||||
|
follow_redirects: false
|
||||||
|
valid_status_codes: [ 200, 204, 301, 302, 303, 307, 308 ]
|
||||||
|
headers:
|
||||||
|
User-Agent: "monitoring.clerie.de, blackbox exporter"
|
||||||
|
https6:
|
||||||
|
prober: http
|
||||||
|
http:
|
||||||
|
preferred_ip_protocol: ip6
|
||||||
|
ip_protocol_fallback: false
|
||||||
|
fail_if_not_ssl: true
|
||||||
|
follow_redirects: false
|
||||||
|
valid_status_codes: [ 200, 204, 301, 302, 303, 307, 308 ]
|
||||||
|
headers:
|
||||||
|
User-Agent: "monitoring.clerie.de, blackbox exporter"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -366,6 +366,122 @@ in {
|
|||||||
relabelAddressToInstance
|
relabelAddressToInstance
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
job_name = "blackbox_local_http6";
|
||||||
|
scrape_interval = "100s";
|
||||||
|
metrics_path = "/probe";
|
||||||
|
params = {
|
||||||
|
module = [ "http6" ];
|
||||||
|
};
|
||||||
|
static_configs = [
|
||||||
|
{
|
||||||
|
targets = config.profiles.clerie.monitoring-server.probeTargets.blackbox-local-http6;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
relabel_configs = [
|
||||||
|
{
|
||||||
|
source_labels = [ "__address__" ];
|
||||||
|
target_label = "__param_target";
|
||||||
|
replacement = "http://\${1}";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
source_labels = [ "__address__" ];
|
||||||
|
target_label = "target";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
target_label = "__address__";
|
||||||
|
replacement = "monitoring-3.mon.clerie.de:9115";
|
||||||
|
}
|
||||||
|
relabelAddressToInstance
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
job_name = "blackbox_local_http4";
|
||||||
|
scrape_interval = "100s";
|
||||||
|
metrics_path = "/probe";
|
||||||
|
params = {
|
||||||
|
module = [ "http4" ];
|
||||||
|
};
|
||||||
|
static_configs = [
|
||||||
|
{
|
||||||
|
targets = config.profiles.clerie.monitoring-server.probeTargets.blackbox-local-http4;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
relabel_configs = [
|
||||||
|
{
|
||||||
|
source_labels = [ "__address__" ];
|
||||||
|
target_label = "__param_target";
|
||||||
|
replacement = "http://\${1}";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
source_labels = [ "__address__" ];
|
||||||
|
target_label = "target";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
target_label = "__address__";
|
||||||
|
replacement = "monitoring-3.mon.clerie.de:9115";
|
||||||
|
}
|
||||||
|
relabelAddressToInstance
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
job_name = "blackbox_local_https6";
|
||||||
|
scrape_interval = "100s";
|
||||||
|
metrics_path = "/probe";
|
||||||
|
params = {
|
||||||
|
module = [ "https6" ];
|
||||||
|
};
|
||||||
|
static_configs = [
|
||||||
|
{
|
||||||
|
targets = config.profiles.clerie.monitoring-server.probeTargets.blackbox-local-http6;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
relabel_configs = [
|
||||||
|
{
|
||||||
|
source_labels = [ "__address__" ];
|
||||||
|
target_label = "__param_target";
|
||||||
|
replacement = "https://\${1}";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
source_labels = [ "__address__" ];
|
||||||
|
target_label = "target";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
target_label = "__address__";
|
||||||
|
replacement = "monitoring-3.mon.clerie.de:9115";
|
||||||
|
}
|
||||||
|
relabelAddressToInstance
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
job_name = "blackbox_local_https4";
|
||||||
|
scrape_interval = "100s";
|
||||||
|
metrics_path = "/probe";
|
||||||
|
params = {
|
||||||
|
module = [ "https4" ];
|
||||||
|
};
|
||||||
|
static_configs = [
|
||||||
|
{
|
||||||
|
targets = config.profiles.clerie.monitoring-server.probeTargets.blackbox-local-http4;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
relabel_configs = [
|
||||||
|
{
|
||||||
|
source_labels = [ "__address__" ];
|
||||||
|
target_label = "__param_target";
|
||||||
|
replacement = "https://\${1}";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
source_labels = [ "__address__" ];
|
||||||
|
target_label = "target";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
target_label = "__address__";
|
||||||
|
replacement = "monitoring-3.mon.clerie.de:9115";
|
||||||
|
}
|
||||||
|
relabelAddressToInstance
|
||||||
|
];
|
||||||
|
}
|
||||||
{
|
{
|
||||||
job_name = "hydra";
|
job_name = "hydra";
|
||||||
scrape_interval = "20s";
|
scrape_interval = "20s";
|
||||||
|
@@ -48,6 +48,11 @@ in {
|
|||||||
clerie-uberspace = mkProbeOption "This target is a uberspace host managed by clerie" {};
|
clerie-uberspace = mkProbeOption "This target is a uberspace host managed by clerie" {};
|
||||||
http = mkProbeOption "Monitor HTTP" {
|
http = mkProbeOption "Monitor HTTP" {
|
||||||
protocols = mkProtocolsOption;
|
protocols = mkProtocolsOption;
|
||||||
|
transport = mkOption {
|
||||||
|
type = with types; listOf (enum [ "http" "https" ]);
|
||||||
|
default = [ "http" "https" ];
|
||||||
|
description = "HTTP transport modes to monitor";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
icmp = mkProbeOption "Monitor HTTP" {
|
icmp = mkProbeOption "Monitor HTTP" {
|
||||||
protocols = mkProtocolsOption;
|
protocols = mkProtocolsOption;
|
||||||
@@ -56,10 +61,12 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
probeTargets = mkSubmoduleOption "Target per probe" {
|
probeTargets = mkSubmoduleOption "Target per probe" {
|
||||||
blackbox-http4 = mkTargetsListOption;
|
|
||||||
blackbox-http6 = mkTargetsListOption;
|
|
||||||
blackbox-icmp4 = mkTargetsListOption;
|
blackbox-icmp4 = mkTargetsListOption;
|
||||||
blackbox-icmp6 = mkTargetsListOption;
|
blackbox-icmp6 = mkTargetsListOption;
|
||||||
|
blackbox-local-http4 = mkTargetsListOption;
|
||||||
|
blackbox-local-http6 = mkTargetsListOption;
|
||||||
|
blackbox-local-https4 = mkTargetsListOption;
|
||||||
|
blackbox-local-https6 = mkTargetsListOption;
|
||||||
node-exporter-uberspace = mkTargetsListOption;
|
node-exporter-uberspace = mkTargetsListOption;
|
||||||
blackbox-local-synapse = mkTargetsListOption;
|
blackbox-local-synapse = mkTargetsListOption;
|
||||||
};
|
};
|
||||||
@@ -67,14 +74,6 @@ in {
|
|||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|
||||||
profiles.clerie.monitoring-server.probeTargets.blackbox-http4 = targetsForProbe "http" (probeConfig:
|
|
||||||
(listContains "ipv4" probeConfig.protocols)
|
|
||||||
);
|
|
||||||
|
|
||||||
profiles.clerie.monitoring-server.probeTargets.blackbox-http6 = targetsForProbe "http" (probeConfig:
|
|
||||||
(listContains "ipv6" probeConfig.protocols)
|
|
||||||
);
|
|
||||||
|
|
||||||
profiles.clerie.monitoring-server.probeTargets.blackbox-icmp4 = targetsForProbe "icmp" (probeConfig:
|
profiles.clerie.monitoring-server.probeTargets.blackbox-icmp4 = targetsForProbe "icmp" (probeConfig:
|
||||||
(listContains "ipv4" probeConfig.protocols)
|
(listContains "ipv4" probeConfig.protocols)
|
||||||
);
|
);
|
||||||
@@ -83,6 +82,22 @@ in {
|
|||||||
(listContains "ipv6" probeConfig.protocols)
|
(listContains "ipv6" probeConfig.protocols)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
profiles.clerie.monitoring-server.probeTargets.blackbox-local-http4 = targetsForProbe "http" (probeConfig:
|
||||||
|
(listContains "ipv4" probeConfig.protocols) && (listContains "http" probeConfig.transport)
|
||||||
|
);
|
||||||
|
|
||||||
|
profiles.clerie.monitoring-server.probeTargets.blackbox-local-http6 = targetsForProbe "http" (probeConfig:
|
||||||
|
(listContains "ipv6" probeConfig.protocols) && (listContains "http" probeConfig.transport)
|
||||||
|
);
|
||||||
|
|
||||||
|
profiles.clerie.monitoring-server.probeTargets.blackbox-local-https4 = targetsForProbe "http" (probeConfig:
|
||||||
|
(listContains "ipv4" probeConfig.protocols) && (listContains "https" probeConfig.transport)
|
||||||
|
);
|
||||||
|
|
||||||
|
profiles.clerie.monitoring-server.probeTargets.blackbox-local-https6 = targetsForProbe "http" (probeConfig:
|
||||||
|
(listContains "ipv6" probeConfig.protocols) && (listContains "https" probeConfig.transport)
|
||||||
|
);
|
||||||
|
|
||||||
profiles.clerie.monitoring-server.probeTargets.node-exporter-uberspace = targetsForProbe "clerie-uberspace" (_: true);
|
profiles.clerie.monitoring-server.probeTargets.node-exporter-uberspace = targetsForProbe "clerie-uberspace" (_: true);
|
||||||
|
|
||||||
profiles.clerie.monitoring-server.probeTargets.blackbox-local-synapse = targetsForProbe "synapse" (_: true);
|
profiles.clerie.monitoring-server.probeTargets.blackbox-local-synapse = targetsForProbe "synapse" (_: true);
|
||||||
|
Reference in New Issue
Block a user