Monitoraggio di mysql con Zabbix: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
| Line 1: | Line 1: | ||
=Agent2= | |||
* Creare lo user, con questi diritti: | |||
CREATE USER 'zabbix_agent'@'localhost' IDENTIFIED BY '<password>'; | |||
GRANT REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON *.* TO 'zabbix_agent'@'localhost'; | |||
* Definire le macro nel template Mysql Agent2 | |||
MYSQL_DSN | |||
MYSQL_PASSWORD | |||
MYSQL_USERNAME | |||
=Agent= | |||
* Sul server Zabbix, aggiungere il template | * Sul server Zabbix, aggiungere il template | ||
Template DB MySQL | Template DB MySQL | ||
Revision as of 14:03, 11 February 2023
Agent2
- Creare lo user, con questi diritti:
CREATE USER 'zabbix_agent'@'localhost' IDENTIFIED BY '<password>';
GRANT REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON *.* TO 'zabbix_agent'@'localhost';
- Definire le macro nel template Mysql Agent2
MYSQL_DSN MYSQL_PASSWORD MYSQL_USERNAME
Agent
- Sul server Zabbix, aggiungere il template
Template DB MySQL
- Sulla macchina da monitorare, creare l'utente di monitoraggio:
mysql -u root
create user 'zabbix_agent'@'localhost' IDENTIFIED BY 'Password';
GRANT USAGE ON *.* TO 'zabbix_agent'@'localhost' IDENTIFIED BY 'Password';
flush privileges;
exit
- Impostare la homedir per lo user zabbix:
systemctl stop zabbix-agent.service usermod zabbix --home /var/lib/zabbix systemctl start zabbix-agent.service
- Creare il file .my.cnf coi dettagli di login:
mkdir -p /var/lib/zabbix chown zabbix:zabbix /var/lib/zabbix
cd /var/lib/zabbix/ sudoedit .my.cnf
[mysql] user=zabbix_agent password=Password [mysqladmin] user=zabbix_agent password=Password
- impostare le permission
chown zabbix:zabbix .my.cnf chmod 0644 .my.cnf
- Verificare la connessione come zabbix agent:
echo "show databases;" | sudo -u zabbix mysql
Database information_schema
- Verificare che i trigger siano abilitati e non Unsupported