当前位置:网站首页>【Prometheus】4. Monitoring cases
【Prometheus】4. Monitoring cases
2022-06-24 15:45:00 【Try something new for a long time】
monitor linux The server
node_exporter summary
node_exporter: be used for *NIX System monitoring , Use GO Collector for language development
Using document :https://prometheus.io/docs/guides/node-exporter/
Github:https://github.com/prometheus/node_exporter
exprot list :https://prometheus.io/docs/instrumenting/exporters/
Download and run node_exporter:
- download :wget https://github.com/prometheus/node_exporter/releases/download/v1.1.2/node_exporter-1.1.2.linux-amd64.tar.gz
- decompression :tar -zxvf node_exporter-1.1.2.linux-amd64.tar.gz
- Move to the working directory :mv node_exporter-1.1.2.linux-amd64 /usr/local/node_exporter
- Configure for system service :
- vim /usr/lib/systemd/system/node_exporter.service
- systemctl daemon-reload
- systemctl start node_exporter
- netstat -antp | grep 9100
Configure through service discovery node_exporter
1. modify prometheus.yml
2. Add service discovery profile
3. Check the configuration file and restart prometheus
- ./promtool check config prometheus.yml
- kill -hup [pid]
monitor CPU, Memory , Hard disk
CPU Usage rate :
100 - (avg(irate(node_cpu_seconds_total{mode="idle"}[5m])) by (instance)*100)
Memory usage :
100 - (node_memory_MemFree_bytes+node_memory_Cached_bytes+node_memory_Buffers_bytes) / node_memory_MemTotal_bytes * 100
Hard disk usage :
100 - (node_filesystem_free_bytes{mountpoint="/", fstype=~"ext4|xfs"} /node_filesystem_size_bytes{mountpoint="/", fstype=~"ext4|xfs"} * 100)
Monitoring service status
1. start-up node_exporter Service monitoring vim /usr/lib/systemd/system/node_exporter.service
2. Reload the configuration file systemctl daemon-reload
3. Restart the startup service systemctl restart node_exporter
4. View the restart results ps -ef | grep node_exporter
5. View service status
Use grafana Display monitoring data
grafana: Open source measurement analysis and visualization system , Initial password admin
Download address :https://grafana.com/grafana/download
More Kanban :https://grafana.com/dashboards
Usage method
1. docker install :docker run -d --name=grafana -p 3000:3000 grafana/grafana
2. Add data sources
3. Create dashboard
4. Import other dashboards
----
monitor docker The server
cAdvisor (Container Advisor) Used to collect running container resource usage and performance information ,go Language development
Download address :https://github.com/google/cadvisor
More Kanban :https://grafana.com/dashboards/193
Usage method :
1. install
docker run \ --volume=/:/rootfs:ro \ --volume=/var/run:/var/run:ro \ --volume=/sys:/sys:ro \ --volume=/var/lib/docker/:/var/lib/docker:ro \ --volume=/dev/disk/:/dev/disk:ro \ --publish=8080:8080 \ --detach=true \ --name=cadvisor \ --privileged \ --device=/dev/kmsg \ gcr.io/cadvisor/cadvisor:$VERSION
2. Check whether the startup is successful docker ps -l
3. Add to prometheus monitor
- modify prometheus The configuration file :
- Check prometheus Configuration file modification :./promtool check config prometheus.yml
- restart prometheus
- Import docker grafana The dashboard 193
边栏推荐
- A series of problems caused by IPVS connection reuse in kubernetes
- 刚刚阿里面软件测试回来,3+1面任职阿里P7,年薪28*15薪
- Monitoring and warning | is the website attacked?
- FPGA based analog I ² C protocol system design (Part 2)
- CIA security model - use PGP to describe privacy and integrity of network security CIA model
- How to expand disk space on AWS host
- The first in China! Tencent cloud key management system passes password application verification test
- MySQL development specification
- 一文详解JackSon配置信息
- Precautions for using JMeter suite to build a pressure test environment
猜你喜欢
VNC Viewer方式的远程连接树莓派
60 个神级 VS Code 插件!!
Mongodb Getting started Practical Tutoriel: Learning Summary Table des matières
Linux记录-4.22 MySQL5.37安装(补充)
[my advanced OpenGL learning journey] learning notes of OpenGL coordinate system
Three solutions for Jenkins image failing to update plug-in Center
Most common usage of vim editor
日志记录真没你想的那么简单
clang: warning: argument unused during compilation: ‘-no-pie‘ [-Wunused-command-line-argument]
Vim编辑器的最常用的用法
随机推荐
07. Tencent cloud IOT device side learning - Data Template
In 2021, big companies often ask IOS interview questions -- runloop
leetcode 139. Word Break 單詞拆分(中等)
[tke] multiple ingress controllers are used in the cluster
The first in China! Tencent cloud key management system passes password application verification test
"Industry outlook" analysis of five major trends in China's security video surveillance industry
Here comes Wi Fi 7. How strong is it?
Design of vga/lcd display controller system based on FPGA (Part 2)
Most common usage of vim editor
Jenkins的便捷式安装
The penetration of 5g users of operators is far slower than that of 4G. The popularity of 5g still depends on China Radio and television
Motion planning of floating base robot
Why is it easy for enterprises to fail in implementing WMS warehouse management system
【C语言刷题——Leetcode12道题】带你起飞,飞进垃圾堆
Universal file online preview project, open source!
Data stack technology sharing: how to use data stack for data collection?
How about stock online account opening and account opening process? Is it safe to open an account online?
HMM to CRF understanding and learning notes
Vim编辑器的最常用的用法
实现领域驱动设计 - 使用ABP框架 - 领域逻辑 & 应用逻辑