fix: monitoring

This commit is contained in:
2025-11-29 22:42:00 +01:00
parent 21ed381d18
commit 3282b7d634
3 changed files with 5 additions and 5 deletions

View File

@@ -7,6 +7,7 @@
./utils/modules/nginx.nix
./utils/modules/autoupgrade.nix
./utils/modules/victoriametrics
./utils/modules/promtail
./utils/modules/borgbackup.nix
@@ -25,7 +26,6 @@
./modules/podman.nix
./modules/omada.nix
./modules/ddclient.nix
./utils/modules/victoriametrics
# ./modules/wol.nix

View File

@@ -9,7 +9,8 @@ in {
"${impermanence}/nixos.nix"
./utils/bento.nix
./utils/modules/sops.nix
./utils/modules/victoriametrics/default.nix
./utils/modules/victoriametrics
./utils/modules/promtail
./modules/pyload.nix
./modules/jellyfin.nix

View File

@@ -104,7 +104,7 @@ EOF
# mdadm RAID array status (doesn't access disks)
echo "" >> "$TEMP_FILE"
echo "# HELP mdadm_array_state RAID array state (1=clean, 0=degraded/other)" >> "$TEMP_FILE"
echo "# HELP mdadm_array_state RAID array state (1=clean/active/resyncing, 0=degraded/other)" >> "$TEMP_FILE"
echo "# TYPE mdadm_array_state gauge" >> "$TEMP_FILE"
echo "# HELP mdadm_array_devices_total Total devices in RAID array" >> "$TEMP_FILE"
echo "# TYPE mdadm_array_devices_total gauge" >> "$TEMP_FILE"
@@ -122,7 +122,7 @@ EOF
# Parse state
state=$(echo "$mdadm_output" | grep "State :" | sed 's/.*State : //' | tr -d ' ')
if [[ "$state" == "clean" ]] || [[ "$state" == "active" ]]; then
if [[ "$state" == *clean* ]] || [[ "$state" == *active* ]]; then
state_value=1
else
state_value=0
@@ -156,7 +156,6 @@ in
enable = true;
enabledCollectors = [
"textfile"
"systemd"
];
extraFlags = [
"--collector.textfile.directory=${textfileDir}"