badtuxx/giropops-monitoring

Prometheus not connecting in netdata on host docker

dancristi4n opened this issue · 2 comments

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.

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.

@dancristi4n how do you add in the startup script?