Prometheus Web认证和告警实现


一、Prometheus基于nginx反代实现Web认证

    部署过prometheus的应该都知道,它是没有做任何认证的,直接输入IP+端口就能访问,这意味着你的数据在公网上裸奔,这在生产环境中是绝对不行的。可通过nginx的反向代理实现Prometheus Web认证。

Web_certifica_for_prometheus.sh:

#!/bin/bash
# Write by afei

# judge install nginx
if rpm -qa |grep ^nginx-1 && rpm -qa |grep ^nginx-mod; then
	nginx -V
else
	yum -y install nginx
	nginx -V
fi

htpasswd -c /etc/nginx/pr

猜你喜欢

转载自blog.csdn.net/qq_41490561/article/details/106742026