inverse-inc / packetfence

PacketFence is a fully supported, trusted, Free and Open Source network access control (NAC) solution. Boasting an impressive feature set including a captive-portal for registration and remediation, centralized wired and wireless management, powerful BYOD management options, 802.1X support, layer-2 isolation of problematic devices; PacketFence can be used to effectively secure networks small to very large heterogeneous networks.
https://packetfence.org
GNU General Public License v2.0
1.39k stars 291 forks source link

monit check disk size is not thrustable with docker layers #8381

Open JeGoi opened 3 weeks ago

JeGoi commented 3 weeks ago

Describe the bug Monit is managing disk space issues but the script is not able to handle docker overlayers. Docker root folder may contain files from other folders, such as mounted to merged, if you test the disc usage with or without "-x" of du (or ncdu), it will exclude those files out and the reduction is drastic. So, monit is lying with the current disk usage. du -x is better and df is giving something not that bad.

To Reproduce Steps to reproduce the behavior:

  1. rebuild several images at several point of time (like every 3 month
  2. do: du -h -d1 -x / , du -h -d1 / and df -h you will see difference in disk size available.

Screenshots ncdu without -x Screenshot from 2024-11-06 15-08-59 ncdu with -x Screenshot from 2024-11-06 15-23-38

and df Screenshot from 2024-11-06 15-55-14

Expected behavior Having a clear (better view) of disk space available and send email only when really needed.