Software RAID Plugin

mdadm is a Linux utility to manage and monitor software RAID. The mdadm monitoring plugin keeps track of failed disks in a RAID setup.

Reported Metrics

  • Faulty
  • Active
  • Resync
  • Read only

Dependencies

This plugin requires the mdstat python plugin, you can install this by running the pip install mdstat command.

To fetch the status, the plugin also needs sudo access. Edit the /etc/sudoers file and add the following at the end of the file:

agent360 ALL=(ALL) NOPASSWD: /usr/local/bin/mdjson 

This assumes that mdjson exists in /usr/local/bin/mdjson. To verify its location, run the whereis mdjson command.

Configure the plugin

To enable the plugin, edit the /etc/agent360.ini file and add the following lines:

[mdstat]
enabled = yes

Test the plugin

Run the sudo -u agent360 agent360 test mdstat command to check if it's returning any data.

mdstat:
{
"md0":
{
"active": 1,
"faulty": 0,
"read_only": 0,
"resync": 0
},
"md1":
{
"active": 1,
"faulty": 0,
"read_only": 0,
"resync": 0
},
"md2":
{"active": 1,
"faulty": 0,
"read_only": 0,
"resync": 0
}
}

Now you can restart the agent with the service agent360 restart command.

Create charts

Click on the Metrics link on the top menu, and then select mdstat as metric type and active/faulty/read_only/resync as the metric. Choose the servers you would like to graph and save it to your Dashboard.

You can create an alert for when the faulty metric is higher than zero, indicating that a server has a bad drive.