Mount not discovered by check_mk-mounts

CMK version:
2.2.0p39
OS version:
RHEL 9
Error message:

I want to monitor a bind mount.
The mount is done with following options:

mount -o bind,ro,nosuid,nodev,noexec

But the mount isnt discovered even that its in the agent´s section:

<<<mounts>>>
/dev/mapper/rhel_hostname-root / xfs rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,no
/dev/sda2 /boot xfs rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota 0 0
/dev/sda1 /boot/efi vfat rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shor
/dev/mapper/rhel_hostname-root /srv/monitoring/to_process xfs ro,nosuid,nodev,noexec,reloquota 0 0

If I do an enforced check I get this message:

Item not found in monitoring data

The other mounts form the agent´s output are discovered.

How can I monitor that the bind mount is done with correct options?

Thanks

Mike

Try to use the ruleset “File system discovery” to never ignore this mountpoint.

Thank you for that hint but its even not discovered as a file system :frowning:

The agent section is (more or less) the content of the file /proc/mounts.

The check plugin splits each line into device, mountpoint, type, and other fields and then remembers only one such line (actually the first one) per device.

This means, if the agent section contains

/dev/sda1 /home ...
/dev/sda2 /var ...
/dev/sda2 /tmp ...

then only the first line for /dev/sda2 (with /var...) is recognised. The other line is simply skipped by the check plugin as if the agent had never sent it.

Hence, you don’t see it and there’s no way to change that.

Execpt, of course, by writing an own plugin that also uses the <<<mount>>> section but behaves differently.

1 Like