Major: NetXMS linux disk space check must know reserved blocks count
-
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 reservedRepeated 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 reservedDifference: 4%
-
Hmm.
Nope, here is somthing elseon 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 reservedDifference between df & NetXMS is 1% in this case. And 4% in previous case. WTF?
-
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 -
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 stupidEverything 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/storage1While 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% missedI 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? -
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login