Ad Widget

Collapse

Cannot get Modbus to work

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • themailman
    Junior Member
    • Sep 2024
    • 6

    #1

    Cannot get Modbus to work

    To start of this, just want to start show what i have done. Btw i have checked if Modus working on my part, and it work with the right IP and Port. I run Agent2 on Docker and can ping to the host with modbus i want to use.

    First i started with adding the right values to agent2 env file to activate the Modbus plugin
    Code:
    Plugins.Modbus.Sessions.MB1.Endpoint=tcp://192.168.0.25:502
    Plugins.Modbus.Sessions.MB1.SlaveID=255
    Plugins.Modbus.Sessions.MB1.Timeout=10

    and i have checked it works by watching the LOG with DEBUG=4 values untagged.
    Code:
    [Modbus] Config is valid
    Plugin communication protocol version is 6.4.0
    starting manager​
    After that i just simply added a new item on the host with the Agent2 on it (IPC).



    After that i simply cant get any information.
    ​​

    This post is pretty short, but i got the impression that it was that easy.
    If i forgot anything please comment, i tried for too long to get this working but no luck.​​
  • themailman
    Junior Member
    • Sep 2024
    • 6

    #2
    Hey, just to give an update. I made it work.

    For any using agent2 in docker. I figured out that its not possible to use the env file of agent2 on docker for plugins, you have to edit the config file, in this case modbus.conf, and edit it. (I user docker compose).
    - ./env_vars/.env_modbus:/etc/zabbix/zabbix_agent2.d/plugins.d/modbus.conf


    I simply just added this in the bottom line of the conf:

    Plugins.Modbus.Sessions.MB1.Endpoint=tcp://192.168.0.25:502
    # Plugins.Modbus.Sessions.MB1.SlaveID=255
    Plugins.Modbus.Sessions.MB1.Timeout=10

    After that i used Zabbix Agent, not Zabbix Agent (Active). That is because i use active proxy, but the agent connect to the zabbix proxy, and the agent2 is not active, its passive.
    after that i added the item:
    modbus.get[MB1,,3,(register to get),1,int16,be,0]

    and it worked like a charm.

    Last edited by themailman; 06-09-2024, 11:51.

    Comment

    Working...