Adding a sensor to monitor MDADM Softwareraid; adding language independent APT-Sensor#38
Merged
konstantinpae merged 4 commits intomasterfrom Sep 15, 2015
unknown repository
Merged
Adding a sensor to monitor MDADM Softwareraid; adding language independent APT-Sensor#38konstantinpae merged 4 commits intomasterfrom unknown repository
konstantinpae merged 4 commits intomasterfrom
unknown repository
Conversation
Contributor
|
Hi, |
konstantinpae
added a commit
that referenced
this pull request
Sep 15, 2015
Adding a sensor to monitor MDADM Softwareraid; adding language independent APT-Sensor
Author
|
Hi, sorry for the delay from our side ;-). We will send pull request to the development branch in the future! Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We created this sensor to watch the status of an MDADM Software-RAID in Linux.
MDADM-Raids are very common in Linux environments especially Rootservers/Hosting evironments.
The sample output from mdadm (cat /proc/mdstat) of an healthy RAID looks like this:
Personalities : [raid1]
md0 : active raid1 sda1[2] sdb1[1]
194368 blocks super 1.2 [2/2] [UU]
md1 : active raid1 sdb5[1] sda5[0]
1950656 blocks super 1.2 [2/2] [UU]
md2 : active raid1 sdb6[1] sda6[0]
1462857536 blocks super 1.2 [2/2] [UU]
Each "md*" is an array with one or many drives. Each drive are marked with an "U".
The sensor keeps it simple: We split each array in a list and search for the keywords:
If an drive is missing or faulty the output for example looks like this:
md1 : active raid1 sde16 sdg1[1] sdb1[4] sdd1[3] sdc1[2]
488383936 blocks [6/4] UUUU
When finding an underscore we count the counter for arrays with missing drives up.
We are doing the same when finding keywords "recovery [recovering raid integrity on same drive], resyncing [drive replaced or additional drive added to expand array], check [integrity check, sometimes executed automatically from OS].
For example recovery looks like this:
md0 : active raid1 sda1[2] sdb1[3]
2095040 blocks super 1.2 [2/1] [U_]
[>....................] recovery = 0.4% (9700/2094040) finish=8.6min speed=19600K/sec