Storage units in plugin output does not respect the IEEE 1541-2002 standard
Hi,
With the Centreon plugin to monitor Linux with SNMP (centreon_linux_snmp.pl), when using the "storage" mode, the plugin output uses the unit "GB", but it should be "GiB" (as it’s a value which is a multiple of 1024, not 1000).
Tested with centreon-plugin-Operatingsystems-Linux-Snmp-20210622-151444.el7.centos.noarch
https://en.wikipedia.org/wiki/IEEE_1541-2002
Yes you're right. But the usage is quite different. For example, we don't see that for memoryn network,.... And nearly used for disk storage. I'm not sure in which case to use it.
This norm isn’t about storage, it’s about the base used for the prefix. If you have a transfer rate of 1kb/s, then it means 1000 bits per second. If it’s 1024 bits per second it should be written 1kib/s. For the network, if I’m not mistaken, the usage has always been 1kb = 1000b, so there is no problem.
I know the usage still is to consider than a "kilo-byte" is 1024 bytes, but it’s 1000 bytes. 1024 bytes is now (since 2012) called a "kibi-bytes".
If you don’t stick to the norm just because of the usage, the norm would never become the usage…
One related remark : shouldn’t the templates in the packs set "Storage" as graphic type when it makes sens? Currently the plugin output tells "X GB" and the value in the graphic tells "Y GB", with Y > X, just because the plugin uses multiple of 1024 whereas the graphic uses multiple of 1000. Could be puzzling for new users imo.
I could change the output (for the perfdata it's always B or b. so there is no issue about it).
Yes, no issue with perfdata. It has to use the basic unit and must not include any prefix. I absolutely agree with that.
The problem I pointed in the last paragraph is that the "Graph model" should be set to "Storage" on the service models which require it. I don’t know if this setting can be included in the packs (can’t see why not ?) but if it’s the case then it should.
Finally, yes, in the plugin output, you should use ki,Mi,Gi,Ti,… when it’s a power of 1024, and k,M,G,T when it’s a power of 1000. I’m curious if anyone sees any drawback to this. It would eventually break a script which would parse the plugin output but I don’t think it’s a common use case, plus, you’ve already broke some well more critical aspects of the plugins to be upset with such a tiny, rather cosmetic impact ;)
It's not an issue related to centreon-plugins for graph model. It's not the right place.
OK. So let’s focus on the display issue here. I guess the pack related issues go to centreon/centreon ?
Indeed!