Linuxfabrik / monitoring-plugins

220+ check plugins for Icinga and other Nagios-compatible monitoring applications. Each plugin is a standalone command line tool (written in Python) that provides a specific type of check.
https://linuxfabrik.ch
The Unlicense
214 stars 49 forks source link

disk-io - add iops and improve match condition #772

Open leo-pempera opened 3 months ago

leo-pempera commented 3 months ago

The following two features were added:

The iops part was added via the psutil.disk_io_counters, which is already used for all the other metrics. I renamed some variables to make it clear what iops and bandwidth is. Also the naming of some variables with xxx15 was misleading, as the default count is 5.

As for the ability to monitor disks not automatically found via the match argument. I found myself in the situation that on numerous servers, e.g. ones with zfs, the get_real_disks() would not pick up on them as they are not mounted in the typical way. Instead monitorig the raw devices was necessary. In my patch i included the option when the match argument is given, all disks from psutil.disk_io_counters will be taken into account including the found real disks. After that the regex match will be applied to the list. This behaviour is there to make the check exactly as it was working before, as with the default there is no match argument. Only if someone wants to specifiy exactly what disks to monitor, the match argument will include all the disks.