美文网首页Linux学习之路服务器监控Linux
Ubuntu16.04-grafana安装及插件配置

Ubuntu16.04-grafana安装及插件配置

作者: Shark1985 | 来源:发表于2019-03-14 18:35 被阅读3次

参考来源

http://docs.grafana.org/installation/debian/

https://blog.csdn.net/reblue520/article/details/55254412

安装步骤

Install Stable

wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_5.0.4_amd64.deb

apt-get install -y adduser libfontconfig

dpkg -i grafana_5.0.4_amd64.deb

Add Package Cloud key

curl https://packagecloud.io/gpg.key | sudo apt-key add -

Update&apt-transport-https package

apt-get update

apt-get install -y apt-transport-https

Service

systemctl daemon-reload

systemctl start grafana-server

systemctl status grafana-server

Grafana需要和zabbix_api接口进行交互并且获取数据展示

curl -i -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"user.login","params":{"user":"Admin","password":"admin"},"auth":null,"id":0}' http://10.x.x.21/zabbix/api_jsonrpc.php

HTTP/1.1 200 OK
Date: Wed, 15 Feb 2017 13:33:26 GMT
Server: Apache/2.4.6 (CentOS) PHP/5.4.16
X-Powered-By: PHP/5.4.16
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: POST
Access-Control-Max-Age: 1000
Content-Length: 68
Content-Type: application/json

#返回result如下这种sessionid表述访问是ok的
{"jsonrpc":"2.0","result":"800b578c7409de36aba0cd69704985dafa","id":0}

如下命令的用户名和密码为web登陆账号密码,需要在zabbix上执行

curl -i -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"user.login","params":{"user":"Admin","password":"admin"},"auth":null,"id":0}' http://10.x.x.21/zabbix/api_jsonrpc.php

Web登录Grafana

http://10.x.x.x:3000

默认账号密码 admin admin

image

在Grafana的网站上有很丰富的免费插件可供下载,用于对各种场景的数据提供华丽的展示

[https://grafana.com/plugins?utm_source=grafana_plugin_list]

image

添加插件

image

添加一个zabbix的监控插件

其中的URL,填写http://10.x.x.21/zabbix/api_jsonrpc.php ,即之前在zabbix上执行过的json代码中的链接

image image

相关文章

网友评论

    本文标题:Ubuntu16.04-grafana安装及插件配置

    本文链接:https://www.haomeiwen.com/subject/uowcmqtx.html