all: add smartctl metrics

This commit is contained in:
Adithya 2024-09-19 19:08:58 +05:30
parent 7fda615577
commit fde00482b4
Signed by: adtya
GPG key ID: B8857BFBA2C47B9C
2 changed files with 24 additions and 2 deletions

View file

@ -70,6 +70,19 @@ in
{ targets = [ "layne.labs.adtya.xyz" ]; }
];
}
{
job_name = "smartctl";
scheme = "https";
metrics_path = "/smartctl-metrics";
static_configs = [
{ targets = [ "rico0.labs.adtya.xyz" ]; }
{ targets = [ "rico1.labs.adtya.xyz" ]; }
{ targets = [ "rico2.labs.adtya.xyz" ]; }
{ targets = [ "wynne.labs.adtya.xyz" ]; }
{ targets = [ "wynne.labs.adtya.xyz" ]; }
{ targets = [ "layne.labs.adtya.xyz" ]; }
];
}
{
job_name = "node";
scheme = "https";

View file

@ -14,11 +14,15 @@ in
extraConfig = ''
metrics /caddy-metrics
handle /metrics {
reverse_proxy 127.0.0.1:9100
reverse_proxy ${config.services.prometheus.exporters.node.listenAddress}:${toString config.services.prometheus.exporters.node.port}
}
handle /smartctl-metrics {
uri replace /smartctl-metrics /metrics
reverse_proxy ${config.services.prometheus.exporters.smartctl.listenAddress}:${toString config.services.prometheus.exporters.smartctl.port}
}
handle /systemd-metrics {
uri replace /systemd-metrics /metrics
reverse_proxy 127.0.0.1:9558
reverse_proxy ${config.services.prometheus.exporters.systemd.listenAddress}:${toString config.services.prometheus.exporters.systemd.port}
}
${lib.optionalString config.services.prometheus.exporters.postgres.enable ''
handle /postgres-metrics {
@ -36,6 +40,11 @@ in
port = 9100;
enabledCollectors = [ "systemd" "processes" ];
};
smartctl = {
enable = true;
listenAddress = "127.0.0.1";
port = 9633;
};
systemd = {
enable = true;
listenAddress = "127.0.0.1";