Zabbix对接Grafana

2020年07月18日 · Linux · 技术帮助分享 · 820次阅读

------正---文------

1、安装grafana:

[root@zabbix ~]# 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、根据提示完成配置并启动服务:

[root@zabbix ~]# systemctl daemon-reload
[root@zabbix ~]# systemctl enable grafana-serverCreated symlink from /etc/systemd/system/multi-user.target.wants/grafana-server.service to /usr/lib/systemd/system/grafana-server.service.
[root@zabbix ~]# systemctl start grafana-server

服务运行在3000端口:

[root@zabbix 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

查看报错信息,按报错修改即可。

5、下载zabbix插件,并安装

下载地址:https://grafana.com/grafana/plugins/alexanderzobnin-zabbix-app/installation

下载zip:https://codeload.github.com/alexanderzobnin/grafana-zabbix/legacy.zip/793129b2d602b36b09dc64dab7ec6f5a6f7beb42

解压到grafana插件目录,重启grafana并从web界面启用插件:

[root@zabbix ~]# 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


------结---束------

推广:AI工具网 | 专注人工智能工具推荐!
『静谧星河』采用《署名-相同方式共享 4.0 国际》进行许可。如需转载请保留本文地址。
本文地址:
https://www.yuvin.cn/Linux/492.html
AD

支持我

教程帮助Linux设置Zabbix

静谧星河最后编辑于4年前


因本站不提供交互式服务,评论均需审核后显示,敬请谅解。

添加新评论

captcha

请输入验证码