centreon / centreon-plugins

Collection of standard plugins to discover and gather cloud-to-edge metrics and status across your whole IT infrastructure.
https://www.centreon.com
Apache License 2.0
311 stars 274 forks source link

[os::linux] Extend Plugin - Raid Status - mdadm #1130

Closed MikeW83 closed 5 months ago

MikeW83 commented 6 years ago

Hello guys,

I'm using an dedicated hardware for monitoring and have configured a RAID 1 with mdadm in CentOS 7. Is it possible to implement a check for it? I don't know if there is apossibility to check it using SNMP or if it has to be a local check only. Actually I'm using this plugin: https://exchange.nagios.org/directory/Plugins/Operating-Systems/Linux/Linux-Software-Raid-Plugin-for-32-2Dbit-and-64-2Dbit-systems/details But there is another version for use without administrative rights: https://exchange.nagios.org/directory/Plugins/Operating-Systems/Linux/check_md_raid/details

Thank you very much.

Best regards, Michael

Sims24 commented 6 years ago

Hi @MikeW83

Could you please provide a sample execution/output from mdadm command please ?

MikeW83 commented 6 years ago

Hello Simon,

this is the executed command without the plugin in the description:

[root@centreon ~]# cat /proc/mdstat
Personalities : [raid1]
md125 : active raid1 sda2[0] sdb2[1]
      4882432 blocks super 1.2 [2/2] [UU]
      bitmap: 0/1 pages [0KB], 65536KB chunk

md126 : active raid1 sda1[0] sdb1[1]
      16007168 blocks super 1.2 [2/2] [UU]

md127 : active raid1 sdb3[1] sda3[0]
      467352576 blocks super 1.2 [2/2] [UU]
      bitmap: 3/4 pages [12KB], 65536KB chunk

unused devices: <none>

This is what I get from the plugin from above:

[root@centreon ~]# /usr/lib/nagios/plugins/check_md_raid
OK - Checked 3 arrays.

When a rebuild or synchronization is running, then it is showing up like this:```

md3 : active raid1 sdb5[1] sda5[0]
      454100403 blocks super 1.2 [2/2] [UU]
      [========>............]  check = 42.4% (192666240/454100403) finish=137.6min speed=31657K/sec

This is not from my system. Only an example from another page.

nicutor commented 4 years ago

+1

Aleksey-Maksimov commented 2 years ago

+1

Aleksey-Maksimov commented 2 years ago

Linux Software RAID (mdraid) on Debian 10 examples:

Here we need to check that the md* devices are active. The mdstat output is useful to add when including the "--verbose" option:

# cat /proc/mdstat
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]
md0 : active (auto-read-only) raid1 sda2[0] sdb2[1]
      4189184 blocks super 1.2 [2/2] [UU]
      bitmap: 0/1 pages [0KB], 65536KB chunk

md1 : active raid1 sdb3[1] sda3[0]
      972179136 blocks super 1.2 [2/2] [UU]
      bitmap: 2/8 pages [8KB], 65536KB chunk

Here we can get detailed status for each array. If we don't have "Failed Devices : 0" then there is a problem. At the bottom of the output, there is a table with disks that are members of the array. The normal state in the "State" column is "active sync"

# mdadm --detail /dev/md0
/dev/md0:
           Version : 1.2
     Creation Time : Fri Aug 14 14:39:50 2020
        Raid Level : raid1
        Array Size : 4189184 (4.00 GiB 4.29 GB)
     Used Dev Size : 4189184 (4.00 GiB 4.29 GB)
      Raid Devices : 2
     Total Devices : 2
       Persistence : Superblock is persistent

     Intent Bitmap : Internal

       Update Time : Mon Dec  6 14:41:23 2021
             State : clean
    Active Devices : 2
   Working Devices : 2
    Failed Devices : 0
     Spare Devices : 0

Consistency Policy : bitmap

              Name : debian:0
              UUID : 1fc427f9:93c94490:0797c44f:f53371cb
            Events : 32

    Number   Major   Minor   RaidDevice State
       0       8        2        0      active sync   /dev/sda2
       1       8       18        1      active sync   /dev/sdb2
# mdadm --detail /dev/md1
/dev/md1:
           Version : 1.2
     Creation Time : Fri Aug 14 14:40:25 2020
        Raid Level : raid1
        Array Size : 972179136 (927.14 GiB 995.51 GB)
     Used Dev Size : 972179136 (927.14 GiB 995.51 GB)
      Raid Devices : 2
     Total Devices : 2
       Persistence : Superblock is persistent

     Intent Bitmap : Internal

       Update Time : Thu Oct 13 10:54:08 2022
             State : clean
    Active Devices : 2
   Working Devices : 2
    Failed Devices : 0
     Spare Devices : 0

Consistency Policy : bitmap

              Name : debian:1
              UUID : 45ad5f50:1f5fdff4:593f26f7:1e55e644
            Events : 32482

    Number   Major   Minor   RaidDevice State
       0       8        3        0      active sync   /dev/sda3
       1       8       19        1      active sync   /dev/sdb3
Aleksey-Maksimov commented 2 years ago

If any more information is required from me, then I am ready to help.

lucie-dubrunfaut commented 5 months ago

Hello :)

This issue seems particularly old so let me close it. If the enhancement request is still current ( @Aleksey-Maksimov especially because you re-opened it), please address it here to be take into account and vote on. Thank you for your understanding.

Aleksey-Maksimov commented 5 months ago

Thank you. But I think that if they haven’t been able to do it since 2018, then this mission is impossible for Centreon =)

lucie-dubrunfaut commented 5 months ago

This is not necessarily impossible but it may have gotten lost in the midst of numerous requests. This is why we redirect you to TheWatch for your enhancements/ideas requests in order to use the voting system to prioritize the improvements desired by the community. I encourage you to submit your request there and I hope to be able to follow it carefully :)

Aleksey-Maksimov commented 5 months ago

Thank you