Just judging from the Prometheus config above, Prometheus was scraping the
401 status code targets directly, vs. probing them through the blackbox
exporter, since the necessary relabeling rules (
https://github.com/prometheus/blackbox_exporter#prometheus-configuration)
for that were missing.

On Fri, Feb 5, 2021 at 12:27 PM Rupendra Sen <rupen...@gmail.com> wrote:

> Can you provide the solution?
>
> On Tuesday, 29 December 2020 at 02:55:01 UTC+5:30 srikanth rangan wrote:
>
>> I got it to work finally.
>>
>>
>>
>>
>> On Thu, Dec 24, 2020 at 8:18 PM srikanth rangan <srikant...@gmail.com>
>> wrote:
>>
>>> Hi all,
>>> I have a case wherein I have to poll a target and its normal for the
>>> site to send me "401" code.
>>> However, when I add the entries in prometheus.yml and a new module in
>>> blackbox_exporter.yml, prometheus does not like the 401 error and does not
>>> seem to use the blackbox_exporter at all. (I've started the blackbox on
>>> debug, on command line and its not printing anything)
>>>
>>> */etc/prometheus/prometheus.yml :*
>>> *.....*
>>>   - job_name: 'IDAHO_SERVICE_SVN_AND'
>>>     metrics_path: /svn/idaho-config/PROD
>>>     scrape_interval: 10s
>>>     params:
>>>       module: [http_401_unauth]
>>>     static_configs:
>>>       - targets: ['10.131.104.193']
>>>         labels:
>>>            group: 'IDAHO_SERVICE'
>>>            service: 'IDAHO_SERVICE_SVN_AND'
>>>
>>> */etc/blackbox_exporter/blackbox_exporter.yml:*
>>> *...*
>>> modules:
>>>
>>>   http_401_unauth:
>>>     prober: http
>>>     http:
>>>       valid_status_codes: [401,200,409]
>>>
>>>
>>>
>>> The error that I'm getting is :*server returned HTTP status 401
>>> Unauthorized *
>>> It looks like Prometheus is reporting the 401 error even before asking
>>> blackbox_exporter to probe it?
>>> Can anyone please help me understand the error ?
>>> Thanks in advance.
>>>
>>> [image: Capture.PNG]
>>>
>>> Regards
>>> Srikanth
>>>
>>> --
>>> 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 prometheus-use...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/prometheus-users/9dd229c9-0171-4b64-9998-8a57cc27b92an%40googlegroups.com
>>> <https://groups.google.com/d/msgid/prometheus-users/9dd229c9-0171-4b64-9998-8a57cc27b92an%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> 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 prometheus-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/f551b711-a52d-419c-9fe9-d1f86c6d1a3dn%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/f551b711-a52d-419c-9fe9-d1f86c6d1a3dn%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 prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CAObpH5xGiZD6GJUnR7CrrNJJNxCC%2BiCRvh%2B-OSx-5k2B4Sejgw%40mail.gmail.com.

Reply via email to