Linux与windows资源监控(prometheus+grafana)
(一) 下载安装监控软件
-
下载node_exporter。(linux)
wget https://github.com/prometheus/node_exporter/releases/download/v0.17.0/node_exporter-0.17.0.linux-amd64.tar.gz
tar zxfv node_exporter-0.17.0.linux-amd64.tar.gz
后台启动:以9101端口做监听端口
启动命令:
nohup ./node_exporter --web.listen-address=":9101" &
ps -ef | grep node_
查看进程
netstat -tunlp | grep node
查看端口
netstat -tunlp | grep 9101 -
下载wmi_exporter.(windows)
软件位置
https://github.com/martinlindhe/wmi_exporter/releases
直接安装
以9182 端口做监听端口
(二) prometheus.xml修改(linux+windows)
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
scrape_timeout is set to the global default (10s).
alerting:
alertmanagers:
- static_configs:
targets:
- alertmanager:9093
rule_files:
- “first_rules.yml”
- “second_rules.yml”
scrape_configs:
The job name is added as a label job=<job_name>
to any timeseries scraped from this config.
- job_name: ‘prometheus’
metrics_path defaults to ‘/metrics’
scheme defaults to ‘http’.
static_configs: targets: [‘localhost:9090’]
labels:
instance: prometheus
#节点监控
#windows
static_configs:
-
targets: [‘ip:9182’]
labels:
instance: name1
#linux
- job_name: name2’
static_configs: targets: [‘ip:9101’]
labels:
instance: ip
name: name
env: linux
重新启动prometheus;
(三) 打开端口
-
Linux
sudo iptables -I INPUT -s 192.16.4.227 -p tcp --dport 9101 -j ACCEPT -
windows
windows防火墙-高级-入站规则-新建规则-端口(选择tcp连接),
教程
https://zhidao.baidu.com/question/921418892992256059.html
(四) grafana导入dashboard;
windows的dashboard模板;
下载位置: https://grafana.com/dashboards/8781
D:\grafana_dashboard\windows-node_rev1.json
Linux的dashboard模板;
下载位置: https://grafana.com/dashboards/8919/revisions
D:\grafana_dashboard\1-node-exporter-0-16-0-17-for-prometheus_rev7.json
展示界面如下;
linux
windows;
- Prometheus + Grafana 监控 Linux 和 MySQL 安装配置
- LR监控系统资源windows、linux、unix
- pika主备部署(redis-sentinel)+监控(prometheus+grafana)
- Docker实践(八):Prometheus + Grafana + 钉钉搭建监控告警系统
- Prometheus+Grafana打造Mysql监控平台
- prometheus+grafana构建应用监控(三)
- 安装prometheus+grafana监控mysql redis kubernetes等
- prometheus+grafana+docker 监控tomcat jvm
- Prometheus+Grafana搭建监控系统
- prometheus+grafana 监控生产环境机器的系统信息、redis、mongodb以及jmx
- Spring Boot 应用可视化监控(Prometheus + Grafana)
- 机房ping监控 smokeping+prometheus+grafana
- prometheus+grafana构建应用监控(一)
- 使用 prometheus + grafana 监控 ceph 集群
- Docker+ cadvisor+Prometheus+Grafana监控部署实践
- LoadRunner 添加linux,windows监控资源
- Kubernetes + Prometheus + Grafana 集群监控
- 使用Prometheus+grafana打造高逼格监控平台 推荐
- 基于prometheus+grafana 搭建监控mysql redis mongodb等
- 使用Prometheus+Grafana监控MySQL实践