xcp
xcp copied to clipboard
Plugin request: XAPI plugin to monitor hard disks
Creating plugin to monitor phisical hard disks on the xcp-ng host.
The idea is to use smartctl to monitor hard disk smart state and sent reports to XOA
- The plugin would monitor hard disks condition in xcp-ng - especially smart status
- Information should be displayed in XOA - probably in dashboard section
- The plugin should support mail alerts to warn operator about failing disk
Currenlty I'm manually using smartctl to check every disk on the xcp-ng host. We could use smartctl to grab the disks condition and send this data into XOA. smartctl already supports LSI, MegaRaid, Adaptec, Intel raid cards (and so on...).
I'm using this simple code smartctl -a -d megaraid,**X** /dev/sd**X** | sed -n '/SMART Error Log Version/{n;p;}' to check if drive is failing. Probably we could go deeper.
Bump ...
FYI I used to do stuff like this. I created a php script on a xenserver box a few years ago, that when someone went to https://server.bla/drive_check.php it would out put the status of the drives. I had some nagios stuff linked in too.
The big thing that I found, with hardware raid, and some other deals, is that the ids of the drives would change. I was addressing them /dev/sda or whatever, and some times on reboot the hard drives could move around. At the time it was a hardware raid5 with me using megaraid binarys, and the megaraid would shuffle the device ids, and drives upon reboot.
I would just get the status of all the drives (same megaraid stuff), and parse it for bad words.
I do not know how you would do this but it is valuable. I believe some IPMI solutions would do it. Since I use software raid now for all my local srs (except mdadm root), then zfs notifications would be cool too, and mdadm.
edit1 For the record I know this is not an XAPI plugin, but I wanted to show my experiences.
edit2
I am also thinking that a possible configuration would be in order for smartd or something: *https://linuxconfig.org/how-to-configure-smartd-and-be-notified-of-hard-disk-problems-via-email *https://serverfault.com/questions/426761/is-smartd-properly-configured-to-send-alerts-by-email
+1 on this, any docs on how to start working on a plugin? We are about to roll custom scripts but would prefer a plugin.
The best place to look would be right here:
https://github.com/vatesfr/xen-orchestra/tree/master/packages
The packages have the core stuff, and plugins.
The best approach would be a full vertical integration between XAPI and XO.
I would start with a XAPI plugin first, and then we could expose that in XO.