In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the relevant knowledge of "how to realize the alarm notification of the docker deployment nailing robot". The editor shows you the operation process through the actual case, the operation method is simple and fast, and the practicality is strong. I hope this article "how to realize the alarm notification of the docker deployment nailing robot" can help you solve the problem.
Directory structure
[root@node1 ~] # tree promprom ├── docker-compose.yml # docker-compose file ├── grafana # grafana data mount ├── prometheus_data # Prometheus data mount ├── rules # alarm rule file │ ├── cpu_over.yml │ ├── disk_over.yml │ memory_over.yml │ └── node_alived.yml └── yml ├── alertmanager.yml alertmanager Set ├── config.yml nailing robot configuration └── prometheus.yml Prometheus configuration [root@node1 prom] # cat docker-compose.yml version: "3.7" services: node-exporter: image: prom/node-exporter:latest container_name: "node-exporter" ports:-"9100 ports" restart: always cadvisor: image: google/cadvisor:latest container_name: cadvisor restart: always Ports:-'8080 prom/prometheus:latest container_name 8080' prometheus: image: prom/prometheus:latest container_name: prometheus ports:-"9090 prometheus ports" restart: always volumes:-". / yml/prometheus.yml:/etc/prometheus/prometheus.yml"-". / prometheus_data:/prometheus"-". / rules:/etc/prometheus/rules" grafana: image: grafana/grafana container_ Name: "grafana" ports:-"3000restart: always volumes: -. / grafana:/var/lib/grafana" alertmanager: image: prom/alertmanager:latest restart: "always" ports:-9093 container_name: "alertmanager" volumes:-". / yml/alertmanager.yml:/etc/alertmanager/alertmanager.yml" webhook: image: timonwong/ Prometheus-webhook-dingtalk restart: "always" ports:-8060 container_name: "webhook" volumes: -. / yml/config.yml:/etc/prometheus-webhook-dingtalk/config.yml "[root@node1 prom] # cat yml/prometheus.yml # my global configglobal: # this fragment specifies the global configuration of prometheus Such as collection interval, grab timeout and so on. Scrape_interval: 1m # fetching interval default 1m evaluation_interval: 1m # Evaluation rule interval default 1m # scrape_timeout is set to the global default (10s). # Alertmanager configuration # this section specifies the alarm configuration The main purpose here is to specify prometheus to push alarm rules to the specified alertmanager instance address alerting: alertmanagers:-static_configs:-targets:-192.168.10.10 alerting 909 alarm Load rules once and periodically evaluate them according to the global 'evaluation_interval'.rule_files:-"/ etc/prometheus/rules/*.yml" # alarm rule file #-"cpu_over.yml" # -"disk_over.yml" #-"memory_over.yml" #-"node_alived.yml" # A scrape configuration containing exactly one endpoint to scrape:# Here it's Prometheus itself.# crawl configuration list scrape_configs:-job_name: "prometheus" static_configs:-targets: ["localhost:9090"]-job_name: "linux" static_configs:-targets: ["192.168.10.10 A scrape configuration containing exactly one endpoint to scrape:# Here it's Prometheus itself.# 9100" "192.168.10.10 resolve_timeout 8080", "192.168.10.20 resolve_timeout 9100", "192.168.10.20 resolve_timeout 8080"] [root@node1 prom] # resolve_timeout: 5m # send recovery notification route: receiver: webhook # set recipient group_wait: 1m # group alarm waiting time if there are no new events within the specified time. After the waiting time ends, if the same group of alarms are issued together, group_interval: 1m # the interval between two groups of alarms. Repeat_interval: 1m # repeat alarm interval to reduce the frequency of sending the same email. Group_by: [alertname] # uses that tag as a grouping. Receivers: # Notification recipient list-name: webhook webhook_configs:-url: http://192.168.10.10:8060/dingtalk/webhook1/send send_resolved: true### [root@node1 prom] # Cat yml/config.yml targets: webhook1: url: https://oapi.dingtalk.com/robot/send?access_token=XXXXXX # webhook secret: SEC000000 # countersign [root@node1 prom] # cat alertmanager.ymlglobal: resolve_timeout: 5m # send recovery notification route: receiver: webhook # set receiver group_wait: 1m # group alarm waiting time if there are no new events within the specified time. After the waiting time ends, if the same group of alarms are issued together, group_interval: 1m # the interval between two groups of alarms. Repeat_interval: 1m # repeat alarm interval to reduce the frequency of sending the same email. Group_by: [alertname] # uses that tag as a grouping. Receivers: # Notification recipient list-name: webhook webhook_configs:-url: http://192.168.10.10:8060/dingtalk/webhook1/send send_resolved: true### [root@node1 prom] # Cat yml/config.yml targets: webhook1: url: https://oapi.dingtalk.com/robot/send?access_token=XXXXXX # webhook secret: SEC000000 # countersign
Docker-compose up-d starts the container after configuration
Http://localhost:8080 # cadvisor
Http://localhost:8080/metrics # cadvisor data
Http://localhost:9100/metrics # node-exporter data
Http://localhost:9090 # prometheus
Http://localhost:3000 # grafana
Http://localhost:9090/alerts
Realize the effect
This is the end of the content about "how to realize the alarm notification of docker deployment nailing robot". Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.