This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Is it correct to use 1024 for linux filesystems?

Hi All,

When I started working on disk rules, I thought of creating two rules by copying the original rule 'Disk Free Space' as file systems vary in both Operating Systems.

Windows - 1 KB (should actually display as KiB) is 1024 Bytes.

Linux - 1 KB (displayed correct) is 1000 Bytes.

If what I think is correct then the condition in the snip should be changed to 1000 for Linux boxes and should remain untouched for Windows boxes.

Reason why I am asking is 'cuz in real-time scenarios no system engineer should get call in the middle of night for a margin threshold miscalculation from the monitoring team.

Please provide your thoughts.

Thank You

AJ

  • Hi AJ,

     

    Thank you for the question. 

     

    In our Foglight, we have our data size standard. See below,

     

    The reason why we do this is to make the unit simple and consistent. Customers don't need to care about when they should use 1000 and when they should use 1024.

    The spaceAvailable metric you saw was identified as megabyte. Based on the Foglight Unit standard (1 megabyte = 1024 kilobyte = 1024 * 1024 byte), we collect the disk space or other metrics in Foglight by the powers of 1024.

    We used this command to collect the disk space. /bin/df -P -l -T -B 1K (more details for the command)

    The unit of values we get from this command is 1K (powers of 1024). And then we divide the value by 1024 and store to spaceAvailable metric as megabyte. In the rule you mentioned, we would like to show it as GB, so we divide 1024 again.

    I understand your concern. This would be confused to those who get accustomed with unit 1000 in Linux. But the Foglight standard is using the unit 1024. The feature implementation every in Foglight is relaying on this standard.

    Thanks & Regards,

    Howard Zhong

  • Thanks Howard for the information, however I still need some understanding.

    Below is the disk stats of a linux server and compared it with Foglight equivalent fields.

    If I take the first row of stats, assume it to drive 1, then dividing the available space from Foglight with 1024 matching the results of Free space in system stats i.e., 3566/1024 = 3.48.

    When I do the opposite i.e., calculating the system stats by taking used (31%) i.e., 

    used space = (31/100) * 5 (total space) = 1.55

    free space = total - used space = 5 - 1.55 = 3.45 which is different from free space 3.48

     

    Am I doing something wrong or calculating incorrectly?

     

    Thank You

    AJ

  • Take your data for example, used(%) = 1.52 / 5 * 100 % = 30.4%, this is the exact value. But Linux may round it up to 31%. If you used 31% to do the opposite calculation, it would be a little difference. :)

     

    Cheers,

    Howard

  • Thanks Howard, I understand Foglight uses 1024 and this gonna continue for future releases too. I'll make modifications to my rule. #spaceAvailable#/1024 is the value in GB, noted this too.