Ad Widget

Collapse

Modbus in Zabbix

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • PAD
    Junior Member
    • Dec 2023
    • 2

    #1

    Modbus in Zabbix

    Hello,
    I want to use modbus in Zabbix.
    For this purpose I installed zabbix_agent2.
    What settings should I make in zabbix_agent2.conf file and what in modbus.conf file.

    Currently I have configured modbus.conf like this

    Plugins.Modbus.Timeout
    Plugins.Modbus.Sessions.MB1.Endpoint=tcp://xxx.xxx.xxx.yyy:502 (xxx.xxx.xxx.yyy its modbus device address )
    Plugins.Modbus.Sessions.MB1.SlaveID=1
    Plugins.Modbus.Sessions.MB1.Timeout=10

    But I don't know what settings to put on zabbix_agent2.conf​
  • Answer selected by PAD at 15-12-2023, 11:21.
    jeansieb
    Junior Member
    • Jan 2023
    • 3

    Originally posted by PAD
    I get an error message
    Testing
    root@zabbix01:/etc/zabbix# zabbix_agent2 --test "modbus.get[tcp://xxx.xxx.xxx.yyy:502,2,1,04100,1,,,1]" (xxx.xxx.xxx.yyy device IP)

    Answer
    modbus.get[tcp://xxx.xxx.xxx.yyy:502,2,1,04100,1,,,1][m|ZBX_NOTSUPPORTED] [Unable to read: read tcp xxx.xxx.xxx:56372->xxx.xxx.xxx.yyy:502: i/o timeout]
    (xxx.xxx.xxx Zabbix server IP)

    Where am I wrong​


    Also getting the same error.
    I can see with a tcpdump that the network packets are going back and forth between Zabbix and the host, but it seems like something is missing from Zabbix to understand what info is coming back.

    Comment


    • PAD
      PAD commented
      Editing a comment
      Do you have any idea where I need to adjust in Zabbix,
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    Make sure you have Include parameter in your agent2 config so your modbus conf will be included... nothing else, I think...

    Comment


    • PAD
      PAD commented
      Editing a comment
      Thanks
      I had Include=/etc/zabbix/zabbix_agent2.d/*.conf
      Now it is Include=/etc/zabbix/zabbix_agent2.d/modbus.conf
  • PAD
    Junior Member
    • Dec 2023
    • 2

    #3
    I get an error message
    Testing
    root@zabbix01:/etc/zabbix# zabbix_agent2 --test "modbus.get[tcp://xxx.xxx.xxx.yyy:502,2,1,04100,1,,,1]" (xxx.xxx.xxx.yyy device IP)

    Answer
    modbus.get[tcp://xxx.xxx.xxx.yyy:502,2,1,04100,1,,,1][m|ZBX_NOTSUPPORTED] [Unable to read: read tcp xxx.xxx.xxx:56372->xxx.xxx.xxx.yyy:502: i/o timeout]
    (xxx.xxx.xxx Zabbix server IP)

    Where am I wrong​

    Comment

    • jeansieb
      Junior Member
      • Jan 2023
      • 3

      #4
      Originally posted by PAD
      I get an error message
      Testing
      root@zabbix01:/etc/zabbix# zabbix_agent2 --test "modbus.get[tcp://xxx.xxx.xxx.yyy:502,2,1,04100,1,,,1]" (xxx.xxx.xxx.yyy device IP)

      Answer
      modbus.get[tcp://xxx.xxx.xxx.yyy:502,2,1,04100,1,,,1][m|ZBX_NOTSUPPORTED] [Unable to read: read tcp xxx.xxx.xxx:56372->xxx.xxx.xxx.yyy:502: i/o timeout]
      (xxx.xxx.xxx Zabbix server IP)

      Where am I wrong​


      Also getting the same error.
      I can see with a tcpdump that the network packets are going back and forth between Zabbix and the host, but it seems like something is missing from Zabbix to understand what info is coming back.

      Comment


      • PAD
        PAD commented
        Editing a comment
        Do you have any idea where I need to adjust in Zabbix,
    Working...