如果没有,请尝试用以下方法:
1.把系统放到网站文件夹下,
2.建立数据库及数据表.
3.查看后台程序源码,设置数据库名称及连接用户名和密码,有可能模板的文件夹也要做一下设置
dbconn 之类的程序多看看.
4.通过浏览器访问程序,根据错误信息进行调试.
5.如果不行,再找别人帮忙......
授权zabbix连接MySQL数据库zabbix客户端程序会以该用户的身份启动
mysql>GRANT USAGE ON *.* TO 'zabbix'@'localhost' IDENTIFIED BY '123@qwe'
mysql>flush privileges
修改监控模板
将监控模板加入配置文件中
shell>cp conf/zabbix_agentd/userparameter_mysql.conf /usr/local/zabbix/etc/zabbix_agentd.conf.d/
修改配置文件HOME
shell>grep -v ^# /usr/local/zabbix/etc/zabbix_agentd.conf.d/userparameter_mysql.conf
=================================================================================================
UserParameter=mysql.status[*],echo "show global status where Variable_name='$1'" |
HOME=/usr/local/zabbix/etc mysql -N | awk '{print $$2}'
UserParameter=mysql.size[*],echo "select sum($(case "$3" in both|"") echo "data_length+index_length"
data|index) echo "$3_length"free) echo "data_free"esac)) from information_schema.tables$([[ "$1" = "all" || ! "$1" ]] ||
echo " where table_schema='$1'")$([[ "$2" = "all" || ! "$2" ]] || echo "and table_name='$2'")"
| HOME=/usr/local/zabbix/etc mysql -N
UserParameter=mysql.ping,HOME=/usr/local/zabbix/etc mysqladmin ping | grep -c alive
UserParameter=mysql.version,mysql -V
=================================================================================================
建立数据库连接信息
shell>cat /usr/local/zabbix/etc/.my.cnf
=================================================================================================
# Zabbix Agent
[mysql]
host=localhost
user=zabbix
password=123@qwe
socket=/tmp/mysql.sock
[mysqladmin]
host=localhost
user=zabbix
password=123@qwe
socket=/tmp/mysql.sock
启动zabbix自带模板
1、重启启动zabbix_agantd
2、host添加Template App MySQL模板,就可以看到图形
3、系统定义了流量及qps图形显示,其他图形需要自己添加
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)