Replies: 1 comment
-
Your general idea to check the status with mdadm and then send a HTTP request to $PING_URL/0 on success and $PING_URL/1 on failure is good. I guess the question is how to reliably tell from mdadm's output if the RAID is OK or not. I cannot answer this, this would be better asked to people experienced with linux software RAID. Perhaps try serverfault.com? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, i use healthchecks to monitor my backup and works great.
now i would implement to monitor my linux raid software.
i know abount smartd monitor that send mail, but sometimes smtp parameters changes.
so for me is more comfortable like linux sends curl/wget to healthchecks if is ok or not.
so i think to use this simple script
#!/bin/bash
HTTP_US=myusername
HTTP_PW="mypassword"
HC_URL=https://myurl.tld/ping/74b2a848-ba0d-4fd4-b5e1-12345
STATUS=$(mdadm --detail /dev/md1 | grep degraded > /dev/null ; echo $?)
if 1 raid ok , if 0 raid degraded
if [ $STATUS = 0 ]; then
$(which curl) -u $HTTP_US:$HTTP_PW -m 10 --retry 5 $HC_URL/1
fi
if [ $STATUS = 1 ]; then
$(which curl) -u $HTTP_US:$HTTP_PW -m 10 --retry 5 $HC_URL/0
fi
or is better check (grep) if mdadm is clean or active?
thank you
Beta Was this translation helpful? Give feedback.
All reactions