1.从github上下载windows_exporter.msi
2.批处理
msiexec /package “\nas01\it-install\windows_exporter-0.21.0-amd64.msi”
并修改成.bat格式
命令:msiexec /package “你的安装MSI文件的全路径”.
3.执行cmd
4.查看服务,服务正常!
# my global config
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).# Alertmanager configuration
alerting:alertmanagers:- static_configs:- targets:- localhost:9093#- alertmanager:9093# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:- "rules/node_down.yml"- "rules/cpu_over.yml"- "rules/memory_over.yml"- "rules/disk_over.yml"- "rules/swap_over.yml"# - "first_rules.yml"# - "second_rules.yml"# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:# The job name is added as a label `job=` to any timeseries scraped from this config.- job_name: "prometheus"# metrics_path defaults to '/metrics'# scheme defaults to 'http'.static_configs:- targets: ["localhost:9090"]- targets: ["localhost:9100"]- job_name: '2288hv5'static_configs:- targets:- 10.99.*.*metrics_path: /snmpparams:module: [华为2288Hv5服务器]relabel_configs:- source_labels: [__address__]target_label: __param_target- source_labels: [__param_target]target_label: instance- target_label: __address__replacement: 10.99.1.41:9116 # The SNMP exporter's real hostname:port.# - job_name: 'nac'
# static_configs:
# - targets:
# - 10.99.*.*
# metrics_path: /snmp
# params:
# module: [nac6100]
# relabel_configs:
# - source_labels: [__address__]
# target_label: __param_target
# - source_labels: [__param_target]
# target_label: instance
# - target_label: __address__
# replacement: 10.99.31.206:9116 # The SNMP exporter's real hostname:port.- job_name: "it-manager-service"static_configs:- targets: ["10.99.*.*:9182"]- job_name: "it-manager-linux"static_configs:- targets: ["10.99.*.*:9100"]- job_name: "it-manager-windows"static_configs:- targets: ["10.99.*.**:9182"]
四、安装node_exporter
1.查看linux架构
[root@localhost ~]# uname -m
x86_64
2.下载node_exporter
安装node_exporter
解压
tar zxf node_exporter-1.5.0.linux-386.tar.gz -C /usr/local/
cd /usr/local/
映射软链接
ln -sv /usr/local/node_exporter-1.5.0.linux-386/ /usr/local/node_exporter
cd node_exporter
新增服务
vim /etc/systemd/system/node_exporter.service
[Unit]
Description=node_exporter
After=network.target[Service]
Restart=on-failure
ExecStart=/usr/local/node_exporter/node_exporter[Install]
WantedBy=multi-user.target
开机自启并重启
systemctl start node_exporter && systemctl status node_exporter && systemctl enable node_exporter
Prometheus查看host信息
下一篇:【IDEA插件开发】环境搭建