probe_http_status_code{instance="xxxx",job="web_status"}
probe_http_status_code{job="web_status"}
prometheus 检查配置文件是否正确:
prometheus-2.13.0.linux-amd64//promtool check config prometheus.yml
prometheus 服务器启动重启脚本
prometheus启动命令添加参数 --web.enable-lifecycle
然后热重启:curl -XPOST http://localhost:9090/-/reload
[root@scanDev prometheus-2.13.0.linux-amd64]# cat prosv.sh #!/bin/sh args1=$1 g2=`ps aux|egrep prometheus-2.13.0|grep -v grep|awk -F'[ ]+' '{print $2}'` function start() { daemonize /usr/local/prometheus-2.13.0.linux-amd64/prometheus --config.file=/usr/local/prometheus-2.13.0.linux-amd64/prometheus.yml --web.listen-address=:9999 --web.enable-lifecycle } function stop() { kill $g2; sleep 1; #kill $g2; } function restart() { stop sleep 2 start } case $args1 in start) start ;; stop) stop ;; restart) restart ;; *) echo "Usage {start|stop|restart}" ;; esac