Ad Widget

Collapse

I can't Monitor Mysql by zabbix-agent2 template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • reyhane
    Junior Member
    • Jan 2023
    • 12

    #1

    I can't Monitor Mysql by zabbix-agent2 template

    Please Help!!

    I installed zabbix 6.0.11 LTS and I can't monitor my databases.I'm on this since forever and I've done anything that where online or at troubleshooting communities.
    I followed "MySQL by Zabbix agent 2" instruction:

    Requirements for template operation:
    1. Create MySQL user for monitoring. For example:
    CREATE USER 'zbx_monitor'@'%' IDENTIFIED BY '<password>';
    GRANT REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON *.* TO 'zbx_monitor'@'%';
    For more information please read the MySQL documentation https://dev.mysql.com/doc/refman/8.0/en/grant.html.
    2. Set in the {$MYSQL.DSN} macro the data source name of the MySQL instance either session name from Zabbix agent 2 configuration file or URI.
    Examples: MySQL1, tcp://localhost:3306, tcp://172.16.0.10, unix:/var/run/mysql.sock
    For more information about MySQL Unix socket file please read the MySQL documentation https://dev.mysql.com/doc/refman/8.0...ysql-sock.html.
    3. If you had set URI in the {$MYSQL.DSN}, please define the user name and password in host macros ({$MYSQL.USER} and {$MYSQL.PASSWORD}).
    Leave macros {$MYSQL.USER} and {$MYSQL.PASSWORD} empty if you use a session name. Set the user name and password in the Plugins.Mysql.<...> section of your Zabbix agent 2 configuration file.
    For more information about configuring the Zabbix MySQL plugin please read the documentation https://git.zabbix.com/projects/ZBX/...ysql/README.md.


    You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-...plate-db-mysql

    Template tooling version used: 0.41​

    and my macro section looks like this:

    Click image for larger version

Name:	image.png
Views:	918
Size:	153.2 KB
ID:	457154

    I also put DNS,USER,Password info at mysql.conf in plugin folder:

    Click image for larger version

Name:	image.png
Views:	797
Size:	94.5 KB
ID:	457155

    but it's not working and I don't have a clue what to do anymore!!

    (I even tried not putting the macro info at mysql.conf but the result was the same)

    these are my zabbix-server and zabbix-agent2 logs:

    Click image for larger version

Name:	image.png
Views:	785
Size:	75.1 KB
ID:	457156

    Click image for larger version

Name:	image.png
Views:	793
Size:	106.1 KB
ID:	457157
  • reyhane
    Junior Member
    • Jan 2023
    • 12

    #2
    SOLVED!

    Apparently agent2 wasn't running because port 10050 was using by agent.
    So I removed (and for ensuring,purge) zabbix and installed it without zabbix-agent.
    It is fixed.

    Comment

    Working...