Re: [prometheus-users] implement smtp connection with blackbox exporter

2022-07-04 Thread nina guo
Hi Brian, I test and got the following info. curl -g 'http://0.0.0.0:9115/probe?module=smtp_starttls&target=1.1.1.1:25&debug=true' Logs for the probe: ts=2022-07-04T07:40:59.871275007Z caller=main.go:320 module=smtp_starttls target= 1.1.1.1 :25 level=info msg="Beginning probe" probe=tcp timeo

Re: [prometheus-users] implement smtp connection with blackbox exporter

2022-07-04 Thread Brian Candler
The following works for me with blackbox_exporter 0.21.0 (maybe your first 'expect' regexp needs to be quoted?) modules: smtp_starttls: prober: tcp timeout: 5s tcp: query_response: - expect: "^220 ([^ ]+) ESMTP (.+)$" send: "EHLO prober"

Re: [prometheus-users] implement smtp connection with blackbox exporter

2022-07-04 Thread nina guo
Yes in my code the first expect is quoted. smtp_starttls: prober: tcp timeout: 5s tcp: query_response: - expect: "^220 ([^ ]+) ESMTP (.+)$" - send: "EHLO prober\r" - expect: "^250-STARTTLS" - send: "STARTTLS\r"

Re: [prometheus-users] implement smtp connection with blackbox exporter

2022-07-04 Thread Brian Candler
Could you first just try copy-pasting the working config I gave you, and see if it gives a different result to yours? I doubt a mail server would take more than 5 seconds to give a banner, but it's possible. Simply doing "telnet x.x.x.x 25" will show you how your mail server behaves. On Monda

[prometheus-users] Metric relabeling replacing char

2022-07-04 Thread Aleksey Sysoev
Hi. Is it possible to replace certain char in label? I have a metric like this: my_metric{label1=“foo-foo-foo”, label2=“foo”} label1 may have values: foo foo-foo foo-foo-foo and so on It isn’t known how many ‘-’ it has. I want to replace all dashes with underscore in label1 value: my_metric{l

Re: [prometheus-users] implement smtp connection with blackbox exporter

2022-07-04 Thread nina guo
Still received the same error msg: curl -g 'http://0.0.0.0:9115/probe?module=smtp_starttls&target=1.1.1.1:25&debug=true' Logs for the probe: ts=2022-07-04T11:47:59.071097704Z caller=main.go:320 module=smtp_starttls target= 1.1.1.1 :25 level=info msg="Beginning probe" probe=tcp timeout_seconds=

Re: [prometheus-users] implement smtp connection with blackbox exporter

2022-07-04 Thread Brian Candler
And if you try it with Google's mail server? *curl -g 'localhost:9115/probe?module=smtp_starttls&target=aspmx.l.google.com:25&debug=true'* On Monday, 4 July 2022 at 12:50:47 UTC+1 ninag...@gmail.com wrote: > Still received the same error msg: > > curl -g ' > http://0.0.0.0:9115/probe?module=smtp

[prometheus-users] Re: Metric relabeling replacing char

2022-07-04 Thread Brian Candler
> I tried using “metric_relabel_configs” with replace mechanism, but it seems not possible to do with that. If the number is bounded, say no more than 4 dashes, then you can just have 4 rewriting rules, each of which rewrites one. Just repeat the rule N times: - source_labels: [label1]

[prometheus-users] Re: Metric relabeling replacing char

2022-07-04 Thread Aleksey Sysoev
Thank you for answer. I will try this as a workaround solution. I think there couldn't be more than 5 '-'. >If it's your own exporter - then fix the exporter. No it's a cloud exporter >If it's someone else's exporter - then use the labels as they are. it isn't possible because they use label as

[prometheus-users] Re: Metric relabeling replacing char

2022-07-04 Thread Aleksey Sysoev
Thank you, it works, but with minor fix with your code - source_labels: [ label1 ] target_label: label1 regex: '([[:alnum:]]+)[-_]+([[:alnum:]]+)' replacement: "${1}_${2}" - source_labels: [ label1 ] target_label: label1

[prometheus-users] Re: Metric relabeling replacing char

2022-07-04 Thread Brian Candler
On Monday, 4 July 2022 at 14:10:33 UTC+1 a...@fevlake.com wrote: > >If it's someone else's exporter - then use the labels as they are. > it isn't possible because they use label as part of the metric name with > '_' > I don't understand what you're saying. You gave the following example: my_me

[prometheus-users] Re: Metric relabeling replacing char

2022-07-04 Thread Brian Candler
On Monday, 4 July 2022 at 14:57:58 UTC+1 a...@fevlake.com wrote: > Thank you, it works, but with minor fix with your code > > - source_labels: [ label1 ] > target_label: label1 > regex: '([[:alnum:]]+)[-_]+([[:alnum:]]+)' > replacement: "${1}_${2}" >

[prometheus-users] DatasourceError that firing and REVOLVING after few minutes

2022-07-04 Thread Alen Cappelletti
Hi all, it is not clear to me the cause of the error "DatasourceError" that comes from time to time and usually change in "RESOLVING" after a few minutes. What is the cause of the error of this datasource in prometheus? Naturally I received an alert of that... Thanks Alen -- You received thi

[prometheus-users] Re: Metric relabeling replacing char

2022-07-04 Thread Aleksey Sysoev
>I don't understand what you're saying. You gave the following example: my_metric{label1=“foo-foo-foo”, label2=“foo”} Ok. My real example. I have postgres "my-db-name" in a cloud and need to construct grafana dashboard, for example "query count" for it. 1. I get variable (database) in grafana fr

[prometheus-users] Re: Metric relabeling replacing char

2022-07-04 Thread Brian Candler
On Monday, 4 July 2022 at 15:33:03 UTC+1 a...@fevlake.com wrote: > From exporter: > pooler_my_db_name_query_count{} it doesn't have label for > databasename, the databasename is in metric name but all '-' replaced with > '_' > Ugh, that's terrible design. It should have been: pooler_query_coun

Re: [prometheus-users] implement smtp connection with blackbox exporter

2022-07-04 Thread nina guo
Probe failed due to TLS issue...it is not the same issue with my mail server.. There is no "i/o timeout" issue for google's mail server. curl -g 'http://100.100.3.9:9115/probe?module=smtp_starttls&target=142.250.102.27:25&debug=true' Logs for the probe: ts=2022-07-05T02:04:33.373763474Z caller=m

Re: [prometheus-users] implement smtp connection with blackbox exporter

2022-07-04 Thread nina guo
Probe failed due to TLS issue...it is not the same issue with my mail server.. There is no "i/o timeout" issue for google's mail server. curl -g ' http://0.0.0.0:9115/probe?module=smtp_starttls&target=142.250.102.27:25&debug=true

Re: [prometheus-users] implement smtp connection with blackbox exporter

2022-07-04 Thread nina guo
telnet got succeed. telnet 1.1.1.1 25 Trying 1.1.1.1... Connected to 1.1.1.1. Escape character is '^]'. 220 ... ESMTP On Tuesday, July 5, 2022 at 11:11:48 AM UTC+8 nina guo wrote: > Probe failed due to TLS issue...it is not the same issue with my mail > server.. > There is no "i/o timeout" issu

Re: [prometheus-users] implement smtp connection with blackbox exporter

2022-07-04 Thread nina guo
I searched this info blackbox_exporter for SMTP monitoring w/ TCP module : PrometheusMonitoring (reddit.com) , added "\r", but still got the same issue.. On Tuesday, July 5, 202

Re: [prometheus-users] implement smtp connection with blackbox exporter

2022-07-04 Thread nina guo
I may find the root cause - comparing the output between google's mail server and my mail server my mail server ts=2022-07-05T02:29:41.608566903Z caller=main.go:130 module=smtp_starttls target=1.1.1.1:25 level=info msg="Successfully dialed" ts=2022-07-05T02:29:41.608652361Z caller=main.go:130 mo

Re: [prometheus-users] implement smtp connection with blackbox exporter

2022-07-04 Thread nina guo
I tried to change the first expect to ^220 ([^ ]+) ESMTP$. But I'm not sure if the change is acceptable from blackbox's view. smtp_starttls: prober: tcp timeout: 20s tcp: query_response: #- expect: "^220 ([^ ]+) ESMTP (.+)$" - expect: "^22

Re: [prometheus-users] implement smtp connection with blackbox exporter

2022-07-04 Thread nina guo
I found a module [smtp_banner], but cannot find it blackbox_exporter/example.yml at master · prometheus/blackbox_exporter (github.com) May I ask if [smtp_banner] still valid? On Tuesday, July 5, 2022 at 12:53:46 PM UTC+8