Forum

zabbix template: my...
 
Notifications
Clear all

zabbix template: mysql how to setup mysql login password, home directory for MySQL by Zabbix agent

1 Posty
2 Users
0 Reactions
2,520 Widok
0
Topic starter

error:

Preprocessing failed for: ERROR 1045 (28000): Access denied for user 'zabbix'@'localhost' (using password: NO)
1. Failed: cannot extract XML value with xpath "/resultset/row[field/text()='Uptime']/field[@name='Value']/text()": cannot parse xml value: Start tag expected, '<' not found
Requirements for template operation:
1.Install Zabbix agent and MySQL client.
2.Copy template_db_mysql.conf into folder with Zabbix agent configuration (/etc/zabbix/zabbix_agentd.d/ by default). Don't forget to restart zabbix-agent.
3.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 read the MySQL documentation  https://dev.mysql.com/doc/refman/8.0/en/grant.html  , please. 
4.Create .my.cnf in home directory of Zabbix agent for Linux (/var/lib/zabbix by default) or my.cnf in c:\ for Windows. For example:
[client]
user='zbx_monitor'
password='<password>'


You can discuss this template or leave feedback on our forum  https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/384189-discussion-thread-for-official-zabbix-template-db-mysql 

Template tooling version used: 0.42
1 Answer
0
Topic starter

set home directory for zabbix user

  1. cat /etc/passwd
  2. find "zabbix" user
  3. if there is nonexistent string, change it to /var/lib/zabbix or any other default home for user
  4. zabbix:x:123:128::/var/lib/zabbix:/usr/sbin/nologin
  5. nano /var/lib/zabbix/.my.cnf
  6. [client]
    user='zbx_monitor'
    password='<password>'
  7. chown -R zabbix:zabbix /var/lib/zabbix 
  8. service zabbix-agent restart

Odpowiedź

Author Name

Author Email

Your question *

Preview 0 Revisions Saved
Share: