fix: monitoring
This commit is contained in:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user