badtuxx / giropops-monitoring

Full stack tools for monitoring containers and other stuff. ;)
https://youtube.com/linuxtips
Apache License 2.0
1.33k stars 267 forks source link

Prometheus not connecting in netdata on host docker #23

Open dancristi4n opened 4 years ago

dancristi4n commented 4 years ago

Hi,

I followed the instructions on "How To", but getting an error on Prometheus job 'netdata' Apparently, it's can't connect to host/node.

prometheus.yml:

  • job_name: 'netdata' metrics_path: '/api/v1/allmetrics' params: format: [prometheus] honor_labels: true scrape_interval: 15s static_configs:
    • targets: ['localhost:19999']

Error:

Get http://localhost:19999/api/v1/allmetrics?format=prometheus: dial tcp 127.0.0.1:19999: connect: connection refused

How configure the prometheus.yml?

Thanks for advance.

dancristi4n commented 4 years ago

I found the solution. It's necessary configure the host:

sudo sysctl net.ipv4.conf.all.forwarding=1 sudo iptables -P FORWARD ACCEPT

These settings do not persist across a reboot, so you may need to add them to a start-up script.

KesleyDavid commented 3 years ago

@dancristi4n how do you add in the startup script?