Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-18390

zabbix-agent2 "driver: bad connection" on MySQL check

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 5.0.3
    • None
    • None
    • Debian 10
      mariadb-server-10.3 1:10.3.23-0+deb10u1
      zabbix-agent2 1:5.0.3-1+buster

      I have a MariaDB server in which I created a user according to "Template DB MySQL by Zabbix agent 2" instruction.
      Next to it, I have zabbix-agent2 with the following config:

      $ egrep -v '^#|^$' /etc/zabbix/zabbix_agent2.conf
      PidFile=/var/run/zabbix/zabbix_agent2.pid
      LogFile=/var/log/zabbix/zabbix_agent2.log
      LogFileSize=0
      ServerActive=example.org,<server external IP>
      Hostname=server.example.org
      Include=/etc/zabbix/zabbix_agent2.d/*.conf
      ControlSocket=/tmp/agent.sock
      

      In the web-interface, I have "Template DB MySQL by Zabbix agent 2" added to that host. The only alteration I made is I changed the items' type from "Zabbix Agent" to "Zabbix Agent ("active") to make it work without incoming connections, but the problem manifested itself before that change as well.

      The problem is that MySQL data from the agent comes in a very unreliable manner. Here is the log of the agent:

      $ tail -1000 /var/log/zabbix/zabbix_agent2.log | cut -d ' ' -f 3- | sort | uniq -c
          264 check 'mysql.db.discovery["unix:/var/run/mysqld/mysqld.sock","zbx_monitor","password"]' is not supported: driver: bad connection
          263 check 'mysql.db.size["unix:/var/run/mysqld/mysqld.sock","zbx_monitor","password","db_name"]' is not supported: driver: bad connection
          209 check 'mysql.db.size["unix:/var/run/mysqld/mysqld.sock","zbx_monitor","password","other_db_name"]' is not supported: driver: bad connection
          264 check 'mysql.get_status_variables["unix:/var/run/mysqld/mysqld.sock","zbx_monitor","password"]' is not supported: driver: bad connection

      And here is what I see in the web-interface:

      Data collection flaps with an unhelpful error message. MySQL error log:

      $ grep zbx_monitor /var/log/mysql/error.log
      <...>
      2020-09-18  1:23:27 611815 [Warning] Aborted connection 611815 to db: 'unconnected' user: 'zbx_monitor' host: 'localhost' (Got an error writing communication packets)
      2020-09-18  1:23:48 611818 [Warning] Aborted connection 611818 to db: 'unconnected' user: 'zbx_monitor' host: 'localhost' (Got timeout reading communication packets)
      $ grep zbx_monitor /var/log/mysql/error.log | grep -c 'Got an error writing communication packets'
      1
      $ grep zbx_monitor /var/log/mysql/error.log | grep -c 'Got timeout reading communication packets'
      129

      The fact that the message is unhelpful could be attributed to MySQL library, however, it could be wrapped with more context which will be helpful.

      Also if there is a way to help me figure out why exactly this is happening, I would be very grateful.

            rvaliahmetovs Renats Valiahmetovs (Inactive)
            Paskal Dmitry Verkhoturov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: