unknown module "http_basic_auth" blackbox exporter

427 views
Skip to first unread message

Marion Guthmuller

unread,
Aug 28, 2020, 4:12:05 AM8/28/20
to Prometheus Users
Hello,

I was able to create a prometheus job with blackbox exporter default module http_2xx (both are in docker), it works well. However, when I try to use another module, I always have the error: "Unknown module ..."

My prometheus config:

- job_name: 'blackbox'
   metrics_path: /probe
   file_sd_configs:
     - files:
       - '/etc/prometheus/blackbox/targets/*.yml'
   relabel_configs:
     - source_labels: [__address__]
       target_label: instance
     - source_labels: [__address__]
       target_label: __param_target
     - source_labels: [module]
       target_label: __param_module
     - target_label: __address__
       replacement: localhost:9115 # The blackbox exporter

My blackbox.yml:

modules:
   http_2xx:
     prober: http
     timeout: 5s
     http:
       valid_status_codes: []
       method: GET
       no_follow_redirects: false
       fail_if_ssl: false
       fail_if_not_ssl: true
       preferred_ip_protocol: "ip4"
       ip_protocol_fallback: false
    http_basic_auth:
       prober: http
       timeout: 5s
       http:
         method: POST
         basic_auth:
           username: "username"
           password: "password"

And my targets config:

http_2xx.yml

- labels:
     module: http_2xx
   targets:

http_basic_auth.yml

- labels:
     module: http_basic_auth
   targets:

Prometheus discovers correctly the 2 targets but I have an error for the second one "server returned HTTP status 400 Bad Request" and in probe curl : "Unknown module http_basic_auth".

Any idea?

Brian Candler

unread,
Aug 29, 2020, 5:49:15 PM8/29/20
to Prometheus Users
If your blackbox.yml is exactly the same as you posted, then you didn't line up the YAML properly.  It's easiest if you make sure each indent is a multiple of 2 spaces, or use an editor which understands YAML.

Marion Guthmuller

unread,
Aug 31, 2020, 3:07:12 AM8/31/20
to Prometheus Users
Nope, it's a manual indentation in the email... A screenshot from my IDE of my blackbox config:

blackbox_config.png

I also tried to add a header with host in the http part without success...

Marion Guthmuller

unread,
Aug 31, 2020, 3:29:30 AM8/31/20
to Prometheus Users
Error found! I forgot to link my blackbox config file when running blackbox docker... grrr
Reply all
Reply to author
Forward
0 new messages