Deploying Grafana to access Zabbix in Alibaba Cloud ECS

简介: Learn how to deploy Grafana to access Zabbix.

API_plan_Dynamic_Table

Abstract: Learn how to deploy Grafana to access Zabbix

This article shows you how to deploy Grafana on Alibaba Cloud ECS to access Zabbix. Zabbix is an open-source monitoring software for networks and applications while Grafana is an open-source, full-featured dashboard and graph editor for Graphite, InfluxDB, and OpenTSDB. In this tutorial, we will be running CentOS 7.2 on an Alibaba Cloud ECS instance. We will also be using Nginx version 1.9.15 as our web server. Without further ado, let’s look at how we can implement this on our ECS instance.

1. Purchase ECS:

You should have an ECS instance with CentOS 7.2. Other configurations, such as region, do not matter much for our purposes.

2. Install Nginx

Install dependency packages for Nginx on your ECS instance.

yum -y install gcc gcc-c++ autoconf automake zlib zlib-devel o
penssl openssl-devel pcre* make gd-devel libjpeg-devel libpng-
devel libxml2-devel bzip2-devel libcurl-devel

Create an Nginx user after installing the dependency packages:

useradd nginx -s /sbin/nologin -M

Download Nginx software package and enter the directory:

wget http://nginx.org/download/nginx-1.9.15.tar.gz && tar xvf 
nginx-1.9.15.tar.gz && cd nginx-1.9.15

Compile:

./configure --prefix=/usr/local/product/nginx1.9.14 --user=ngi
nx --group=nginx --with-http_ssl_module --with-http_v2_module
--with-http_stub_status_module --with-pcre

make && make install

ln -s /usr/local/product/nginx1.9.14 /usr/local/nginx    ==>cr
eate soft link

The list below describes the arguments we used when compiling the code:

--with-http_stub_status_module: This argument enables Nginx state query
--with-http_ssl_module: This arguments enables https support
--with-http_spdy_module: This argument provides support for SPDY, which in turn must be supported by ssl (You can find more information about SPDY online)
--with-pcre: prce must be configured in order to support the rewrite function

3. Install Grafana

After successfully installing Nginx, we need to install Grafana.
Grafana’s amazing visualization capabilities, combined with Zabbix’s powerful monitoring tools, greatly simplifies network management.
Grafana provides a plug-in for Zabbix, making the combination of these two software extremely convenient. To install Grafana, input the following commands.

mkdir /opt/grafana && cd /opt/grafana
wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.3.2.linux-x64.tar.gz
tar -zxvf grafana-4.3.2.linux-x64.tar.gz
mv grafana-4.3.2 grafana
cd grafana/bin/
# View installable plug-ins
./grafana-cli plugins list-remote
# Install zabbix plug-in
./grafana-cli plugins install alexanderzobnin-zabbix-app
# Install pie chart plug-in
./grafana-cli plugins install grafana-piechart-panel
# Launch, and run in background
./grafana-server -homepath /opt/grafana/grafana &

4. Manage Website Configuration (Nginx) with Grafana

Now that we have Grafana installed, we can edit Nginx web hosting as follows:

[root@grafana conf]# mkdir extra
[root@grafana conf]# cd extra/
[root@grafana extra]# vim grafana.conf
server {
    listen       80;
    server_name  grafana.dtstack.com;
    access_log /data/logs/zabbix/grafana.dtstack.com.access.log main;
    location / {
        index  index.html;
    proxy_pass http://127.0.0.1:3000;
    proxy_set_header   Host             $host;
    proxy_set_header   X-Real-IP        $remote_addr;
    proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
    }
}

Edit the configuration file ngix.conf:

[root@grafana conf]# cat nginx.conf

user nginx;
worker_processes 1;

#error_log logs/error.log warning;
#error_log logs/error.log notice;
#error_log logs/error.log info;

pid logs/nginx.pid;

events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                    '$status $body_bytes_sent "$http_referer" '
                    '"$http_user_agent" "$http_x_forwarded_for"';
    access_log  logs/access.log  main;
    sendfile        on;
    #tcp_nopush     on;
    #keepalive_timeout  0;
    keepalive_timeout  65;
    #gzip  on;
    include extra/*.conf;
}

Add file /etc/hosts:
192.168.119.140 grafana.dtstack.com
Access Grafana
Access http://grafana.dtstack.com admin/admin

5. Add a data source.

Finally, we require a data source for the Zabbix plug-in to work correctly.

Enable zabbix plug-in
Data Source Configuration - Data Source
    Name:      zabbix
    Default:   ️
    Type:      Zabbix
    ## Http settings
    URL:     http://zabbix.dtstack.com/api_jsonrpc.php
    Access:  proxy
    ## Zabbix API details
    Username: xxxxxx
    Password: xxxxxx

And there you have it! You should now be able to access Zabbix using Grafana to monitor and manage your website or application.

目录
相关文章
|
监控 关系型数据库 MySQL
Alibaba Cloud Linux基础入门(1)——配置zabbix
该文档是关于在Alibaba Cloud Linux上配置Zabbix的教程。首先,通过添加Zabbix仓库并安装相关软件包(如zabbix-server,web前端和agent)。然后,安装并启动MySQL数据库,执行`mysql_secure_installation`进行配置。接着,创建名为zabbix的数据库和用户,并导入Zabbix默认数据。最后,设置Zabbix服务开机自启动,并通过浏览器访问http://服务器IP/zabbix完成Web端配置,使用Admin/zabbix登录。
|
SQL 弹性计算 运维
云备份(Cloud Backup)ECS备份基础版——超好用的ECS数据保护方案
ECS备份基础版是阿里云云备份(Cloud Backup,原混合云备份HBR)全新推出的ECS数据保护方案,配置简单、预算可控,同时支持ECS文件、自建数据库和整机的保护。ECS基础版属于预付费商品,可为每台ECS保护最多500G数据。
83926 0
|
6月前
|
缓存 安全 网络协议
如何使用Bluetown Cloud服务器及其CDN服务来掩护VPS的真实IP地址。
最终,通过Bluetown Cloud的CDN服务,你的VPS不仅仅是隐藏在一层又一层的保护之下,同时也因为CDN的全球节点而享受到加速访问的优势,无所不在又不被发现,像是一位能在互联网世界中自由穿梭的幽灵特工。
146 14
|
人工智能 运维 Kubernetes
87cloud案例分析:阿里云国际服务器如何支持在线教育
87cloud案例分析:阿里云国际服务器如何支持在线教育
|
微服务
【Azure Cloud Services】云服务频繁发生服务器崩溃的排查方案
【Azure Cloud Services】云服务频繁发生服务器崩溃的排查方案
256 0
|
存储 监控 Linux
性能监控之Telegraf+InfluxDB+Grafana linux服务器实时监控
【6月更文挑战11天】标题性能监控之 Java Metrics 度量包性能监控之Telegraf+InfluxDB+Grafana linux服务器实时监控
493 2
|
监控 数据库 时序数据库
性能监控之Telegraf+InfluxDB+Grafana window服务器安装使用
【6月更文挑战13天】性能监控之Telegraf+InfluxDB+Grafana window服务器安装使用
857 1
|
数据采集 监控 数据库
请问OceanBase社区版能否通过zabbix监控,然后将报错信息展现到grafana?
【2月更文挑战第25天】请问OceanBase社区版能否通过zabbix监控,然后将报错信息展现到grafana?
168 2
|
网络安全 Python
pycharm连接云服务器#潞晨cloud
Luchencloud采用SSH密钥对连接,需先在本地生成公钥并添加到平台
369 0
|
监控 JavaScript 前端开发
Grafana 系列 - 统一展示 -6-Zabbix 仪表板
Grafana 系列 - 统一展示 -6-Zabbix 仪表板

推荐镜像

更多