Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何设置prometheus、grafana和blackbox_出口商的ping损失率_Grafana_Prometheus - Fatal编程技术网

如何设置prometheus、grafana和blackbox_出口商的ping损失率

如何设置prometheus、grafana和blackbox_出口商的ping损失率,grafana,prometheus,Grafana,Prometheus,我正在尝试使用普罗米修斯、格拉法纳和blackbox_exporter通过ping(icmp)监控我的服务器。我们最近面临网络不稳定,但我的设置无法显示警报。我想知道我应该使用“探测持续时间”还是其他探测方法 grfana设置指标:探测持续时间秒,面板数据源为普罗米修斯 blackbox.yml: modules: icmp:

我正在尝试使用普罗米修斯、格拉法纳和blackbox_exporter通过ping(icmp)监控我的服务器。我们最近面临网络不稳定,但我的设置无法显示警报。我想知道我应该使用“探测持续时间”还是其他探测方法

grfana设置指标:探测持续时间秒,面板数据源为普罗米修斯

blackbox.yml:

modules:
  icmp:                                                                                                                                                                                       
    prober: icmp                                                                                                                                                                              
    timeout: 5s                                                                                                                                                                               
    icmp:                                                                                                                                                                                     
      protocol: "icmp"                                                                                                                                                                        
      preferred_ip_protocol: "ip4"                       
普罗米修斯:

global:                                                                                                                                                                                       
  scrape_interval:     15s                                                                                                                                                                                                  
  external_labels:                                                                                                                                                                            
    monitor: 'codelab-monitor'                                                                                                                                                                
scrape_configs:                                                                                                                                                                               
  - job_name: 'blackbox'                                                                                                                                                                      
    scrape_interval: 5s                                                                                                                                                                       
    metrics_path: /probe                                                                                                                                                                      
    params:                                                                                                                                                                                   
      module: [icmp] #ping                                                                                                                                                                    
    static_configs:                                                                                                                                                                           
      - targets: ['192.168.1.29']                                                                                                                                                            
        labels:                                                                                                                                                                               
          group: 'env A'                                                                                                                                                                   
      - targets: ['192.168.2.185', '192.168.3.185', '192.168.4.185']                                           
        labels:                                                                                                                                                                               
          group: 'env B' 
    relabel_configs:                                                                                                                                                                          
      - source_labels: [__address__]                                                                                                                                                          
        regex: (.*)(:80)?                                                                                                                                                                     
        target_label: __param_target                                                                                                                                                          
        replacement: ${1}                                                                                                                                                                     
      - source_labels: [__param_target]                                                                                                                                                       
        regex: (.*)                                                                                                                                                                           
        target_label: instance                                                                                                                                                                
        replacement: ${1}                                                                                                                                                                     
      - source_labels: []                                                                                                                                                                     
        regex: .*                                                                                                                                                                             
        target_label: __address__                                                                                                                                                             
        replacement: 127.0.0.1:9115

probe\u success
将是1/0,这取决于ping是否成功。

在我的例子中,我手动键入了“ping 192.168.2.185”,并丢失了25%。有更好的方法吗?在浏览blackbox_explorer的源代码后,我发现它似乎只有两个变量CAN audio,probe_success和probe_duration_Second。我发现probe_success的所有值都是零,所以它也没用(@DanielYCLin那么听起来好像无法从导出器ping到目标。您可能需要运行其他导出器,从其他位置获取度量,以了解您的站点可能无法使用的位置。如果您不想自己运行,可以使用我的服务: