I am looking for help with the creation of a script to monitor the status of a RAID implemented using mdadm.

Is it possible to create is an icon that can be clicked on, script starts up and displays the current RAID status in a window, which refreshes every however often? And if so, how?

Any help would be appreciated, even if it's just pointing me towards a good guide to creating it or a better understanding.


closed as off-topic by Ingo, Patrick Cook, Milliways, Ghanima Feb 24 at 19:22

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be specific to the Raspberry Pi within the scope defined in the help center." – Patrick Cook, Milliways, Ghanima
If this question can be reworded to fit the rules in the help center, please edit the question.

  • which scripting language will the script be written in? – Jaromanda X Feb 22 at 2:47
  • I'm not sure whether it would be easier to write a bash shell script or do something with Python. In terms of scripting or any code writing, I'm an absolute novice. – JacobWilbar Feb 22 at 2:52

You don't even need a script for this, you can just use the watch command.

watch cat /proc/mdstat

Options you may want to use:

-d, --differences [permanent]
Highlight the differences between successive updates. Option will read optional argument that changes highlight to be permanent, allowing to see what has changed at least once since first iteration.

-n, --interval seconds
Specify update interval. The command will not allow quicker than 0.1 second interval, in which the smaller values are converted. Both '.' and ',' work for any locales.

  • Thanks for that, I wasn't aware of that command. The need for a script for a way to view it is for other people, a sort of user-friendly option for those that don't know Linux or even computing all that well. – JacobWilbar Feb 22 at 16:48
  • If you just want alerts when something is wrong, you may want to use mdadm --monitor. – RalfFriedl Feb 23 at 8:49
  • Yes I know, what I'm after isn't the commands used to monitor or look at the RAID status. I'm more after a way to produce a script that will pull that information out with some sort of variable, etc. – JacobWilbar Mar 5 at 13:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.