Cacti monitoring MySQL1. install monitoring plug-in cdoptwgetmysql-cacti-templates.googlecode.comfilesmysql-cacti-templates-1.1.2
Cacti monitoring MySQL1. install monitoring plug-in cd/optwget http://mysql-cacti-templates.googlecode.com/files/mysql-cacti-templates-1.1.2
Cacti monitors MySQL
1. Install the monitoring plug-in
Cd/opt
Wget
Tar-xzvf mysql-cacti-templates-1.1.2.tar.gz
Cp/opt/mysql-cacti-templates-1.1.2/ss_get_mysql_stats.php/var/www/html/scripts/
Chown-R apache. apache/var/www/html/scripts
Chmod-R 755/var/www/html/scripts
Use http to access the cacti host import/opt/mysql-cacti-templates-1.1.2/cacti_host_template_x_db_server_ht_0.8.6i.xml
The default CactiEZ account and password are admin
Console-Import and Export-template import-browse
Select cacti_host_template_x_db_server_ht_0.8.6i.xml
Save
2. Configure the cacti mysql plug-in
Modify ss_get_mysql_stats.php
Vi/var/www/html/scripts/ss_get_mysql_stats.php
$ Mysql_user = 'cacti ';
$ Mysql_pass = 'cacti ';
$ Cache_dir = "/tmp/cacti/cache /";
This account and password are the accounts and passwords authorized by the monitoring host to the Cacti host.
Cacti needs the account and password to connect to the monitored machine for status query.
Mkdir-p/tmp/cacti/cache
Chown-R apache. apache/tmp/cacti
Chmod-R 755/tmp/cacti
Set the cacti cache directory in/tmp/cacti/cache/and grant permissions
3. Configure the monitored mysql instance to authorize the cacti host.
Mysql-uroot-p
Grant process, super on *. * to 'cacti' @ '192. 168.0.195 'identified by 'cacti ';
Exit
Grant process, super on *. * to 'account' @ 'cacti Host IP address 'identified by 'Password ';
Meaning of this command
Only hosts with IP address 192.168.0.195 are allowed to access local data with the account cacti password cacti.
4. Monitor Mysql on the Cacti host
4.1 Add a mysql module to the host
Console-Manage-device-select the previously created host
Move to the bottom to add a graphical template, select Mysql-related modules, and save
4.2 create a graph for the mysql Module
Console-create-Create Image-select this host-select mysql module-create
4.3 plug-in mysql performance data
Monitor-select the host-view the corresponding mysql
Finished
Mysqld_safe -- user = mysql &
Mysql-uroot-p
Mysql-uroot-proot
Grant all privileges on *. * to root @ "%" identified by "root" with grant option;
Exit
Grant select, insert, update, delete on cacti. * to cacti @ * identified by "cacti ";
Exit
Grant process, super on *. * to 'cacti' @ '%' identified by 'cacti ';
Grant all privileges on cacti. * to cacti @ "%" identified by "cacti ";
The client enables Cacti to access mysql on the local machine.
Grant process, super on *. * to 'cacti' @ '192. 168.0.195 'identified by 'cacti ';
Grant process, super on *. * to 'cacti' @ '192. 168.0.97 'identified by 'cacti ';
=====
Mysql-ucacti-pcacti-h 192.168.0.97
,