--
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+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/f7dcb747-af10-4c13-a96f-b12fb8f0fa3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Can you provide us with more details as to what you're trying to achieve here?
Setting up the blackbox exporter to send a http probe to a url and check the response in Prometheus is fairly straightforward.
I'm guessing you're interested in sending an alert or something based on the probe response?On 19 July 2017 at 22:57, <jain....@gmail.com> wrote:Hi,I am trying to use prometheus with blackbox-exporter to create a smart pinger which pings a url and checks the response with some logic. Is there a way to do that in blackbox-exporter?Thanks
--
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 post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/f7dcb747-af10-4c13-a96f-b12fb8f0fa3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
probe_http_status_code 200
scrape_configs: - job_name: 'blackbox' metrics_path: /probe params: module: [http_2xx] # Look for a HTTP 200 response. static_configs: - targets: - http://free.currencyconverterapi.com/api/v3/convert?q=SAR_USD&compact=ultra relabel_configs: - source_labels: [__address__] target_label: __param_target - source_labels: [__param_target] target_label: instance - target_label: __address__ replacement: 127.0.0.1:9115 # Blackbox exporter.
Run blackbox exporter with the default configuration.
In the following URL I've tested probing your desired target.At http://localhost:9115/metric I can see the following metric:probe_http_status_code 200Now lets configure and run Prometheus to scrape the blackbox exporter to get the probe_http_status_code metric into Prometheus itself.scrape_configs: - job_name: 'blackbox' metrics_path: /probe params: module: [http_2xx] # Look for a HTTP 200 response. static_configs: - targets: - http://free.currencyconverterapi.com/api/v3/convert?q=SAR_USD&compact=ultra relabel_configs: - source_labels: [__address__] target_label: __param_target - source_labels: [__param_target] target_label: instance - target_label: __address__ replacement: 127.0.0.1:9115 # Blackbox exporter.Running Prometheus now, you should be able to see probe_http_status_code in the expression browser.What we've done here essentially is set the Blackbox exporter to probe your given target via http. We're then scraping the metrics the Blackbox exporter produces with Prometheus.I will check out how to get the response body tomorrow as it's quite late here but the above should sort out your answer your first query!
On 19 July 2017 at 23:10, Nehil Jain <jain....@gmail.com> wrote:
Oh, Sorry about that.here is an example pinger I want to setPing url http://free.currencyconverterapi.com/api/v3/convert?q=SAR_USD&compact=ultra and check is the reponse is 200 and the body has SAR_USD keyword in it.Thanks a ton for looking into this.
On Wed, 19 Jul 2017 at 18:02 Conor Broderick <conor.broderick@robustperception.io> wrote:
Can you provide us with more details as to what you're trying to achieve here?
Setting up the blackbox exporter to send a http probe to a url and check the response in Prometheus is fairly straightforward.
I'm guessing you're interested in sending an alert or something based on the probe response?On 19 July 2017 at 22:57, <jain....@gmail.com> wrote:Hi,I am trying to use prometheus with blackbox-exporter to create a smart pinger which pings a url and checks the response with some logic. Is there a way to do that in blackbox-exporter?Thanks
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/f7dcb747-af10-4c13-a96f-b12fb8f0fa3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Conor Broderick
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CAF-W3DHjm4GeO3rXXNpbd0nHLFK2zHoTjoXunfy_vQQqJmQ%3D6Q%40mail.gmail.com.
This is not what the user is looking for exactly, they also want to use a body match. These config options are not really documented out side the example.yml
In the blackbox.yml, you will want to adjust the http probe module slightly.modules:fail_if_not_matches_regexp:http_2xx_SAR_USD:
prober: http
http:- "SAR_USD"The above is actually a regexp, so you could make it more specific to the body response.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CABbyFmogLNdC2N9oQ06i%2B_KskMkpnUYLXTKiZfqgqxbwhqefBg%40mail.gmail.com.
On 19 July 2017 at 23:10, Nehil Jain <jain....@gmail.com> wrote:
Oh, Sorry about that.here is an example pinger I want to setPing url http://free.currencyconverterapi.com/api/v3/convert?q=SAR_USD&compact=ultra and check is the reponse is 200 and the body has SAR_USD keyword in it.Thanks a ton for looking into this.
On Wed, 19 Jul 2017 at 18:02 Conor Broderick <conor.b...@robustperception.io> wrote:
Can you provide us with more details as to what you're trying to achieve here?
Setting up the blackbox exporter to send a http probe to a url and check the response in Prometheus is fairly straightforward.
I'm guessing you're interested in sending an alert or something based on the probe response?On 19 July 2017 at 22:57, <jain....@gmail.com> wrote:Hi,I am trying to use prometheus with blackbox-exporter to create a smart pinger which pings a url and checks the response with some logic. Is there a way to do that in blackbox-exporter?Thanks
--
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 post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/f7dcb747-af10-4c13-a96f-b12fb8f0fa3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Conor Broderick--Conor Broderick
--
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 post to this group, send email to promethe...@googlegroups.com.
This is what I was looking for. Thanks Ben. I do have a follow up question on this approach, because I will be setting up multiple urls which different bodies, it is quite lot of repeated code to get the job done. For each url and body regex I will have to setup a module. Is there a better way?
Thanks for youe help.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/f7dcb747-af10-4c13-a96f-b12fb8f0fa3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Conor Broderick--Conor Broderick
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CAF-W3DHjm4GeO3rXXNpbd0nHLFK2zHoTjoXunfy_vQQqJmQ%3D6Q%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CAFUpag5E9nMuU4s3fPwggcgZjq%3D5j43BG7MF%3DJYHcWPEyU%2BjUQ%40mail.gmail.com.To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
This is what I was looking for. Thanks Ben. I do have a follow up question on this approach, because I will be setting up multiple urls which different bodies, it is quite lot of repeated code to get the job done. For each url and body regex I will have to setup a module. Is there a better way?
Thanks for youe help.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/f7dcb747-af10-4c13-a96f-b12fb8f0fa3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Conor Broderick--Conor Broderick
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.