Linuxfabrik / monitoring-plugins

200+ 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
207 stars 48 forks source link

fs-ro: show mount point info on first line when there is only one hit #730

Closed kbucheli closed 3 months ago

kbucheli commented 6 months ago

As the first line is treated specially, eg. show in the Icingaweb overview, it would be handy if it would list there when there is just one mount point hit. I guess these are the most interesting cases.

Tests: Single hit

[root@test-004 ~]# monitoring-plugins/check-plugins/fs-ro/fs-ro 
read-only mount point found: /dev/loop0 on /mnt/iso (type iso9660)
[root@test-004 ~]#

Multiple hits:

[root@test-003 ~]# monitoring-plugins/check-plugins/fs-ro/fs-ro 
4 read-only mount points found:
* newperf on /gpfs/perf (type gpfs)
* newtiered on /gpfs/tiered (type gpfs)
* admin on /das/support (type gpfs)
* newphoto on /gpfs/photo (type gpfs)
[root@test-003 ~]# 

PS:

markuslf commented 3 months ago

Improved the code afterwards and added one more unit test.