Hi,

the Blackbox exporter doesn't do full-string matching for these regexes,
but substring matching, so it also matches if the body contains "OK"
anywhere (which is true for "NOK"). Try '^OK$` instead?

Also, in case your HTTP endpoint returns a status code other than 2xx, you
will have to set the "valid_status_codes" list to the allowed ones (it
defaults to 2xx).

Regards,
Julius

On Mon, Mar 22, 2021 at 9:03 AM [email protected] <
[email protected]> wrote:

> Can someone please help! I am confused here.
>
> On Monday, March 15, 2021 at 12:20:03 PM UTC+5:30 [email protected]
> wrote:
>
>>
>> Hi. I am using blackbox_exporter version 0.18.0 and I am using http
>> prober to check if the response by my URL is "OK" or not. Below is the
>> configuration of the module.
>>
>>   http_healthcheck_ok:
>>     prober: http
>>     timeout: 10s
>>     http:
>>       valid_http_versions: ["HTTP/1.1", "HTTP/2.0", "HTTP/1.0"]
>>      * fail_if_body_not_matches_regexp: ['OK']*
>>       method: GET
>>       no_follow_redirects: false
>>       fail_if_ssl: false
>>       fail_if_not_ssl: false
>>       tls_config:
>>         insecure_skip_verify: true
>>       preferred_ip_protocol: "ip4"
>>
>> So, whenever my URL throws anything other than OK in the response body,
>> probe_failed_due_to_regex should 1 right? But when the URL was throwing *NOK
>> *as the response body, probe_failed_due_to_regex was still 0, whereas it
>> should be 1. Am I missing something here?
>>
>> Thanks in advance!
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/e6db4504-48e6-4ad9-a640-1e63dc6e472en%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/e6db4504-48e6-4ad9-a640-1e63dc6e472en%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Julius Volz
PromLabs - promlabs.com

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CAObpH5ydch_t8jfwig1gnms%3D6ydyWg%3Dg9zG4poZZGaJHm%3Dh%2BxQ%40mail.gmail.com.

Reply via email to