Author Topic: Major: NetXMS linux disk space check must know reserved blocks count  (Read 6024 times)

CTXM

  • Newbie
  • *
  • Posts: 15
    • View Profile
extX partitions reserves some % of blocks (which can be freed most time, but no one does that :) ).

I have noticed, that free space reported by NetXMS agent differs from what is seen using "df".
I see only one explanation - NetXMS check does not pay an attention to reserved block count.

Detailed:


NetXMS agent ver: 0.2.27
Space check via DiskFreePerc

[root@XXX ~]# df -kh
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              12G  8.7G  2.3G  80% /
...
[root@XXX ~]# tune2fs -l /dev/sda2
...
Block count:                  3072431
Reserved block count:     153621
...

* df shows 20% free space.
* NetXMS reports 24% for this mountpoint (I have looked a bit later +/- 1%)
* 4,99% approx reserved


Repeated once again:

[root@XXX ~]# df -kh
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              12G  8.3G  2.8G  76% /
...

[root@XXX ~]# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda2             12096756   8642080   2840192  76% /
...


* df shows 76% used space.
* NetXMS shows 28% free space
* 4,99% approx reserved

Difference: 4%
« Last Edit: February 25, 2010, 02:21:11 pm by CTXM »

CTXM

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Major: NetXMS linux disk space check must know reserved blocks count
« Reply #1 on: February 24, 2010, 01:31:58 pm »
Hmm.
Nope, here is somthing else

on an another machine, with almost same parameters, data differs:

NetXMS agent: 0.2.19

[root@YYY ~]# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda2             12096756   3191224   8291048  28% /

[root@YYY ~]# df -kh
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              12G  3.1G  8.0G  28% /
...

[root@YYY ~]# tune2fs -l /dev/sda2
...
Block count:                  3072431
Reserved block count:     153621
...

* df shows 28% used space
* NetXMS shows 73% free disk space
* 4,99% approx reserved

Difference between df & NetXMS is 1% in this case. And 4% in previous case. WTF?

Victor Kirhenshtein

  • Lead Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 7137
    • View Profile
Re: Major: NetXMS linux disk space check must know reserved blocks count
« Reply #2 on: February 24, 2010, 02:36:37 pm »
There are two parameters for disk space on UNIX: Disk.Free (or Disk.FreePerc) and Disk.Avail (or Disk.AvailPerc). First shows total amount of free space, including reserved blocks. Second shows free space available to non-root users - free space without reserved blocks. You should compare Disk.Avail results with df output.

Best regards,
Victor

CTXM

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Major: NetXMS linux disk space check must know reserved blocks count
« Reply #3 on: February 25, 2010, 03:55:31 pm »
There are 2 situations described:

1st with server XXX, which shows how bad is to do not read manual. Actually, I have seen Disk.Free & Disk.Avail, but didn`t udnerstand from an explanation that difference is about reserved blocks, so i throw it :( :$ Sorry. Looks stupid

Everything okay with this server. Checks works fine.


2nd situation is with server YYY.

I have added Disk.Avail and got 5% difference with DiskFree.  
But reported data still doesn`t fit together with DF produced one.
With Disk.Avail - 1-4% misses (on different size partitions) !!!


[root@YYY netxms-0.2.31]# df -kh
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              12G  3.1G  7.9G  29% /
...
/dev/sda5              48G   31G   15G  69% /export/stroage0
/dev/sdb1             268G   73G  182G  29% /export/storage1

While NetXMS reports free space:

/                       - 68   ::: 100 - 29 = 71 : 3% missed
/export/stroage0 - 30   ::: 100 - 69 = 31 : 1% missed
/export/storage1 - 67   ::: 100 - 29 = 71 : 4% missed


I did NetXMS agent ugrade from 0.2.19 to 0.2.31, but this didn`t changed situation.
Someone lies - either DF, either NetXMS. :)

Also, seems, it is specific to server environment, because on server XXX checks works as expected.
Could it be so?
« Last Edit: February 25, 2010, 04:10:42 pm by CTXM »

CTXM

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Major: NetXMS linux disk space check must know reserved blocks count
« Reply #4 on: February 25, 2010, 05:16:01 pm »

Also, feel free to move this topic to general support tree - to keep forum clean :)