阿里云ECS部署Grafana接入zabbix
Grafana接入zabbix部署
阿里云ECS部署Grafana接入zabbix
Grafana 是 Graphite 和 InfluxDB 仪表盘和图形编辑器。Grafana 是开源的,功能齐全的度量仪表盘和图形编辑器,支持 Graphite,InfluxDB 和 OpenTSDB。
关于zabbix及相关服务软件版本:
Linux: ECS_CentOS 7.2
nginx: 1.9.15
一、购买ECS
购买一台ECS
二、安装nginx
安装依赖包:
yum -y install gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre* make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel
创建nginx用户:
useradd nginx -s /sbin/nologin -M
下载nginx软件包并进入到目录中:
wget https://nginx.org/download/nginx-1.9.15.tar.gz && tar xvf nginx-1.9.15.tar.gz && cd nginx-1.9.15
编译:
./configure --prefix=/usr/local/product/nginx1.9.14 --user=nginx --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 ==>创建软链接
参数解释:
--with-http_stub_status_module:支持nginx状态查询
--with-http_ssl_module:支持https
--with-http_spdy_module:支持google的spdy,想了解请百度spdy,这个必须有ssl的支持
--with-pcre:为了支持rewrite重写功能,必须制定pcre
三、安装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/
#查看可以安装的插件
./grafana-cli plugins list-remote
#安装zabbix插件
./grafana-cli plugins install alexanderzobnin-zabbix-app
#安装饼图插件
./grafana-cli plugins install grafana-piechart-panel
#启动,并后台运行
./grafana-server -homepath /opt/grafana/grafana &
四、Grafana管理网站配置(nginx):
编辑nginx虚拟主机:
[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 https://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;
}
}
编辑nginx.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;
}
添加/etc/hosts文件:
192.168.119.140 grafana.dtstack.com
访问Grafana
访问https://grafana.dtstack.com admin/admin
五、添加数据源:
启用zabbix插件
数据源配置 - 数据源
Name: zabbix
Default: ️
Type: Zabbix
## Http settings
URL: https://zabbix.dtstack.com/api_jsonrpc.php
Access: proxy
## Zabbix API details
Username: xxxxxx
Password: xxxxxx
最后更新:2017-06-06 13:31:23
上一篇:
阿里内核月报2014年5月-06月
下一篇:
深入浅出 spring-data-elasticsearch 之 ElasticSearch 架构初探(一)
PUE 无限接近 1.0,阿里云首次展示“麒麟”数据中心解决方案
GitHub Flavored Markdown viewer plugin for Eclipse
SQLServer如何获取客户端IP
轻松搭建Windows8云平台开发环境
Jni使用过程中出现 error: request for member 'FindClass' in something not a structure or union,解决办法
VC文档 视图 框架窗口间的关系和消息传送规律
【 H5踩坑 】Dom变更引起的 touchend 不触发
互联网将对中国社会产生更为深远影响
DT科技评论第35期:可以解锁任何手机的万能指纹
入门篇:关于函数计算角色策略的定义