node 开启认证
yum install httpd-tools -y
htpasswd -nBC 12 ''|tr -d ':\n'
#修改node的配置文件
vim /usr/local/node_exporter/config.yml
basic_auth_users:
prometheus: $2y$12$P5Hp1sXYFkAgedcO7jyFLeLKmj4Fgv36rirX/ewxLEH6KttIIl/jq
启动使用认证方式
/usr/local/node_exporter/node_exporter --web.config=/usr/local/node_exporter/config.yml
prometheus server开启配置
- job_name: 'webserver'
basic_auth:
username: prometheus
password: 123456
scheme: http
metrics_path: /metrics
static_configs:
- targets: ['192.168.1.106:9100','192.168.1.107:9100']
验证是否开启认证
网友评论