1

I have been struggling to implement an RDP probe to check multiple ports in Windows machines using Prometheus Blackbox.

So far I manage to check DNS, ping, ports 80,8080 but I cannot manage to test 3389!

As a rule of thumb I would like to be able to ping/probe any ports that have services running on this hosts

My blackbox.yml is:

modules:
  http_2xx:
    prober: http
    http:
  http_get_2xx:
    prober: http
    http:
      method: GET
  http_post_2xx:
    prober: http
    timeout: 5s
    http:
      method: POST
      headers:
        Content-Type: application/json
      body: '{}'
  tcp_connect:
    prober: tcp
    pop3s_banner:
    prober: tcp
    tcp:
      query_response:
      - expect: "^+OK"
      tls: true
      tls_config:
        insecure_skip_verify: false
  ssh_banner:
    prober: tcp
    tcp:
      query_response:
      - expect: "^SSH-2.0-"
  irc_banner:
    prober: tcp
    tcp:
      query_response:
      - send: "NICK prober"
      - send: "USER prober prober prober :prober"
      - expect: "PING :([^ ]+)"
        send: "PONG ${1}"
      - expect: "^:[^ ]+ 001"
  icmp:
    prober: icmp
  dns_test:
    prober: dns
    timeout: 5s
    dns:
      query_name: google.com
      preferred_ip_protocol: ip4

And my prometheus.yml 3389 port probe entry is:

  - job_name: "rdp-dev-status"
    metrics_path: /probe
    params:
      module: [dns_test]
    static_configs:
     - targets:
           - nostradata-dvmh-prodweb-01
   # file_sd_configs:
   #   - files:
   #     - /opt/prometheus/tools/targets/rdp-dev-targets.yml
    relabel_configs:
      # Ensure port is 22, pass as URL parameter
      - source_labels: [__address__]
        regex: (.*)(:.*)?
        replacement: ${1}:3389
        target_label: __param_target
      # Make instance label the target
      - source_labels: [__param_target]
        target_label: instance
      # Actually talk to the blackbox exporter though
      - target_label: __address__
        replacement: PROD-NIFI:9115
Up_One
  • 5,213
  • 3
  • 33
  • 65

1 Answers1

1
  module: [dns_test]

Using a DNS probe is probably not going to work with RDP. Try the tcp_connect module.

brian-brazil
  • 31,678
  • 6
  • 93
  • 86