peomethues 参数设置 监控网站 /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

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 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
[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

  

 

posted @   滴滴滴  阅读(928)  评论(0编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
历史上的今天:
2017-10-17 yum-plugin-priroites这个插件的一个文件。
2017-10-17 什么是EPEL 及 Centos上安装EPEL
2017-10-17 epel源报错怎么解决?
点击右上角即可分享
微信分享提示