Skip to content

Commit

Permalink
fs-ro: Add /dev/loop to default ignore list
Browse files Browse the repository at this point in the history
  • Loading branch information
markuslf committed Dec 12, 2023
1 parent 137a572 commit b51b0e6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Icinga Director:

Monitoring Plugins:

* fs-ro: Add `/dev/loop` to default ignore list
* fs-ro: make output better readable ([PR #729](https://github.com/Linuxfabrik/monitoring-plugins/issues/729), thanks to [Konrad Bucheli](https://github.com/kbucheli))
* infomaniak-events: Fix `UnboundLocalError: local variable 'keys' referenced before assignment`


Expand Down
12 changes: 7 additions & 5 deletions check-plugins/fs-ro/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Check fs-ro
Overview
--------

This plugin checks for read-only mount points, such as ``/`` mounted read-only due to file system errors, mounted CD-ROMs or ISO files, etc. It always ignores ramfs and squashfs (snapd) by default.
This plugin checks for read-only mount points, such as ``/`` mounted read-only due to file system errors, mounted CD-ROMs or ISO files, etc. It always ignores loops, ramfs and squashfs (snapd) by default.


Fact Sheet
Expand All @@ -26,16 +26,18 @@ Help
usage: fs-ro [-h] [-V] [--always-ok] [--ignore IGNORE] [--test TEST]
Warns if a file system is mounted read-only.
This plugin checks for read-only mount points, such as `/` mounted read-only
due to file system errors, mounted CD-ROMs or ISO files, etc. It always
ignores ramfs and squashfs (snapd) by default.
optional arguments:
options:
-h, --help show this help message and exit
-V, --version show program's version number and exit
--always-ok Always returns OK.
--ignore IGNORE Mount point that should be ignored (repeatable). For
example, if you provide `/sys/fs`, all mount points
starting with `/sys/fs` will be ignored. Default: ['/proc',
'/snap', '/sys/fs']
starting with `/sys/fs` will be ignored. Default:
['/dev/loop', '/proc', '/snap', '/sys/fs']
--test TEST For unit tests. Needs "path-to-stdout-file,path-to-stderr-
file,expected-retc".
Expand Down
6 changes: 3 additions & 3 deletions check-plugins/fs-ro/fs-ro
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ from lib.globals import (STATE_OK, STATE_UNKNOWN, # pylint: disable=C0413
STATE_WARN)

__author__ = 'Linuxfabrik GmbH, Zurich/Switzerland'
__version__ = '2023112901'
__version__ = '2023121201'

DESCRIPTION = """This plugin checks for read-only mount points, such as `/` mounted read-only due
to file system errors, mounted CD-ROMs or ISO files, etc. It always ignores ramfs
and squashfs (snapd) by default."""

DEFAULT_IGNORE = ['/proc', '/snap', '/sys/fs']
DEFAULT_IGNORE = ['/dev/loop', '/proc', '/snap', '/sys/fs']


def parse_args():
Expand Down Expand Up @@ -120,7 +120,7 @@ def main():
lib.txt.pluralize('point', len(ros)),
)
for item in ros:
msg += '{}\n'.format(item)
msg += '* {}\n'.format(item)
msg = msg[:-2]
state = STATE_WARN
else:
Expand Down
9 changes: 5 additions & 4 deletions check-plugins/fs-ro/icingaweb2-module-director/fs-ro.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
"disabled": false,
"fields": [
{
"datafield_id": 426,
"datafield_id": 1,
"is_required": "n",
"var_filter": null
},
{
"datafield_id": 427,
"datafield_id": 2,
"is_required": "n",
"var_filter": null
}
Expand Down Expand Up @@ -78,6 +78,7 @@
"criticality": "A",
"fs_ro_always_ok": false,
"fs_ro_ignore": [
"/dev/loop",
"/proc",
"/snap",
"/sys/fs"
Expand All @@ -89,7 +90,7 @@
}
},
"Datafield": {
"426": {
"1": {
"varname": "fs_ro_always_ok",
"caption": "FS RO: Always OK?",
"description": "Always returns OK.",
Expand All @@ -98,7 +99,7 @@
"settings": {},
"uuid": "710cb1d6-b40e-4485-be7d-19c9fffe9085"
},
"427": {
"2": {
"varname": "fs_ro_ignore",
"caption": "FS RO: Ignore",
"description": "Mount point that should be ignored (repeatable). For example, if you provide `/sys/fs`, all mount points starting with `/sys/fs` will be ignored. ",
Expand Down

0 comments on commit b51b0e6

Please sign in to comment.