You are not logged in.

#1 2008-06-08 17:57:36

Morra
Member
Registered: 2008-05-16
Posts: 39

RAID status in Conky

I wrote a tiny script to monitor the status of RAID arrays. It is written in awk and is meant to be used with conky. I have this in my conky config file:
RAID: ${execi 60 gawk -f path-to-the-script /proc/mdstat}

#!/bin/gawk -f
# This script checks the status of RAID arrays from /proc/mdstat

/_/ { state = "Warning!"; exit }
/blocks/ { state = $NF }

END { print state }

If everything is working correctly the ouput will be: "RAID: [UU]". It means that both drives are Up and running.
If there is something wrong with the drive it will give an error message: "RAID: [WARNING!]".

Maybe someone will find this usefull.

Offline

#2 2008-08-10 00:42:41

moberry
Member
Registered: 2008-08-08
Posts: 16

Re: RAID status in Conky

Thanks!

Offline

#3 2015-04-16 15:23:50

jsnlry
Member
Registered: 2012-06-26
Posts: 39

Re: RAID status in Conky

Thanks!

I have multiple RAIDs so I used the following command to check the status of a specific RAID:

${execi 60 cat /proc/mdstat | grep md126 -A 1 | gawk -f path-to-the-script --}

(replace md126 with the array you want to check)

Offline

Board footer

Powered by FluxBB