prometheus认证登录


# 使用此脚本对密码进行加密
import getpass
import bcrypt
 
password = getpass.getpass("Password: ")
hashed_password = bcrypt.hashpw(password.encode("utf-8"), bcrypt.gensalt())
print(hashed_password.decode())
import bcrypt
bcrypt.hashpw("密码".encode("utf-8"), bcrypt.gensalt()).decode()

prometheus启动参数

--web.config.file=/path/config/prometheus-web.yml

prometheus-web.yml内容

basic_auth_users:
  ${prometheus_user}: ${prometheus_pass}

 *** alertmanager也是一样