Grafana+OpenFalcon安装
官网地址:https://grafana.com/
下载地址:https://grafana.com/grafana/download
一、 安装
方法一:
On CentOS / Fedora / Redhat:
$ wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.1.1-1.x86_64.rpm
$ sudo yum install initscripts fontconfig
$ sudo rpm -Uvh grafana-5.1.1-1.x86_64.rpmgit
sudo yum localinstall grafana-5.1.1-1.x86_64.rpm github
方法二:
Add the following to a new file at /etc/yum.repos.d/grafana.repo
[grafana]
name=grafana
baseurl=https://packagecloud.io/grafana/stable/el/7/$basearch
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://packagecloud.io/gpg.key https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crtweb
$ sudo yum install grafanavim
二、下载 grafana-openfalcon-datasource 到 grafana 的 plugins 下:
方法一:
查看plugins目录:api
;plugins = /var/lib/grafana/plugins
git clone https://github.com/open-falcon/grafana-openfalcon-datasource
方法二:
经过grafana-cli安装Open-falcon插件:ide
三、启动
修改端口号并重启 grafana-server url
http_port = 9090
root_url = http://localhost:9090插件
启动:grafana-serverrest
四、添加数据源
访问http://grafanaip:9090:
默认登陆的用户名和密码都为admin,登录后记得修改密码code
找到Data Sources配置项,点击添加数据源:
此处注意:http://localhost:8080/api/v1/grafana 为open-falcon-0.21版本的api接口 和0.1版本有所区别 建议安装最新版本open-falcon 。
配置数据源成功:
五、为监控主机画图:
版本:# grafana-server -v
Version 5.1.2 (commit: c3c690e21)
添加新的dashboard
点击配置
看着图配置吧,不难,注意数据源
注意查询语句的写法 $name这个是variable 中配置的,在后面的是open-falcon中的监控项名字:
最终效果展现: