zabbix系列(五) Grafana4.6.3+Zabbix 的安装部署

伟创享 2019-07-31 11:27:18

使用了一段时间Grafana,感觉还挺好用的。部分效果图如下:

zabbix的安装步骤请参考以下地址,就不再描述,本章主要记录Grafana的部署

https://blog.csdn.net/wu2700222/article/details/80520085

grafana官网地址:http://docs.grafana.org/installation/rpm/

从官网下载安装文件到本地,推荐迅雷下载较快http://docs.grafana.org/installation/rpm/版本为grafana-4.6.3-1.x86_64.rpm

也可以选择在线yum安装,但因为在线安装速度较慢不推荐

sudo yum install https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.6.3-1.x86_64.rpm

下载rpm包到指定目录,通过本地安装:

1、 通过ssh工具上传到centos7服务器/usr/local/src/目录下

2、[root@zabbix ~]# cd /usr/local/src/

[root@zabbix src]# wget https://dl.grafana.com/oss/release/grafana-6.3.4-1.x86_64.rpm

3、 安装最新稳定版

#在CentOS、Redhat/Fedora:手动安装

[root@zabbix src]# sudo yum install initscripts fontconfig urw-fonts

[root@zabbix src]# sudo rpm -Uvh grafana-6.3.4-1.x86_64.rpm

warning: grafana-6.3.4-1.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 24098cb6: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:grafana-6.3.4-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

4、配置grafana源,通过yum仓库安装

先创建文件执行cat /etc/yum.repos.d/grafana.repo

把文件内容复制进去

[grafana]
name=grafana
baseurl=https://packages.grafana.com/oss/rpm
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://packages.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt、
$ sudo yum install grafana

安装包详细信息

► 二进制文件/usr/sbin/grafana-server

► 服务管理脚本 /etc/init.d/grafana-server

► 安装默认文件 /etc/sysconfig/grafana-server

► 配置文件 /etc/grafana/grafana.ini

► 安装systemd服务(如果systemd可用 grafana-server.service

► 日志文件 /var/log/grafana/grafana.log

► 缺省配置指定一个数据库sqlite3 /var/lib/grafana/grafana.db

5、启动Grafana

#设置garfana-server开机自启
chkconfig grafana-server on
#启动服务器(通过systemd)
systemctl daemon-reload
systemctl start grafana-server
systemctl status grafana-server
#设置开机自启systemd服务
systemctl enable grafana-server.service

6、环境变量文件

Systemd服务和daemon服务在后台运行时,都使用文件/etc/sysconfig/grafana-server来设置环境变量,可以通过修改garfana-server文件来设置日志目录等其他变量。

#默认日志文件:/var/log/grafana

#数据库设置

#缺省配置指定一sqlite3数据库位于/var/lib/grafana/grafana.db。请在升级前备份这个数据库。还可以使用MySQL或Postgres Grafana数据库。

7、访问测试

#地址栏输入:http://10.0.11.110:3000/?/login

#默认用户和密码:admin admin

当然这里需要选把3000的端口加入防火墙,不然可是会被屏蔽访问的哦

先查看当前开设的端口

[root@localhost soft]# firewall-cmd --list-ports

[root@localhost soft]# firewall-cmd --zone=public --add-port=3000/tcp --permanent

加入成功,再去试试吧!

安装garfana-zabbix插件

官方网站:https://github.com/alexanderzobnin/grafana-zabbix

官网wiki:http://docs.grafana-zabbix.org/installation/

使用grafana-cli工具安装

#获取可用插件列表

grafana-cli plugins list-remote

#安装zabbix插件

grafana-cli plugins install alexanderzobnin-zabbix-app

#安装插件完成之后重启garfana服务

[root@zabbix ~]# service grafana-server restart

#使用grafana-zabbix-app源,其中包含最新版本的插件

cd /var/lib/grafana/plugins/

#克隆grafana-zabbix-app插件项目

git clone https://github.com/alexanderzobnin/grafana-zabbix-app

#注:如果没有git,请先安装git

yum –y install git(该语句建议手打,直接复制执行可能报错)

如果安装时候报Loaded plugins: fastestmirror, langpacks,没关系,多执行几次就好了

# 插件安装完成重启garfana服务

service grafana-server restart

#注:通过这种方式,可以很容易升级插件

cd /var/lib/grafana/plugins/grafana-zabbix-app

git pull

service grafana-server restart

使用源码包安装

#源码安装需要NodeJS,npm和Grunt支持

git clone https://github.com/alexanderzobnin/grafana-zabbix.git
cd grafana-zabbix
npm install
npm install -g grunt-cli
grunt
#插件将建成dist/目录。然后你可以将它复制到你的grafana插件目录或在grafana配置文件中指定编译插件的路径
[plugin.zabbix]
path =/home/your/clone/dir/grafana-zabbix/dist
#如果需要更新,执行下面命令
git pull
grunt
#重启grafana服务
service grafana-server restart
systemctl restart grafana-server

配置Grafana启用插件

#登录到grafana上,移动到grafana左侧面板的插件,选择应用程序选项卡,然后选择“配置”选项卡,打开Zabbix,启用插件。

#配置Zabbix数据源

#添加新数据源,打开侧面板Zabbix数据源,单击“添加数据源并选择从下拉列表Zabbix。

#注意红线标注的地方,Name自定义,Type选择Zabbix,Url填写访问zabbix-web的url(http://10.0.11.133/zabbix/api_jsonrpc.php),加上zabbix-api的php文件,Zabbix details用户名密码需要在Zabbix-web页面中设置,

本文中用户名:grafana,密码:grafana123,

不想新建的话,可以使用Zabbix的初始用户.设置完成点击增加按钮,弹出下图:

#本教程的Zabbix版本为Zabbix-3.4.2,详细配置教程请参考官方文档:

http://docs.grafana-zabbix.org/installation/configuration/

#常见错误解决请参考:http://docs.grafana.org/installation/troubleshooting/

开始使用Grafana-Zabbix

添加新的图形面板到仪表板

grafana插件安装

#插件链接:https://github.com/grafana/grafana
#安装Panel
#使用grafana-cli工具在命令行下面安装Clock
grafana-cli plugins install grafana-clock-panel
#安装apps,Worldping
grafana-cli plugins install raintank-worldping-app
#安装Data source,以SimpleJson为例
grafana-cli plugins install grafana-simple-json-datasource
#安装完成,提示重启grafana服务
/etc/init.d/grafana-server restart

#插件使用及仪表板模板导入

#Worldping使用展示

#到此grafana-zabbix安装及使用完成。

官方地址:http://docs.grafana-zabbix.org

zabbix系列-Grafana4.6.3+Zabbix 的安装部署的更多相关文章

  1. 04.Linux系统-Zabbix监控服务安装部署

    一.环境准备 操作系统:CentOS_Server_7.5_x64_1804.iso 部署组件:Zabbix 二.操作步骤: Zabbix_Server安装部署 2.0.安装依赖组件 [root@lo ...

  2. zabbix监控系列(1)之zabbix-server安装

    推荐使用yum来安装 第一步:LAMP平台 zabbix使用php开发的,所以依赖于LAMP或者LNMP平台,由于http+mysql用yum安装及其方便,所以我在这里使用yum安装. yum -y ...

  3. 【zabbix系列】安装与加入host

    測试环境 Ubuntu 14.04.1 LTS [服务端安装] 关于安装官方提供了非常具体的安装方法,包含各平台的源代码及包安装.关于其它版本号Linux请參考 https://www.zabbix. ...

  4. Zabbix系列之八——安装agent监控windows

    一.下载zabbix-agent客户端 被监控的主机装在windows server 2012 64位操作系统,被监控端需要安装: http://www.zabbix.com/downloads/3. ...

  5. zabbix系列之七——安装后配置二Userparameters

    1User parameters(用户自定义参数) 1.1配置 描述 详细 备注 简介 1执行zabbix中未预定义的agent check时使用 配置 1)    zabbix agent的配置文件 ...

  6. zabbix系列之六——安装后配置二Items

    https://www.zabbix.com/documentation/3.4/manual/config/items/itemtypes/snmp 1Items 1.1creating items ...

  7. zabbix系列之五——安装后配置一

    https://www.zabbix.com/documentation/3.4/manual/appliance Configuration 1Hosts and host groups Overv ...

  8. zabbix系列之三——安装报错

    1Zabbix_server启动失败 1.1查看日志:vi /var/log/zabbix/zabbix_server.log zabbix_server [23500]: cannot open l ...

  9. zabbix系列之二——安装

    1Getting zabbix Four ways of getting: Index Option note 1 Install it from the distribution packages ...

随机推荐

  1. MySQL的安装+可视化工具+JDBC的增删改查

    1.Mysql和可视化工具的安装 安装包网上有很多资源.这里推荐一个我一直在用的学习网站,上面有提供安装包和详细的说明. http://how2j.cn/k/mysql/mysql-install/3 ...

  2. sparkSQL 简介

    一.Spark SQL的特点 1.支持多种数据源:Hive.RDD.Parquet.JSON.JDBC等.2.多种性能优化技术:in-memory columnar storage.byte-code ...

  3. ansible-template

    template简介 template功能: 根据模板文件动态生成对应的配置文件 template文件必须存放于templates目录下,且命名为 .j2 结尾 ansible的template模板使 ...

  4. C# Json之序列化与反序列化

    前言:在实际开发过程中经常都要和Json打交道,序列化与反序列化就成了开发中必不可缺的技能.本篇博客就教大家如何进行Json序列化与反序列化. 首先要添加引用NuGet包,Newtonsoft.Jso ...

  5. 【原创】(十一)Linux内存管理slub分配器

    背景 Read the fucking source code! --By 鲁迅 A picture is worth a thousand words. --By 高尔基 说明: Kernel版本: ...

  6. GDG Xi'an DevFest 2019 闪电演讲 -《假如我是一个浏览器》PPT(经典多图,建议收藏)

    GDG Xi'an DevFest2019演讲PPT链接: http://tmp.link/f/5dd9e6bf461b6 闪电演讲<假如我是一个浏览器>PPT链接: https://gi ...

  7. 【论文阅读】CornerNet: Detecting Objects as Paired Keypoints

    以下内容将介绍ECCV2018的一篇目标检测的文章<CornerNet: Detecting Objects as Paired Keypoints>.该文章讲述了一个老子就是不用anch ...

  8. 插槽在父组件和子组件间的使用(vue3.0推荐)

    子组件: 父组件: 插槽在父组件和子组件间的使用(vue3.0推荐):在外面加一个template模板

  9. All-in-one 的Serving分析

    export_func.export(model, sess, signature_name=mission, version=fold + 1) def export(model, sess, si ...

  10. ERROR: Unrecognized command line argument: 'use'

    Unrecognized command line argument: 'use' gvm--GoLang语言多版本管理工具 基础环境 centos6.5 报错内容 gvm在命令行以外的任何地方调用 ...