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

2022-07-27 Thread nina guo
And regarding monitoring LDAP, is there a standard example for writing my own exporter? On Thursday, July 28, 2022 at 8:25:46 AM UTC+8 nina guo wrote: > Sorry Brian. As we discussed LDAP monitoring in the thread, based on it to > raise a new question. > > I also want to compare the value of

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

2022-07-27 Thread nina guo
Sorry Brian. As we discussed LDAP monitoring in the thread, based on it to raise a new question. I also want to compare the value of contextCSN, and I can obtain the value with ldapsearch. Is there a way to send the value of contextCSN from each ldap server to Prometheus, and compare them? On

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

2022-07-05 Thread nina guo
Thank you Brian for your great help. On Tuesday, July 5, 2022 at 5:10:24 PM UTC+8 Brian Candler wrote: > > My blackbox is running as a pod in a k8s cluster. Do you have good > suggestion to store the cert file? > > A configMap is how I'd do it. > > On Tuesday, 5 July 2022 at 09:21:23 UTC+1

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

2022-07-05 Thread Brian Candler
> My blackbox is running as a pod in a k8s cluster. Do you have good suggestion to store the cert file? A configMap is how I'd do it. On Tuesday, 5 July 2022 at 09:21:23 UTC+1 ninag...@gmail.com wrote: > Added as below: > > smtp_starttls: > prober: tcp > timeout: 20s >

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

2022-07-05 Thread nina guo
Added as below: smtp_starttls: prober: tcp timeout: 20s tcp: tls_config: # add here? ca_file: "/certs/my_cert.crt" # add here? query_response: - expect: "^220 ([^ ]+) ESMTP" send: "EHLO prober\r" -

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

2022-07-05 Thread nina guo
Thank you very much. I changed to connect with DNS name. So according to the error msg, following your kind suggestion, I need to go with [^2], am I right? ts=2022-07-05T07:32:17.495596017Z caller=main.go:130 module=smtp_starttls target=mailserver:25 level=error msg="TLS Handshake (client)

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

2022-07-05 Thread Brian Candler
Problem 1: timeout / regexp mismatch > ts=2022-07-05T02:29:41.609572861Z caller=main.go:130 module=smtp_starttls target=1.1.1.1:25 level=debug msg="Read line" line="220 mail.com ESMTP" > ts=2022-07-05T02:29:46.607798497Z caller=main.go:130 module=smtp_starttls target=11.1.1.1:25 level=error

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

2022-07-05 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

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:

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

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,

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"

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=142.250.102.27:25=true '

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=142.250.102.27:25=true' Logs for the probe: ts=2022-07-05T02:04:33.373763474Z caller=main.go:320

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=aspmx.l.google.com:25=true'* On Monday, 4 July 2022 at 12:50:47 UTC+1 ninag...@gmail.com wrote: > Still received the same error msg: > > curl -g ' >

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=1.1.1.1:25=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=5

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

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
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
Hi Brian, I test and got the following info. curl -g 'http://0.0.0.0:9115/probe?module=smtp_starttls=1.1.1.1:25=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 timeout_seconds=5

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

2022-05-19 Thread Brian Candler
Hit blackbox_exporter with curl, and add =true to see what's happening. *curl -g 'http://prometheus-blackbox-exporter:9115/probe?module=smtp_starttls=127.0.0.1=true'* My guess is that the target mailserver doesn't have a valid TLS certificate. This is almost certainly true if you are

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

2022-05-19 Thread nina guo
Thank you Brian. If I only want to test if SMTP connection can be setup or not, like Nagios check_smtp, can I use smtp_starttls module? I got failed status of smtp_starttls, and from the log of blackbox exporter, I even cannot see the output of "smtp_starttls" module. I curled, the response

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

2022-05-18 Thread Brian Candler
On Wednesday, 18 May 2022 at 13:41:37 UTC+1 ninag...@gmail.com wrote: > static_configs: > - targets: > - 127.0.0.1 > relabel_configs: > - source_labels: [__address__] > target_label: __param_target > - source_labels:

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

2022-05-18 Thread nina guo
could you help to review if the following configuration is right? - job_name: smtp metrics_path: /probe params: module: [smtp_starttls] static_configs: - targets: - 127.0.0.1 relabel_configs: - source_labels:

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

2022-05-18 Thread Matthias Rampke
It's really just TCP with some scripted interactions. Look at the steps in your configuration to see exactly what they are. /MR On Wed, May 18, 2022, 14:11 nina guo wrote: > > still have 2 questions: > - which module can be used to implement Nagios check_ldap_startTLS? > - Is there a way to

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

2022-05-18 Thread nina guo
still have 2 questions: - which module can be used to implement Nagios check_ldap_startTLS? - Is there a way to know what does smtp_startTLS module exactly do? On Wednesday, May 18, 2022 at 7:55:28 PM UTC+8 nina guo wrote: > Is there a way to know what does smtp_startTLS module exactly do? > >

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

2022-05-18 Thread nina guo
Is there a way to know what does smtp_startTLS module exactly do? On Wednesday, May 18, 2022 at 7:36:37 PM UTC+8 nina guo wrote: > Thank you very much. > > On Wednesday, May 18, 2022 at 7:18:17 PM UTC+8 matt...@prometheus.io > wrote: > >> Yes, that should work. If you have trouble, open(curl)

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

2022-05-18 Thread nina guo
Thank you very much. On Wednesday, May 18, 2022 at 7:18:17 PM UTC+8 matt...@prometheus.io wrote: > Yes, that should work. If you have trouble, open(curl) the scrape URL but > add =true to see what happens. > > /MR > > On Wed, May 18, 2022, 12:34 nina guo wrote: > >> Hi, >> >> Can I use the

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

2022-05-18 Thread Matthias Rampke
Yes, that should work. If you have trouble, open(curl) the scrape URL but add =true to see what happens. /MR On Wed, May 18, 2022, 12:34 nina guo wrote: > Hi, > > Can I use the following mode to implement Nagios check_smtp? > > smtp_starttls: > > prober: tcp > > timeout: 5s > > tcp: > >

[prometheus-users] implement smtp connection with blackbox exporter

2022-05-18 Thread nina guo
Hi, Can I use the following mode to implement Nagios check_smtp? smtp_starttls: prober: tcp timeout: 5s tcp: query_response: - expect: "^220 ([^ ]+) ESMTP (.+)$" - send: "EHLO prober\r" - expect: "^250-STARTTLS" - send: "STARTTLS\r" - expect: "^220" - starttls: true - send: "EHLO