Ad Widget

Collapse

problem monitoring mariadb 10.6.7

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shaund1965@gmail.com
    Junior Member
    • Jun 2020
    • 5

    #1

    problem monitoring mariadb 10.6.7

    Hi all.

    I have updated my mariadb to version 10.6.7 on a host that I monitoring and am no longer able to monitor it. A few things have changed in the way that authentication is performed, and a message from mariadb breaks the template. The message is:
    Code:
    "WARNING: Forcing protocol to TCP due to option specification. Please explicitly state intended protocol".
    To rectify this, I have made the following changes:
    Code:
    Add HOME=/var/lib/zabbix in template_db_mysql.conf to force user zabbix to use the .my.cnf file.
    Add protocol=tcp to /var/lib/zabbix/.my.cnf to eradicate the error message from mariadb 10.6.7
    From the command line, I am able to run the mysql.ping command as user zabbix:
    Code:
    sudo -u zabbix mysqladmin -h"localhost" -P"3306" ping
    mysqld is alive
    However, when I run zabbix_get from the server, I get:
    Code:
    zabbix_get -s xxxx.xxxx.xxxx.xxxx -p 10050 -k mysql.ping["localhost","3306"]
    ZBX_NOTSUPPORTED: Unsupported item key.
    If I set the debug level of the zabbix agent on the host to 4 and run a zabbix_get, I see the following in the agent log:
    Code:
    18095:20220511:112508.305 Requested [mysql.ping[localhost,3306]]
    18095:20220511:112508.305 Sending back [ZBX_NOTSUPPORTED: Unsupported item key.]
    I am using zabbix server 6.0.1 and agent 6.0.3. I am also monitoring older mariadb and mysql instances on other hosts without issues.

    Any help would be appreciated.

    Shaun



  • Answer selected by [email protected] at 12-05-2022, 10:14.
    Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1781

    HOME is not a valid configuration parameter in Zabbix agent configuration file. That should generate error (shown in journalctl -eu zabbix-agent) when you try to restart the agent. Maybe you haven't restarted the agent at all after adding the .conf file? That would explain why you get "Unsupported item key" error.

    Remove the separate HOME line and try this instead:

    Code:
    UserParameter=mysql.ping[*], HOME=/var/lib/zabbix mysqladmin -h"$1" -P"$2" ping

    Markku

    Comment

    • Markku
      Senior Member
      Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
      • Sep 2018
      • 1781

      #2
      How is your mysql.ping userparameter configured?

      Markku

      Comment

      • shaund1965@gmail.com
        Junior Member
        • Jun 2020
        • 5

        #3
        Hi Markku.
        It is the default file as below:
        #template_db_mysql.conf created by Zabbix for "Template DB MySQL" and Zabbix 4.2
        #For OS Linux: You need create .my.cnf in zabbix-agent home directory (/var/lib/zabbix by default)
        #For OS Windows: You need add PATH to mysql and mysqladmin and create my.cnf in %WINDIR%\my.cnf,C:\my.cnf,BASEDIR\my.cnf https://dev.mysql.com/doc/refman/5.7...ion-files.html
        #The file must have three strings:
        #[client]
        #user='zbx_monitor'
        #password='<password>'
        #

        HOME=/var/lib/zabbix
        UserParameter=mysql.ping[*], mysqladmin -h"$1" -P"$2" ping
        UserParameter=mysql.get_status_variables[*], mysql -h"$1" -P"$2" -sNX -e "show global status"
        UserParameter=mysql.version[*], mysqladmin -s -h"$1" -P"$2" version
        UserParameter=mysql.db.discovery[*], mysql -h"$1" -P"$2" -sN -e "show databases"
        UserParameter=mysql.dbsize[*], mysql -h"$1" -P"$2" -sN -e "SELECT COALESCE(SUM(DATA_LENGTH + INDEX_LENGTH),0) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='$3'"
        UserParameter=mysql.replication.discovery[*], mysql -h"$1" -P"$2" -sNX -e "show slave status"
        UserParameter=mysql.slave_status[*], mysql -h"$1" -P"$2" -sNX -e "show slave status"
        I have only added the HOME=/var/lib/zabbix line.

        Regards.
        Shaun


        Comment

        • Markku
          Senior Member
          Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
          • Sep 2018
          • 1781

          #4
          HOME is not a valid configuration parameter in Zabbix agent configuration file. That should generate error (shown in journalctl -eu zabbix-agent) when you try to restart the agent. Maybe you haven't restarted the agent at all after adding the .conf file? That would explain why you get "Unsupported item key" error.

          Remove the separate HOME line and try this instead:

          Code:
          UserParameter=mysql.ping[*], HOME=/var/lib/zabbix mysqladmin -h"$1" -P"$2" ping

          Markku

          Comment

          • shaund1965@gmail.com
            Junior Member
            • Jun 2020
            • 5

            #5
            Thanks Markku. When I checked journalctl, there were no errors, so it made me think that it was not loading the config file. From that I found my error. I had template_db_mysql.conf in /etc/zabbix/zabbix_agentd.conf.d instead of /etc/zabbix/zabbix_agentd.d/. So that is why it was not loading :-(
            I moved it to the correct directory and then when I tried to restart, it failed due to the HOME= directive as you said. Added the HOME directive to each UserParameter and PRESTO, everything works.
            Thanks so much for the help.
            Regards.
            Shaun

            Comment

            • Markku
              Senior Member
              Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
              • Sep 2018
              • 1781

              #6
              Great, thanks for reporting back.

              Markku

              Comment

              Working...