zabbix3.4 centos7.4 grafana5.1 install+ zabbix plugin

本文介绍了如何在CentOS上安装Grafana监控系统,并详细记录了安装过程中的步骤,包括通过YUM仓库安装、启动服务、配置环境变量、安装Zabbix插件等。此外还提供了登录Grafana网站及添加数据源的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

If the image is missing text make sure you have font packages installed.

yum install fontconfig
yum install freetype*
yum install urw-fonts

1.Install via YUM Repository

Add the following to a new file at /etc/yum.repos.d/grafana.repo

[root@VM_0_7_centos ~]# vim /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.crt

Then install Grafana via the yum command.

[root@VM_0_7_centos ~]# yum install grafana

2.Start the server (init.d service)

You can start Grafana by running:

[root@VM_0_7_centos ~]# service grafana-server start
Starting grafana-server (via systemctl):                   [  OK  ]
[root@VM_0_7_centos ~]# systemctl daemon-reload
[root@VM_0_7_centos ~]# systemctl start grafana-server
[root@VM_0_7_centos ~]# systemctl enable grafana-server
Created symlink from /etc/systemd/system/multi-user.target.wants/grafana-server.service to /usr/lib/systemd/system/grafana-server.service.
[root@VM_0_7_centos ~]# systemctl status grafana-server
● grafana-server.service - Grafana instance
   Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2018-05-08 12:43:32 CST; 57s ago
     Docs: http://docs.grafana.org
 Main PID: 4822 (grafana-server)
   CGroup: /system.slice/grafana-server.service
           └─4822 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/var/run/grafana/...

May 08 12:43:32 VM_0_7_centos grafana-server[4822]: t=2018-05-08T12:43:32+0800 lvl=info msg="Executin...v1"
May 08 12:43:32 VM_0_7_centos grafana-server[4822]: t=2018-05-08T12:43:32+0800 lvl=info msg="Executin...55"
May 08 12:43:32 VM_0_7_centos grafana-server[4822]: t=2018-05-08T12:43:32+0800 lvl=info msg="Created ...in"
May 08 12:43:32 VM_0_7_centos grafana-server[4822]: t=2018-05-08T12:43:32+0800 lvl=info msg="Starting...ins
May 08 12:43:32 VM_0_7_centos grafana-server[4822]: t=2018-05-08T12:43:32+0800 lvl=info msg="Plugin d...ins
May 08 12:43:32 VM_0_7_centos systemd[1]: Started Grafana instance.
May 08 12:43:32 VM_0_7_centos grafana-server[4822]: t=2018-05-08T12:43:32+0800 lvl=info msg="Initiali...er"
May 08 12:43:32 VM_0_7_centos grafana-server[4822]: t=2018-05-08T12:43:32+0800 lvl=info msg="Initiali...et=
May 08 12:43:32 VM_0_7_centos grafana-server[4822]: t=2018-05-08T12:43:32+0800 lvl=info msg="Initiali...ine
May 08 12:43:32 VM_0_7_centos grafana-server[4822]: t=2018-05-08T12:43:32+0800 lvl=info msg="Initiali...nup
Hint: Some lines were ellipsized, use -l to show in full.
[root@VM_0_7_centos ~]#

Environment file

The systemd service file and init.d script both use the file located at /etc/sysconfig/grafana-server for environment variables used when starting the back-end. Here you can override log directory, data directory and other variables.

Logging

By default Grafana will log to /var/log/grafana

Database

The default configuration specifies a sqlite3 database located at /var/lib/grafana/grafana.db. Please backup this database before upgrades. You can also use MySQL or Postgres as the Grafana database, as detailed on the configuration page.

Configuration

The configuration file is located at /etc/grafana/grafana.ini. Go the Configuration page for details on all those options.

access grafana website
http://111.231.108.211:3000
在这里插入图片描述

login grafana infomation/ admin/admin

Installing on a local Grafana:

[root@VM_0_7_centos ~]# grafana-cli plugins install alexanderzobnin-zabbix-app
installing alexanderzobnin-zabbix-app @ 3.9.1
from url: https://grafana.com/api/plugins/alexanderzobnin-zabbix-app/versions/3.9.1/download
into: /var/lib/grafana/plugins

✔ Installed alexanderzobnin-zabbix-app successfully 

Restart grafana after installing plugins . <service grafana-server restart>
[root@VM_0_7_centos ~]# systemctl restart grafana-server

Add Bashboard

在这里插入图片描述

search zabbix

在这里插入图片描述

Enable zabbix plugin

在这里插入图片描述

Add data source

在这里插入图片描述

HTTP:http://localhost/zabbix/api_jsonrpc.php
Username: Admin(默认)
Password: zabbix(默认)

在这里插入图片描述

anonymous access

[auth.anonymous]
# enable anonymous access
enabled = true
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值