Ad Widget

Collapse

Disk monitoring Inconsistency [Problem]

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • apachi
    Junior Member
    • May 2018
    • 10

    #1

    Disk monitoring Inconsistency [Problem]

    I have two different data

    1. CentOS Linux release 7.7.1908 (Core)
    df -h

    Disk size

    Click image for larger version

Name:	os.jpg
Views:	184
Size:	18.1 KB
ID:	438695

    2. Zabbix 5.4.3. © 2001–2021,
    Monitoring Disk space usage


    Click image for larger version

Name:	zabbix.jpg
Views:	150
Size:	20.8 KB
ID:	438696
    What could be the reason why there is a difference?

    thx
  • ISiroshtan
    Senior Member
    • Nov 2019
    • 324

    #2
    Well if you do simple math, you would find the answer.

    Zabbix calculates free space as 126.6/157.36 = 80.45% - matches what you see.

    Now if we take numbers from free.
    Calculate % based on used space - 127/158 = 80.37%, - we can assume free calculates it not this way, but it matches data from Zabbix
    Calculate % based on free space - 100 - (23/158)*100 = 100 - 14.55 = 85.44% - matches what free shows, so that's how it's calculated.

    Why difference tho? Lets check data from free: 127 used + 23 free = 150 GB. But actual disk size is 158 GB. So free does not account some 8GB. Sadly can not say why it does so,

    Hope it helps mate.

    Comment

    • tim.mooney
      Senior Member
      • Dec 2012
      • 1427

      #3
      Originally posted by ISiroshtan
      Why difference tho? Lets check data from free: 127 used + 23 free = 150 GB. But actual disk size is 158 GB. So free does not account some 8GB. Sadly can not say why it does so,
      Most Linux filesystems emulate a behavior that was common on Unix filesystems: "reserved" space. When a filesystem is created, you can decide how much space is set aside for "reserved space" (it can be adjusted for most filesystems using "tunefs", or tune2fs on Linux), that is only usable by processes running as the 'root' user.

      The discrepancy the 'df' command shows is because it doesn't account for this "reserved space". The reserved space is often called "minimum free space" or frequently on Linux, just "minfree".

      https://unix.stackexchange.com/quest...entage-purpose

      Comment

      Working...