Actually on the topic:
It costs Centos-8 and Zabbix-5.2.6.
There is a fleet of ElmetroViER-104K devices (more than 400 pieces) with MODBUS / TCP on board, sensors are connected to the devices,
if the sensor is broken or faulty, the float value NaN is written to the data register.
The devices are delicate, they do not like very much when they are often asked over TCP, well, once every couple of minutes, one request is tolerated,
those. you need to pull out a range of about 30 float-type registers in one request and then parse it into variables from one device,
so we create Data Item -> Type - Zabbix, Key -> modbus.get [tcp: // IP_HERE, 1,4,0,16, float, mbe], and create subordinate Data Items with preprocessing JSONPath -> $. [ register number],
if there is no NaN in the registers, then everything works fine, but if NaN appears, then the whole circuit breaks down,
those. the parent Data Item is required to return JSON something like [12.11,11.234, NaN, 123,456], and it just returns an error: Unable to create json: json: unsupported value: NaN.
I attach pictures showing this behavior.
I also looked at the source codes of the MODBUS module and you can see from them that this problem is in the pack2Json function (file ... / zabbix-5.2.6 / src / go / plugins / modbus / endianness.go), it uses the so-called jd serializer, jerr : = json.Marshal (arr)
and as they write on the Internet, he misunderstands NaN, unfortunately this is where my programming competence ends and I don't know how to fix it.
More about on