Ad Widget

Collapse

Problems to monitorize mysql 8.0 on linux Ubuntu 20.04

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JorgeSach
    Junior Member
    • Jul 2022
    • 7

    #1

    Problems to monitorize mysql 8.0 on linux Ubuntu 20.04

    After installing the template MySQL by Zabbix agent 2 on my zabbix server 6.2 it doesnt works.

    I've two servers in my enviroment, zabbix principal frontend and a zabbix proxy (all the hosts pass trough the proxy)



    i`ve a recurrent message: Cannot fetch data: Error 1045: Access denied for user 'zbx_monitor'@'localhost' (using password: YES).



    I explain how configure the template and data like the instruccions of the template:
    1. Create MySQL user for monitoring (<password> at your discretion):



    CREATE USER 'zbx_monitor'@'%' IDENTIFIED BY '<password>';

    GRANT REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON . TO 'zbx_monitor'@'%';

    mysql> show GRANTS FOR 'zbx_monitor'@'%';
    ------------------------------------------------------------------------------------------
    | Grants for zbx_monitor@% |
    ------------------------------------------------------------------------------------------
    | GRANT PROCESS, SHOW DATABASES, REPLICATION CLIENT, SHOW VIEW ON . TO `zbx_monitor`@`%` |
    ------------------------------------------------------------------------------------------
    1 row in set (0,00 sec)

    {{}}
    1. Set on the mysql.conf inside /etc/zabbix/zabbix_agent2.d/plugins.d/mysql.conf
      1. Plugins.Mysql.Sessions.mysqld.Uri=unix:/var/run/mysqld/mysqld.sock
      2. Plugins.Mysql.Sessions.mysqld.User=zbx_monitor
      3. Plugins.Mysql.Sessions.mysqld.Password="PASSWORD"

    i asuming that its not necessary to declare userparameter in the configuration file, because if i make it, the agent crash

    cannot initialize user parameters: cannot register user parameter "mysql.ping[*], mysqladmin -h"$1" -P"$2" ping": key already used



    Ok, after that i assign the template to my example host.

    Recharge the configuration cache of my proxy.



    And zabbix show me the message of the issue all the time, it doesnt matter if i change the permissions on mysql, if i declare de macro data on the template (user,password, DSN). I dont know what to do.



    Help me please!
  • JorgeSach
    Junior Member
    • Jul 2022
    • 7

    #2
    SOLUTION:

    First in the mysql configuration file it contained the bind_address directive which was pointing to localhost, I have commented out that line.

    Second, the user contained some character in the password that for some reason did not authenticate correctly.

    Deleting the old user and creating a new one with the password with the changes made in the mysqld.conf file everything works correctly.

    Curious to say the least.

    Comment

    Working...