mysql模板下载地址:http://code.google.com/p/mysql-cacti-templates/downloads/list
>tar zxf better-cacti-templates-1.1.8.tar.gz
>cd better-cacti-templates-1.1.8/scripts/
>cp ss_get_mysql_stats.php /www/cacti/scripts/ 复制到你cacti目录下面的scripts里面
>chown -R cacti:cacti /www/cacti/scripts
>cd /www/cacti/scripts/
>vim vim ss_get_mysql_stats.php
$mysql_user = 'cactiuser';
$mysql_pass = 'cactiuser';
$cache_dir = '/tmp/cacti/cache'; 这个是你授权查询数据的用户和存放数据的目录
>mkdir -p /tmp/cacti/cache
>mysql -uroot -p
mysql> grant process,super on *.* to 'cactiuser'@'192.168.3.159' identified by 'cactiuser';
授权这个用户可以采集数据
在cacti监控页面导入模板
选择console--->import/export--->import templates--->选择文件--->找到你自己解压后的这个cacti_host_template_x_mysql_server_ht_0.8.6i-sver1.1.8.xml文件--->选择右下角import
然后你就可以在console-->devices-->你的主机-->create graphs for this host选择你需要的模板