Ad Widget

Collapse

Agent2 MQTT Plugin issue - time out while subscribing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Timo Hein
    Junior Member
    • Jun 2024
    • 6

    #1

    Agent2 MQTT Plugin issue - time out while subscribing

    Hello everyone,

    I have a problem with the Agent2 and the MQTT plugin.
    I have 14 hosts and about 1500 items to read so far. (later there will be more)
    All via one Agent2, as the hosts are industrial controllers.
    If the number of items exceeds approx. 1000 (sometimes even less), I get the following error message “time out while subscribing” for almost all items.



    The setting “Timeouts for items types” seems to have no influence on the MQTT plugin.
    Does anyone have an idea if there is a setting to increase the timeout or if there is a way to find out why it takes so long to subscribe?

    Greetings Timo​
  • t00m1G
    Junior Member
    • Jan 2024
    • 26

    #2
    Hey,

    Everything about Agent2 you need to set in zabbix_agent2.conf file - in there you have section "PluginTimeout", but at first it would be better to check out agent2 logs. Logs might also help you with this: "if there is a way to find out why it takes so long to subscribe?"

    Could you please provide logs for agent2? and if it's possible change DebugLevel in config to level 4 (config file name is: zabbix_agent2.conf), and then provide logs - you can read more about that here: https://www.zabbix.com/documentation...nt2#debuglevel
    version for Agent2 (windows) if needed:

    Comment

    • Timo Hein
      Junior Member
      • Jun 2024
      • 6

      #3
      Hello,

      Thank you for your reply.
      I have already set this option “PluginTimeout” to the maximum of 30 seconds. I have also set the “Timeout” option to the maximum. Neither had any effect.
      I have also checked the log file of Agent2 and the Zabbix service and raised the debug level. Unfortunately, I only found the same message there “timeout while subscribing”, but no reason for this.
      As a “solution” I have now distributed the hosts to several Agent2s running in LXC containers. Now there are no more timeouts.
      I don't think this is a good solution, because you don't know how many items lead to a timeout.

      Comment


      • t00m1G
        t00m1G commented
        Editing a comment
        hey,
        if there is possibility to do that, I would recommend to use tool like tcpdump to create .pcap file to further analyse of that issue, later you can use Wireshark to analyse that file, to see what's happening. But, I think that might be problem with big amount of items - there might be a need to see how your whole Zabbix instance is built.
        there is also old discussion about similar issue, maybe it would also help you, here is link: https://www.zabbix.com/forum/zabbix-...-timeout/page2
    • Timo Hein
      Junior Member
      • Jun 2024
      • 6

      #4
      Thanks for your answer t00m1G.

      I'll have to see how I do it with tcpdump.
      I had a look at the post from your link.
      This is about the agent in version 6.4.12 and 6.4.16.
      I have Zabbix in version 7.0.2 and Agent2 in version 7.0.2.
      The number of items (metrics) is much higher than described in the post and the connection is not unstable, but is not even established when the system is (re)started.

      Comment

      • Timo Hein
        Junior Member
        • Jun 2024
        • 6

        #5
        Hello,
        After some additional tests, I found out, that the problem is not the number of the items per host. It's the number of hosts.
        The error occurs if the number of hosts, which is configured in the agent2 configuration file, is greater than (in my case) eight.
        This means, if the MQTT-plugin of the agent2 needs to subscribe more than eight topics it takes longer than a timeout X which I cannot influence.
        The strangest thing is that not all subscriptions fail, some of the subscriptions still work.
        Any suggestions?

        Comment

        • Timo Hein
          Junior Member
          • Jun 2024
          • 6

          #6
          Hello,
          I have carried out a clean installation on another system.
          I found out that with version 7.0.3 of the agent the problem gets worse.
          I have configured the agent with 4 hosts, 1 host is the agent itself, 3 hosts work with mqtt and have 42 subscribed items.

          Here is a short excerpt from the log file:

          2024/09/13 07:38:17.805204 [MQTT] connection lost to [tcp://10.83.134.212:1883]: pingresp not received, disconnecting
          2024/09/13 07:38:17.805973 [MQTT] connected to [tcp://10.83.134.212:1883]

          2024/09/13 07:39:17.807394 [MQTT] cannot subscribe topic 'VSW02/#' to [tcp://10.83.134.212:1883]: timed out while subscribing
          2024/09/13 07:39:17.807462 [MQTT] connection lost to [tcp://10.83.134.212:1883]: pingresp not received, disconnecting
          2024/09/13 07:39:17.808604 [MQTT] connected to [tcp://10.83.134.212:1883]

          I also tried to install version 7.0.1 of the agent and get the following message:

          apt install zabbix-agent2=7.0.1-1
          Package zabbix-agent2 is not available, but is referred to by another package.
          This may mean that the package is missing, has been obsoleted, or
          is only available from another source

          E: Version '7.0.1-1' for 'zabbix-agent2' was not found

          Does anyone have any ideas what else I can do? zz0.g66as0u4umqzz

          Comment

          • klandos
            Junior Member
            • Sep 2024
            • 7

            #7
            As written here:

            Version 6.2.9 seems to be working without problems.

            Comment

            • roteki
              Junior Member
              • Oct 2024
              • 11

              #8
              i have found this file /etc/zabbix/zabbix_agent2.d/plugins.d/mqtt.conf in which i have configured the options, then idk how to continue the configuration, I have read https://www.zabbix.com/fr/integrations/mqtt#mqtt but I couldn't understand quite well what must I do next
              if you can tell me please in details how to configure the plugin
              I'm using zabbix 7.0.5 btw

              Comment

            Working...