监控使用docker方式实现
1、创建运行环境文件
[root@MonitorServer vmware_exporter]# vi /opt/vmware/config.env #添加以下内容
VSPHERE_USER=administrator@vsphere.local
VSPHERE_PASSWORD=密码
VSPHERE_HOST=IP
VSPHERE_IGNORE_SSL=TRUE
VSPHERE_SPECS_SIZE=2000
2、创建容器运行
[root@MonitorServer vmware_exporter]# docker run -itd -p 9272:9272 --name vmware_exporter --env-file /opt/vmware/config.env pryorda/vmware_exporter
aed8c8ca05a5492d81c381b9eaa43bf0fa4571bc2bd5347205ec3bab3fbc35a9
[root@MonitorServer vmware_exporter]# docker update --restart=always aed8c8ca05a5492d81c381b9eaa43bf0fa4571bc2bd5347205ec3bab3fbc35a9 #设置容器自动运行
3、访问验证http://IP:9272/metrics
4、编辑prometheus.yml文件
[root@MonitorServer vmware_exporter]# vi /opt/prometheus/prometheus.yml
- job_name: 'vmware_VShere'
metrics_path: '/metrics'
static_configs:
- targets:
- 'VShere'
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: localhost:9272
[root@MonitorServer vmware_exporter]# systemctl restart prometheus
5、查看数据源
6、添加仪表盘11243
大佬,写博客要细心点呀
2、创建容器运行
6、添加仪表盘 11243
好的,下次注意