惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
T
Troy Hunt's Blog
L
Lohrmann on Cybersecurity
S
Schneier on Security
Spread Privacy
Spread Privacy
WordPress大学
WordPress大学
阮一峰的网络日志
阮一峰的网络日志
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
G
GRAHAM CLULEY
博客园 - 【当耐特】
有赞技术团队
有赞技术团队
SecWiki News
SecWiki News
博客园 - 叶小钗
博客园 - Franky
V
Vulnerabilities – Threatpost
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
O
OpenAI News
小众软件
小众软件
V
V2EX
N
News and Events Feed by Topic
T
The Exploit Database - CXSecurity.com
博客园 - 三生石上(FineUI控件)
The Hacker News
The Hacker News
Project Zero
Project Zero
The Last Watchdog
The Last Watchdog
雷峰网
雷峰网
Google Online Security Blog
Google Online Security Blog
T
Tailwind CSS Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
量子位
D
Docker
Recent Announcements
Recent Announcements
T
Threat Research - Cisco Blogs
P
Privacy International News Feed
爱范儿
爱范儿
PCI Perspectives
PCI Perspectives
Jina AI
Jina AI
博客园 - 司徒正美
云风的 BLOG
云风的 BLOG
大猫的无限游戏
大猫的无限游戏
V2EX - 技术
V2EX - 技术
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Register - Security
The Register - Security
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
Cloudbric
Cloudbric
S
Security Affairs
F
Fortinet All Blogs

jobcher on 打工人日志

2023-12-21 打工人日报 2023-12-20 打工人日报 2023-12-19 打工人日报 2023-12-18 打工人日报 2023-12-17 打工人日报 2023-12-16 打工人日报 2023-12-15 打工人日报 2023-12-14 打工人日报 2023-12-13 打工人日报 2023-12-12 打工人日报 2023-12-11 打工人日报 2023-12-10 打工人日报 2023-12-09 打工人日报 2023-12-08 打工人日报 2023-12-07 打工人日报 2023-12-06 打工人日报 2023-12-05 打工人日报 2023-12-04 打工人日报 2023-12-03 打工人日报 2023-12-02 打工人日报 2023-12-01 打工人日报 2023-11-30 打工人日报 2023-11-29 打工人日报 2023-11-28 打工人日报 2023-11-27 打工人日报 2023-11-26 打工人日报 2023-11-25 打工人日报 2023-11-24 打工人日报 2023-11-23 打工人日报 2023-11-22 打工人日报 2023-11-21 打工人日报 2023-11-20 打工人日报 2023-11-19 打工人日报 2023-11-17 打工人日报 2023-11-16 打工人日报 2023-11-15 打工人日报 2023-11-14 打工人日报 2023-11-13 打工人日报 2023-11-12 打工人日报 2023-11-11 打工人日报 2023-11-10 打工人日报 2023-11-09 打工人日报 2023-11-08 打工人日报 2023-11-07 打工人日报 2023-11-06 打工人日报 2023-11-05 打工人日报 2023-11-04 打工人日报 2023-11-03 打工人日报 2023-11-02 打工人日报 2023-11-01 打工人日报 2023-10-31 打工人日报 2023-10-30 打工人日报 2023-10-29 打工人日报 2023-10-28 打工人日报 2023-10-27 打工人日报 2023-10-26 打工人日报 2023-10-25 打工人日报 2023-10-24 打工人日报 2023-10-23 打工人日报 2023-10-22 打工人日报 2023-10-21 打工人日报 2023-10-20 打工人日报 2023-10-19 打工人日报 2023-10-18 打工人日报 2023-10-17 打工人日报 2023-10-16 打工人日报 2023-10-15 打工人日报 2023-10-14 打工人日报 2023-10-13 打工人日报 2023-10-12 打工人日报 2023-10-11 打工人日报 2023-10-10 打工人日报 2023-10-09 打工人日报 2023-10-07 打工人日报 2023-10-06 打工人日报 2023-10-05 打工人日报 2023-10-04 打工人日报 2023-10-03 打工人日报 2023-10-02 打工人日报 2023-10-01 打工人日报 2023-09-30 打工人日报 2023-09-29 打工人日报 2023-09-28 打工人日报 2023-09-27 打工人日报 2023-09-26 打工人日报 2023-09-25 打工人日报 2023-09-24 打工人日报 2023-09-23 打工人日报 2023-09-22 打工人日报 2023-09-21 打工人日报 2023-09-20 打工人日报 2023-09-19 打工人日报 2023-09-18 打工人日报 2023-09-17 打工人日报 2023-09-16 打工人日报 2023-09-15 打工人日报 2023-09-14 打工人日报 2023-09-13 打工人日报 2023-09-12 打工人日报 2023-09-11 打工人日报
prometheus grafana alertmanager 安装配置
2022-01-13 · via jobcher on 打工人日志

prometheus+grafana+alertmanager 安装配置

服务器监控告警系统搭建,通过 exporter 获取节点信息到 prometheus。prometheus 配置规则,使 garfana 和 alertmanager 能够接受到数据,分别展示数据和发送告警

参数

VM :192.168.99.78

端口服务
9100node_exporter
3000grafana
9090prometheus
9115blackbox_exporter

安装

grafa 安装

  1. docker 安装
1docker run -d -p 3000:3000 \
2--name=grafana \
3-v grafana-storage:/var/lib/grafana \
4grafana/grafana:8.3.3

prometheus 安装

  1. 下载
1wget https://github.com/prometheus/prometheus/releases/download/v2.32.1/prometheus-2.32.1.linux-amd64.tar.gz
2tar -zxvf prometheus-2.32.1.linux-amd64.tar.gz
3cd prometheus-2.32.1.linux-amd64
4mkdir -p file_sd
5mkdir -p rules
  1. 运行 prometheus
1killall prometheus
2nohup ./prometheus --config.file=prometheus.yml &
3# 查看运行状况
4tail -f nohup.out

node_exporter 安装

  1. docker-compose 安装
1version: "3"
2services:
3  node-exporter:
4    image: prom/node-exporter:v1.3.1
5    container_name: node-exporter
6    restart: always
7    ports:
8      - "9100:9100"
  1. 二进制安装
1wget https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz
2tar -zxvf node_exporter-1.3.1.linux-amd64.tar.gz
3cd node_exporter-1.3.1.linux-amd64
4nohup ./node_exporter &

blackbox_exporter

  1. 二进制安装
1wget https://github.com/prometheus/blackbox_exporter/releases/download/v0.19.0/blackbox_exporter-0.19.0.linux-amd64.tar.gz
2tar -zxvf blackbox_exporter-0.19.0.linux-amd64.tar.gz
3cd blackbox_exporter-0.19.0.linux-amd64
4nohup ./blackbox_exporter &

Alertmanager

  1. 二进制安装
1wget https://github.com/prometheus/alertmanager/releases/download/v0.23.0/alertmanager-0.23.0.linux-amd64.tar.gz
2tar -zxvf alertmanager-0.23.0.linux-amd64.tar.gz
3cd alertmanager-0.23.0.linux-amd64
4nohup ./alertmanager &
  1. docker-compose 安装
 1version: "3"
 2services:
 3  alertmanager:
 4    image: "prom/alertmanager:v0.22.2"
 5    volumes:
 6      - "/etc/localtime:/etc/localtime"
 7      - "./alertmanager.yml:/etc/alertmanager/alertmanager.yml"
 8    ports:
 9      - "9093:9093"
10    restart: "always"
11    container_name: "alertmanager"

prometheus.yml 配置

 1global:
 2  scrape_interval: 15s # By default, scrape targets every 15 seconds.
 3
 4  # Attach these labels to any time series or alerts when communicating with
 5  # external systems (federation, remote storage, Alertmanager).
 6  external_labels:
 7    monitor: "codelab-monitor"
 8
 9# Alertmanager configuration
10# alerting:
11#   alertmanagers:
12#   - static_configs:
13#     - targets:
14#       - 192.168.99.78:9093
15
16# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
17# rule_files:
18#   - "./rules/blackbox.yaml"
19#   - "./rules/node-exporter.yaml"
20
21# A scrape configuration containing exactly one endpoint to scrape:
22# Here it's Prometheus itself.
23scrape_configs:
24  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
25  - job_name: "prometheus"
26    # Override the global default and scrape targets from this job every 5 seconds.
27    scrape_interval: 5s
28    static_configs:
29      - targets: ["localhost:9090"]
30
31  - job_name: "node-exporter"
32    file_sd_configs:
33      - files:
34          - "./file_sd/node-exporter.yaml"
35        refresh_interval: 5s
36
37  - job_name: "blackbox"
38    metrics_path: /probe
39    scrape_interval: 30s
40    scrape_timeout: 30s
41    params:
42      module: [http_2xx] # Look for a HTTP 200 response.
43    file_sd_configs:
44      - files:
45          - "./file_sd/blackbox.yaml"
46        refresh_interval: 5s
47    relabel_configs:
48      - source_labels: [__address__]
49        target_label: __param_target
50      - source_labels: [__param_target]
51        target_label: instance
52      - target_label: __address__
53        replacement: 192.168.99.78:9115

node-exporter.yaml

1- targets: ["192.168.99.78:9100"]
2  labels:
3    instance: <实例名称>
4- targets: ["<IP>:9100"]
5  labels:
6    instance: 实例名称

blackbox.yaml

1- targets:
2    - https://www.jobcher.com
3    - https://<域名>