Ad Widget

Collapse

Zabbix Modbus bitand

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bordo83
    Junior Member
    • Sep 2024
    • 4

    #1

    Zabbix Modbus bitand

    Dear all,
    we are using since some time Zabbix to monitor some modbus devices.
    All was fine with analog devices, every item had a specific address.
    Here an example of an item key: modbus.get[{$MB_TCP},255,,40004,,int16,,]
    Where {$MB_TCP} is the ip address of the device tcp://ip
    We are trying now to manage digital devices, every item has a specific bit on the same address.
    We are not able to figure out how to manage different bits on Zabbix. On other modbus software we were used to define, for example, address.bit item.
    Se we tried modbus.get[{$MB_TCP},255,1,40002.1,,bit,,] without success (Read Coil).
    We kindly ask support to understand if there's a way to use Zabbix for this purpose.
    Thanks in advance for the support.
    Regards.
  • bordo83
    Junior Member
    • Sep 2024
    • 4

    #2
    If this could help someone we resolved proceeding this way.
    Added a "standard" modbus item to retrieve the digital record (sum of all digital states), item key:
    modbus.get[{$MB_TCP},255,,40002,,int16,,]
    where {$MB_TCP} a host macro with the IP address of the device.
    Added X calculated items (one for every bit to check) with a key "modbus.bit1" (example to check bit 1) anc this formula:
    bitand(last(/HOST/modbus.get[{$MB_TCP},255,,40002,,int16,,]),1)
    Where last "1" is the bit to check, then will be 2 (for second bit), 4 (for third bit), 8 (for fouth bit) and so on.
    To get only 0 and 1 values we used a preprocessing java formula, example for third bit:
    if (value == 4)
    {value = 1;
    return value;}
    if (value ==0)
    {value = 0;
    return value;}
    Regards.

    Comment

    Working...