zabbix&prometheuss+Grafana监控系列容器版

1.首先安装zabbix

docker run --name some-zabbix-appliance -p 80:80 -p 10051:10051 -d zabbix/zabbix-appliance:latest

官网连接

https://hub.docker.com/r/zabbix/zabbix-appliance/

客户端安装agent之后可以获取以下信息

[root@cc126 ~]# docker exec some-zabbix-appliance zabbix_get -s 192.168.8.120 -p 10050 -k "system.hostname" 
cc120
[root@cc126 ~]# docker exec some-zabbix-appliance zabbix_get -s 192.168.8.120 -p 10050 -k "system.cpu.load[all,avg1]"
0.030000

2.安装prometheus (storage.tsdb.retention=100d 数据保留100天,不写参数默认15天)
配置文件

[root@cc126 ~]# egrep -v "#|^$" /opt/prometheus/prometheus1.yml 
global:
alerting:
  alertmanagers:
  - static_configs:
    - targets: ['localhost:9093']
rule_files:
  - "/opt/*.yml"
scrape_configs:
  - job_name: 'prometheus'
    static_configs:
    - targets: ['localhost:9090']
  - job_name: 'win7'
    static_configs:
    - targets: ['192.168.8.188:9182']

启动prometheus

docker run  -d \
  -p 9090:9090 --name prometheus \
  -v /opt/prometheus/prometheus1.yml:/etc/prometheus/prometheus.yml \
  -v /opt/prometheus/data:/prometheus \
  -v /rule:/opt #告警规则
  prom/prometheus:latest \
  --config.file=/etc/prometheus/prometheus.yml \
  --storage.tsdb.retention.time=100d \
  --web.enable-lifecycle #配置支持热加载

语法检查

[root@cc126 ~]# docker exec prometheus promtool check config /etc/prometheus/prometheus.yml
Checking /etc/prometheus/prometheus.yml
  SUCCESS: 0 rule files found

3.grafana安装

chmod 777 -R /opt/grafana
docker run -d \
 -p 3000:3000 --name grafana \
 -v /opt/grafana:/var/lib/Grafana grafana/grafana:latest

zabbix插件安装

grafana-cli plugins install alexanderzobnin-zabbix-app
官网连接
https://grafana.com/grafana/plugins/alexanderzobnin-zabbix-app/installation

在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值