prometheus、alertmanager、pushgateway使用basic_auth增加密码

一、prometheus

1. prometheus增加启动参数

"args": "--web.config.file=/home/password/config.yml" 

config.yaml文件内容

basic_auth_users:
  admin: $2y$12$yt/y9jI.G0rPAz8qcK1InukQhVxpV73qx6R1UksuxNelRy/BKWelC 

#此处为生成密码用下面命令(注意如果是一套集群可以执行一次复用)
htpasswd -nBC 12 '' | tr -d ':\n'
New Password: #此处输入密码
Re-type new password: #重新输入

2.prometheus主配中增加

- job_name: prometheus
  basic_auth: #增加此配置注意格式
    username: admin #增加用户名
    password: 123456 #此处为不加密文本   
  scrape_interval: 15s
  scrape_timeout: 10s
  metrics_path: /metrics
  scheme: h
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值