Oliver2
(Oliver)
August 1, 2023, 7:15pm
1
An item receives from SNMP binding a dimensionless number which represents KBytes (e.g. 239000000).
I want the item to represent values as GBytes, so I did the following:
added Unit metadata and set the unit to „KiB“ according to the UoM documentation
added state description, pattern %.1f GiB
However, the item shows 0.2 GiB instead of 239 GiB.
Where is my error?
rlkoshak
(Rich Koshak)
August 1, 2023, 7:49pm
2
The Item type is what?
What do you see the Item changing to in events.log?
Where does the Item show the 0.2 GiB?
Oliver2
(Oliver)
August 1, 2023, 8:43pm
3
Sorry, I forgot to mention that I set the number type to Number:DataAmount
Another info (I wasn’t aware that changes on item definition raise a warning) from the log:
Unit 'KiB' could not be parsed to a known unit. Keeping old unit 'B' for item …
even KB did not work, too.
When the item changes its value the log file says:
'SNMPnas_SSD1StorageUsed' changed from 85809955 B to 85819987 B
rlkoshak
(Rich Koshak)
August 1, 2023, 9:01pm
4
OK, KiB isn’t already a known unit so you have to add a *
to it to show the multiplication of the units.
Ki*B
If it’s defaulting to Bytes that explains the discrepancy in the conversion.
Oliver2
(Oliver)
August 1, 2023, 9:05pm
5
I found out that kiB is working (as opposed to the documentation). Is this a bug or is documentation wrong?
rlkoshak
(Rich Koshak)
August 1, 2023, 9:22pm
6
Probably the documentation is wrong. If you look at the base 10 kilo prefix it uses the lower case k
in the docs too.
Oliver2
(Oliver)
August 1, 2023, 9:35pm
7
Ok, committed two changes on Github