| 1 | ### Understand the alert |
| 2 | |
| 3 | This alert, `mdstat_nonredundant_last_collected`, is triggered when the Netdata Agent fails to collect data from the Multiple Device (md) driver for a certain period. The md driver is used to manage software RAID arrays in Linux. |
| 4 | |
| 5 | ### What is the md driver? |
| 6 | |
| 7 | The md (multiple device) driver is responsible for managing software RAID arrays on Linux systems. It provides a way to combine multiple physical disks into a single logical disk, increasing capacity and providing redundancy, depending on the RAID level. Monitoring the status of these devices is crucial to ensure data integrity and redundancy. |
| 8 | |
| 9 | ### Troubleshoot the alert |
| 10 | |
| 11 | 1. Check the status of the md driver: |
| 12 | |
| 13 | To inspect the status of the RAID arrays managed by the md driver, use the `cat` command: |
| 14 | |
| 15 | ``` |
| 16 | cat /proc/mdstat |
| 17 | ``` |
| 18 | |
| 19 | This will display the status and configuration of all active RAID arrays. Look for any abnormal status, such as failed or degraded disks, and replace or fix them as needed. |
| 20 | |
| 21 | 2. Verify the Netdata configuration: |
| 22 | |
| 23 | Ensure that the Netdata Agent is properly configured to collect data from the md driver. Open the `netdata.conf` configuration file found in `/etc/netdata/` or `/opt/netdata/etc/netdata/`, and look for the `[plugin:proc:/proc/mdstat]` section. |
| 24 | |
| 25 | Make sure that the `enabled` option is set to `yes`: |
| 26 | |
| 27 | ``` |
| 28 | [plugin:proc:/proc/mdstat] |
| 29 | # enabled = yes |
| 30 | ``` |
| 31 | |
| 32 | If you make any changes to the configuration, restart the Netdata Agent for the changes to take effect: |
| 33 | |
| 34 | ``` |
| 35 | sudo systemctl restart netdata |
| 36 | ``` |
| 37 | |
| 38 | 3. Check the md driver data collection: |
| 39 | |
| 40 | After verifying the Netdata configuration, check if data collection is successful. On the Netdata dashboard, go to the "Disks" section, and look for "mdX" (where "X" is a number) in the list of available disks. If you can see the charts for your RAID array(s), it means data collection is working correctly. |
| 41 | |
| 42 | 4. Investigate system logs: |
| 43 | |
| 44 | If the issue persists, check the system logs for any errors or messages related to the md driver or Netdata Agent. You can use `journalctl` for this purpose: |
| 45 | |
| 46 | ``` |
| 47 | journalctl -u netdata |
| 48 | ``` |
| 49 | |
| 50 | Look for any error messages or warnings that could indicate the cause of the problem. |
| 51 | |
| 52 | ### Useful resources |
| 53 | |
| 54 | 1. [Linux RAID: A Quick Guide](https://www.cyberciti.biz/tips/linux-raid-increase-resync-rebuild-speed.html) |
| 55 | 2. [Netdata Agent Configuration Guide](/src/daemon/config/README.md) |