node-exporter https认证
wget https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz添加 Basic Auth
[root@localhost node_exporter]# yum install httpd-tools -y
[root@localhost node_exporter]# htpasswd -nBC 12 '' |tr -d ':\n'
New password: # 我这里设置密码: Ye5zHuxUQANGj6Bczq
Re-type new password:
$2y$12$v0NACvxbfJ/3KeyhQOSyjOkdLOXh26qBQEo5VqqTlAvwSDUVcO9yS
# 把生成的秘钥放到 node.yaml
[root@localhost node_exporter]# cat > node.yaml <<EOF
basic_auth_users:
# 当前设置的用户名为 prometheus , 可以设置多个
prometheus: $2y$12$v0NACvxbfJ/3KeyhQOSyjOkdLOXh26qBQEo5VqqTlAvwSDUVcO9yS
<<EOFNode Exporter 使用 TLS
Basic Auth + TLS
Last updated