daviswr / ZenPacks.daviswr.SMART

Storage device health monitoring for Zenoss
MIT License
0 stars 0 forks source link

VM detection (and skip) #10

Open sempervictus opened 2 years ago

sempervictus commented 2 years ago

A thought occurs: VMs and physical hosts often share organizers. The machine type information collected via SSH should provide a reasonable list of VM "hardware" (Qemu, VMWare, Xen, a cloud regex looking for OpenStack|Cloudstack|PublicCloudVendorString) which can be ignored by SMART tests entirely to save on processing and disk space.

daviswr commented 2 years ago

I think this might be solved with the recently-added zSmartIgnoreUnsupported property (d22ab5). By default, it won't model drives that report SMART support is: Unavailable - device lacks SMART capability any more, like QEMU disks.

That said, there is an optional method to implement in a modeler class called condition() and the device object is available there. Basically determines if it's appropriate to run the modeler at all. Here's an example. Unsure if that's necessarily the route I'd want to go, though.

Or were you thinking being able to ignore drives based on vendor/model? That should be pretty easy to implement.

sempervictus commented 2 years ago

I was thinking go off the host type - VMs can use "LSI" controllers which i've not tested for SMART output. So if the VM hardware type shows up as virtual, that would probably have the best coverage. However, going off the drive "hardware" manufacturer does seem easier and should cover the majority of use cases.

daviswr commented 2 years ago

Added a new zProperty, "zSmartIgnoreModels". Regex for vendors/models to ignore. For SCSI drives with separate Vendor and Product fields, I prepend Vendor to Product and then put it in the component's DeviceModel field, at which the zProp looks.

Funny thing, I'd forgotten something that actually makes zProperties accessible in a modeler until adding this one...

sempervictus commented 2 years ago

So i think this is now all contained in #6 and that's being worked out in a post-replacement-of-zenpack cycle. I'll leave it open for now, but its probably set as well.