Skip to content

Adding a sensor to monitor MDADM Softwareraid; adding language independent APT-Sensor#38

Merged
konstantinpae merged 4 commits intomasterfrom
unknown repository
Sep 15, 2015
Merged

Adding a sensor to monitor MDADM Softwareraid; adding language independent APT-Sensor#38
konstantinpae merged 4 commits intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Sep 3, 2015

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

@konstantinpae
Copy link
Copy Markdown
Contributor

Hi,
and again sorry for the delay. Had to work through my emails and start training new colleagues.
Would it be possible to Pull against the Development Branch?
In this branch Python 3 compatibility is already given and also tested using Travis CI.
If this is not possible, and I will merge to the master branch but please consider for future Pull Requests to do them against the development branch.
Thank you!

konstantinpae added a commit that referenced this pull request Sep 15, 2015
Adding a sensor to monitor MDADM Softwareraid; adding language independent APT-Sensor
@konstantinpae konstantinpae merged commit 4936e6b into PRTG:master Sep 15, 2015
@ghost
Copy link
Copy Markdown
Author

ghost commented Sep 16, 2015

Hi,

sorry for the delay from our side ;-).

We will send pull request to the development branch in the future! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant