Hello,
I want to monitor MySQL instance with zabbix agent. MySQL is installed on the linux server Ubuntu 20.04.6 LTS (up to date), and the zabbix agent is in the version 4.0.17. i followed this instruction. The only difference was, that the zabbix system user did not have the home directory, so I used command:
then tested the MySQL user/password configuration
I can use mysql/mysqladmin programs without providing user/password as zabbix user. The MySQL's listening address and port are also correct in the zabbix macros.
I can execute this command without any problems
when i run the command:
I see some errors:
The definition for ping command from the /etc/zabbix/zabbix_agentd.conf.d/template_db_mysql.sql.conf file is:
so it looks like the zabbix agent do not inject localhost ($1) and port ($2) into executed commands.
The Zabbix Agent works in the Active Mode only. In the Zabbix Server's user interface I see various server metrics, like cpu, memory, etc, and the metrics are updated according to the interval. Unfortunately the items from the MySQL template are not executed The columns Last Check, Last Value are empty. No errors though. If I force the execution nothing really happens besides the success confirmation on the top of the screen "Request sent successfully"
I already saw this post, but my problem is different.
What am I missing?
I want to monitor MySQL instance with zabbix agent. MySQL is installed on the linux server Ubuntu 20.04.6 LTS (up to date), and the zabbix agent is in the version 4.0.17. i followed this instruction. The only difference was, that the zabbix system user did not have the home directory, so I used command:
Code:
sudo usermod -d /var/lib/zabbix zabbix
Code:
sudo su -l zabbix -s /bin/bash mysql
I can execute this command without any problems
Code:
zabbix_agentd -t "mysql.ping[localhost,3306]"
Code:
sudo zabbix_agentd -p
Code:
mysql.ping [t|mysqladmin: connect to server at '-P' failed error: 'Unknown MySQL server host '-P' (-2)' Check that mysqld is running on -P and that the port is 3306. You can check this by doing 'telnet -P 3306'] mysql.get_status_variables [t|ERROR 2005 (HY000): Unknown MySQL server host '-P' (-2)] mysql.version [t|] mysql.db.discovery [t|ERROR 2005 (HY000): Unknown MySQL server host '-P' (-2)] mysql.dbsize [t|ERROR 2005 (HY000): Unknown MySQL server host '-P' (-2)] mysql.replication.discovery [t|ERROR 2005 (HY000): Unknown MySQL server host '-P' (-2)] mysql.slave_status [t|ERROR 2005 (HY000): Unknown MySQL server host '-P' (-2)]
Code:
UserParameter=mysql.ping[*], mysqladmin -h"$1" -P"$2" ping
The Zabbix Agent works in the Active Mode only. In the Zabbix Server's user interface I see various server metrics, like cpu, memory, etc, and the metrics are updated according to the interval. Unfortunately the items from the MySQL template are not executed The columns Last Check, Last Value are empty. No errors though. If I force the execution nothing really happens besides the success confirmation on the top of the screen "Request sent successfully"
I already saw this post, but my problem is different.
What am I missing?
Comment