1、安装grafana:
[[email protected] ~]# rpm -ivh grafana-6.7.3-1.x86_64.rpm warning: grafana-6.7.3-1.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 24098cb6: NOKEY Preparing... ################################# [100%] Updating / installing... 1:grafana-6.7.3-1 ################################# [100%]### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd sudo /bin/systemctl daemon-reload sudo /bin/systemctl enable grafana-server.service ### You can start grafana-server by executing sudo /bin/systemctl start grafana-server.service POSTTRANS: Running script
2、根据提示完成配置并启动服务:
[[email protected] ~]# systemctl daemon-reload [[email protected] ~]# systemctl enable grafana-serverCreated symlink from /etc/systemd/system/multi-user.target.wants/grafana-server.service to /usr/lib/systemd/system/grafana-server.service. [ro[email protected] ~]# systemctl start grafana-server
服务运行在3000端口:
[[email protected] vmuser]# netstat -ntpl|grep 3000 tcp6 0 0 :::3000 :::* LISTEN 18358/grafana-serve
3、访问http://ip:3000
默认账号密码为admin/admin
4、添加数据源Mysql
保存并测试,如果报错:
tail -f /var/log/grafana/grafana.log
查看报错信息,按报错修改即可。
下载地址:https://grafana.com/grafana/plugins/alexanderzobnin-zabbix-app/installation。
解压到grafana插件目录,重启grafana并从web界面启用插件:
[[email protected] ~]# unzip alexanderzobnin-grafana-zabbix-v3.11.0-1-g52f24ec.zip -d /var/lib/grafana/plugins/ [root@zabbix ~]# systemctl restart grafana-server
6、再次添加数据源,数据源类型选择zabbix
HTTP url字段添加zabbix API地址,通常为:http://ip/zabbix/api_jsonrpc.php。
Zabbix API details字段填写zabbix web界面的用户名密码。启用Trends,选择Zabbix version。
Direct DB Connection,选择enable,Data Source选择第四步添加的数据源。
7、save and test,编辑仪表板即可。
本文出处:代码的荣耀
原文链接:http://www.icoder.top/blog
作者/译者:zhangrj