prometheus监控实战( 五 )

授权并运行脚本
chmod +x  jvm_stat_exporter.sh./jvm_stat_exporter.sh2、查看jvm指标

  • 在pushgateway查看如下图
    prometheus监控实战

    文章插图
  • 在grafana查看监控指标如下
    prometheus监控实战

    文章插图
第五节、监控服务5.1、部署Blackbox Exporter1、安装
tar -xvf blackbox_exporter-0.19.0.linux-amd64.tar.gzcd blackbox_exporter-0.19.0.linux-amd64/2、启动
nohup ./blackbox_exporter &3、访问浏览器访问http://192.168.10.10:9115
5.2、监控端口1、配置promethues集成blackbox_exporter监控端口22
  - job_name: 'prometheus_port_status'    metrics_path: /probe    params:        module: [tcp_connect]    static_configs:        - targets: ['192.168.10.14:22]          labels:            instance: port_22_ssh            hostip: 192.168.10.14            group: 'tcp'    relabel_configs:        - source_labels: [__address__]          target_label: __param_target        - target_label: __address__          replacement: 192.168.10.10:91152、重启prometheus
nohup ./prometheus --config.file=./prometheus.yml --web.listen-address=:49800 1>nohup.log 2>&1 &提示:停掉prometheus,再次启动
5.3、监控http1、配置promethues集成blackbox_exporter监控http
  - job_name: web_status    metrics_path: /probe    params:        module: [http_2xx]    static_configs:        - targets: ['http://192.168.10.15:8080]          labels:            instance: starweb            hostip: 192.168.10.15            group: 'web'    relabel_configs:        - source_labels: [__address__]          target_label: __param_target        - target_label: __address__          replacement: 192.168.10.10:91152、重启prometheus
nohup ./prometheus --config.file=./prometheus.yml --web.listen-address=:49800 1>nohup.log 2>&1 &提示:停掉prometheus,再次启动

经验总结扩展阅读