fix: monitoring
This commit is contained in:
parent
21ed381d18
commit
3282b7d634
3 changed files with 5 additions and 5 deletions
|
|
@ -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}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue