Skip to content

Commit

Permalink
all: add smartctl metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
adtya committed Sep 19, 2024
1 parent 7fda615 commit fde0048
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
13 changes: 13 additions & 0 deletions hosts/rico0/services/apps/prometheus.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
13 changes: 11 additions & 2 deletions hosts/shared/prometheus-exporters.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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";
Expand Down

0 comments on commit fde0048

Please sign in to comment.