Grafana + Zabbix 監控系統搭建

grafana:一個靜態項目,須要聯合nginx、apache等使用,友好的以下顯示php

首先安裝 grafananode

官網http://grafana.org/download/ 有好多版本可選,好幾種包形式,三種安裝方式(官方說明):linux

一、yum直接安裝 rpm包,可是好慢,慢到根本鏈接不上。(由於zabbix版本較低,我安裝了個低版本)nginx

sudo yum install https://grafanarel.s3.amazonaws.com/builds/grafana-4.1.2-1486989747.x86_64.rpmgit

二、或者手動安裝使用rpmgithub

sudo yum install initscripts fontconfig sudo rpm -Uvh grafana-4.1.2-1486989747.x86_64.rpmweb

在susa上:sudo rpm -i --nodeps grafana-4.1.2-1486989747.x86_64.rpm數據庫

三、配置yum源(推薦[第一次yum好像會保存key吧,不會成功]默認Version 4.1.2)apache

/etc/yum.repos.d/grafana.repojson

[grafana] name=grafana baseurl=https://packagecloud.io/grafana/stable/el/6/$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.crt

sudo yum install grafana

所需key:https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana

啓動:

service grafana-server start  || /etc/init.d/grafana-server  start

systemctl  grafana start

./usr/sbin/grafana-server

配置文件:

grafana後端的配置文件能夠是多個以.ini結尾的配置文件,主要從三個配置文件讀取配置:

默認是$WORKING_DIR/conf/defaults.ini,其次用戶配置是$WORKING_DIR/conf/custom.ini,用戶配置則能夠在命令行啓動grafana時經過--config參數從新指定配置文件來覆蓋。若是你是以deb或者rpm安裝的,則默認的配置文件是/etc/grafana/grafana.ini,這個文件是在init.d的啓動腳本中經過--config參數指定的。[一些配置文件路徑能夠見官網]

默認監聽3000端口,固然能夠在默認配置文件中修改,安全起見,修改一下最好,記得把註釋去掉哦。

此時既能夠訪問了---->>> IP:3000  (爲了安全起見,咱們要進入web端更改默認用戶密碼)

站點根路徑:/usr/share/grafana/

安裝zabbix插件:如下兩種方法

一、下載高人弄得插件

git clone https://github.com/linglong0820/grafana-zabbix

cp -r grafana-zabbix/zabbix/  /usr/share/grafana/public/app/plugins/datasource/

(可是我怎麼配都沒辦法在web顯示出來,也許是版本的問題嗎?)

二、web端----plugins----find more plugins(插件),而後會有官方提供的額外插件

grafana-cli plugins install alexanderzobnin-zabbix-app

(默認存放路徑/var/lib/grafana/plugins/alexanderzobnin-zabbix-app)

重啓,但還沒完哦,要去 web端----plugins----apps---zabbix---enable(打開),好了

(我測試將目錄考到默認識別插件路徑,可是會報錯,不生效)

按以下配置:

Zabbix的API地址爲「http://192.168.246.133/zabbix/api_jsonrpc.php」,其中IP的安裝zabbix-server的服務器IP

Zabbix的API帳號密碼就是Zabbix的Web端登陸帳號和密碼,帳號:admin, 密碼zabbix

點擊Add後,點擊Test Connection測試是否能夠鏈接。提示「Success」說明鏈接成功,點擊Save

缺點:

一、最新版沒法選 all cpu或mem了,只能一個一個選,太麻煩

二、獲取數據延時比較大

新建Graph:

如上點擊下列紅框處->選擇Edit->選擇數據庫ZabbixClient

以下而後配置一下,就能夠出現華麗麗的數據了,下圖都是官方的示意圖:

一些Zabbix相關教程集合

Ubuntu 14.04下Zabbix2.4.5 源碼編譯安裝  http://www.linuxidc.com/Linux/2015-05/117657.htm

CentOS 7 LNMP環境搭建Zabbix3.0  http://www.linuxidc.com/Linux/2017-02/140134.htm

Ubuntu 16.04安裝部署監控系統Zabbix2.4  http://www.linuxidc.com/Linux/2017-03/141436.htm

Zabbix監控安裝部署及警報配置  http://www.linuxidc.com/Linux/2017-03/141611.htm

Ubuntu 16.04下安裝部署Zabbix3.0  http://www.linuxidc.com/Linux/2017-02/140395.htm

CentOS 6.3下Zabbix監控apache server-status http://www.linuxidc.com/Linux/2013-05/84740.htm

CentOS 7 下 Zabbix 3.0安裝詳解 http://www.linuxidc.com/Linux/2017-03/141716.htm

64位CentOS 6.2下安裝Zabbix 2.0.6   http://www.linuxidc.com/Linux/2014-11/109541.htm

ZABBIX 的詳細介紹請點這裏
ZABBIX 的下載地址請點這裏

本文永久更新連接地址http://www.linuxidc.com/Linux/2017-04/142473.htm

另外一篇關於 Zabbix3.2+Grafana4.0實現可視化監控圖形的環境搭建:

http://www.linuxidc.com/Linux/2017-06/144981.htm

相關文章
相關標籤/搜索