Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configuration issue #94

Open
andrewm659 opened this issue Mar 15, 2023 · 2 comments
Open

configuration issue #94

andrewm659 opened this issue Mar 15, 2023 · 2 comments

Comments

@andrewm659
Copy link

I've almost got this working. I don't understand why it won't work. Thanks for your help!

Here is my prometheus.yml config for smokeping

  - job_name: 'smokeping'
    file_sd_configs:
    - files:
        - '/etc/prometheus/smokeping_exporter_targets.yml'

/etc/default/smokeping_prober
SMOKEPING_PROBER_OPTS='--web.listen-address=:9374 --web.telemetry-path="/metrics" --config.file=/etc/prometheus/smokeping_exporter_targets.yml --privileged --log.level=debug'

/etc/prometheus/smokeping_exporter_targets.yml

---
targets:
- host: foo.example.com
  network: ip4
  protocol: icmp
  labels:
    name: Loadbalancer VIP1 DC1 v4
- host: foo.example.com
  network: ip6
  protocol: udp
  labels:
    name: Loadbalancer VIP1 DC1 v6
- host: 10.0.0.1
  network: ip # Automatic ip4/ip6
  # protocol: icmp # Defaults to ICMP
  interval: 5s     # Duration, Default 1s.
  protocol: icmp

Logs:

n=8434fd2b1a5584f67f6a5efe70cd851199e7882e)"
Mar 14 21:25:03 mon05 smokeping_prober[111483]: ts=2023-03-15T02:25:03.307Z caller=main.go:117 level=info msg="Build context" build_context="(go=go1.18.3, user=root@b84453c710ff, date=20220608-13:26:13)"
Mar 14 21:25:03 mon05 smokeping_prober[111483]: ts=2023-03-15T02:25:03.307Z caller=main.go:194 level=error msg="no targets specified on command line or in config file"
Mar 14 21:25:03 mon05 systemd[1]: smokeping_prober.service: Main process exited, code=exited, status=1/FAILURE
Mar 14 21:25:03 mon05 systemd[1]: smokeping_prober.service: Failed with result 'exit-code'.
Mar 14 21:25:08 mon05 systemd[1]: smokeping_prober.service: Service RestartSec=5s expired, scheduling restart.
Mar 14 21:25:08 mon05 systemd[1]: smokeping_prober.service: Scheduled restart job, restart counter is at 2706.
Mar 14 21:25:08 mon05 systemd[1]: Stopped Smokeping-style prober for Prometheus..
Mar 14 21:25:08 mon05 systemd[1]: Started Smokeping-style prober for Prometheus..
Mar 14 21:25:08 mon05 smokeping_prober[111488]: ts=2023-03-15T02:25:08.551Z caller=main.go:116 level=info msg="Starting smokeping_prober" version="(version=0.6.1, branch=HEAD, revision=8434fd2b1a5584f67f6a5efe70cd851199e7882e)"
Mar 14 21:25:08 mon05 smokeping_prober[111488]: ts=2023-03-15T02:25:08.551Z caller=main.go:117 level=info msg="Build context" build_context="(go=go1.18.3, user=root@b84453c710ff, date=20220608-13:26:13)"
Mar 14 21:25:08 mon05 smokeping_prober[111488]: ts=2023-03-15T02:25:08.552Z caller=main.go:194 level=error msg="no targets specified on command line or in config file"
Mar 14 21:25:08 mon05 systemd[1]: smokeping_prober.service: Main process exited, code=exited, status=1/FAILURE
Mar 14 21:25:08 mon05 systemd[1]: smokeping_prober.service: Failed with result 'exit-code'.
Mar 14 21:25:13 mon05 systemd[1]: smokeping_prober.service: Service RestartSec=5s expired, scheduling restart.
Mar 14 21:25:13 mon05 systemd[1]: smokeping_prober.service: Scheduled restart job, restart counter is at 2707.
Mar 14 21:25:13 mon05 systemd[1]: Stopped Smokeping-style prober for Prometheus..
Mar 14 21:25:13 mon05 systemd[1]: Started Smokeping-style prober for Prometheus..
Mar 14 21:25:13 mon05 smokeping_prober[111493]: ts=2023-03-15T02:25:13.804Z caller=main.go:116 level=info msg="Starting smokeping_prober" version="(version=0.6.1, branch=HEAD, revision=8434fd2b1a5584f67f6a5efe70cd851199e7882e)"
Mar 14 21:25:13 mon05 smokeping_prober[111493]: ts=2023-03-15T02:25:13.804Z caller=main.go:117 level=info msg="Build context" build_context="(go=go1.18.3, user=root@b84453c710ff, date=20220608-13:26:13)"
Mar 14 21:25:13 mon05 smokeping_prober[111493]: ts=2023-03-15T02:25:13.805Z caller=main.go:194 level=error msg="no targets specified on command line or in config file"
Mar 14 21:25:13 mon05 systemd[1]: smokeping_prober.service: Main process exited, code=exited, status=1/FAILURE
Mar 14 21:25:13 mon05 systemd[1]: smokeping_prober.service: Failed with result 'exit-code'.
Mar 14 21:25:19 mon05 systemd[1]: smokeping_prober.service: Service RestartSec=5s expired, scheduling restart.
Mar 14 21:25:19 mon05 systemd[1]: smokeping_prober.service: Scheduled restart job, restart counter is at 2708.
Mar 14 21:25:19 mon05 systemd[1]: Stopped Smokeping-style prober for Prometheus..
Mar 14 21:25:19 mon05 systemd[1]: Started Smokeping-style prober for Prometheus..
Mar 14 21:25:19 mon05 smokeping_prober[111501]: ts=2023-03-15T02:25:19.049Z caller=main.go:116 level=info msg="Starting smokeping_prober" version="(version=0.6.1, branch=HEAD, revision=8434fd2b1a5584f67f6a5efe70cd851199e7882e)"
Mar 14 21:25:19 mon05 smokeping_prober[111501]: ts=2023-03-15T02:25:19.049Z caller=main.go:117 level=info msg="Build context" build_context="(go=go1.18.3, user=root@b84453c710ff, date=20220608-13:26:13)"
Mar 14 21:25:19 mon05 smokeping_prober[111501]: ts=2023-03-15T02:25:19.050Z caller=main.go:194 level=error msg="no targets specified on command line or in config file"
Mar 14 21:25:19 mon05 systemd[1]: smokeping_prober.service: Main process exited, code=exited, status=1/FAILURE
Mar 14 21:25:19 mon05 systemd[1]: smokeping_prober.service: Failed with result 'exit-code'.

@andrewm659
Copy link
Author

I even tried setting it up this way:

  - job_name: 'smokeping'
    #    file_sd_configs:
    #    - files:
    #        - '/etc/prometheus/smokeping_exporter_targets.yml'
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 10.150.10.29:9374

Didn't work.

So now i'm getting this error when I have the files_sd set up:
Mar 15 13:58:15 mon05 prometheus[170587]: ts=2023-03-15T18:58:15.993Z caller=file.go:343 level=error component="discovery manager scrape" discovery=file config=smokeping msg="Error reading file" path=/etc/prometheus/smokeping_exporter_targets.yml err="yaml: unmarshal errors:\n line 2: cannot unmarshal !!map into []*targetgroup.Group"

@Nachtfalkeaw
Copy link

Nachtfalkeaw commented Dec 26, 2023

I even tried setting it up this way:

  - job_name: 'smokeping'
    #    file_sd_configs:
    #    - files:
    #        - '/etc/prometheus/smokeping_exporter_targets.yml'
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 10.150.10.29:9374

Didn't work.

So now i'm getting this error when I have the files_sd set up: Mar 15 13:58:15 mon05 prometheus[170587]: ts=2023-03-15T18:58:15.993Z caller=file.go:343 level=error component="discovery manager scrape" discovery=file config=smokeping msg="Error reading file" path=/etc/prometheus/smokeping_exporter_targets.yml err="yaml: unmarshal errors:\n line 2: cannot unmarshal !!map into []*targetgroup.Group"

smokeping.yml may look like this. you define all the targets there:
targets:
- hosts:
  - 192.168.10.1
  - 192.168.10.51
  - www.google.de
  interval: 0.5s # Duration, Default 1s.
  network: ip4 # One of ip, ip4, ip6. Default: ip (automatic IPv4/IPv6)
  protocol: icmp # One of icmp, udp. Default: icmp (Requires privileged operation)
  size: 64 # Packet data size in bytes. Default 56 (Range: 24 - 65535)
  source: 192.168.10.51 # Souce IP address to use. Default: None (automatic selection)

- hosts:
  - 192.168.10.50
  - 192.168.10.10
  - www.ard.de
  interval: 0.5s # Duration, Default 1s.
  network: ip4 # One of ip, ip4, ip6. Default: ip (automatic IPv4/IPv6)
  protocol: icmp # One of icmp, udp. Default: icmp (Requires privileged operation)
  size: 512 # Packet data size in bytes. Default 56 (Range: 24 - 65535)
  source: 192.168.10.51 # Souce IP address to use. Default: None (automatic selection)


- hosts:
  - 192.168.10.70
  - 192.168.10.21
  - 192.168.10.6
  interval: 0.5s # Duration, Default 1s.
  network: ip4 # One of ip, ip4, ip6. Default: ip (automatic IPv4/IPv6)
  protocol: udp # One of icmp, udp. Default: icmp (Requires privileged operation)
  size: 128 # Packet data size in bytes. Default 56 (Range: 24 - 65535)
  source: 192.168.10.51 # Souce IP address to use. Default: None (automatic selection)

the prometheus.yml looks like this. prometheus is only pulling the metrics. you do not send any targets to smokeping.

  - job_name: 'smokeping_prober'
    scrape_interval: 5s
    scrape_timeout: 5s

    static_configs:
      - targets:
        - 192.168.10.51:9374

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants