stefanprodan / dockprom

Docker hosts and containers monitoring with Prometheus, Grafana, cAdvisor, NodeExporter and AlertManager
MIT License
6.02k stars 1.72k forks source link

Help please #286

Closed PostWarTacos closed 1 year ago

PostWarTacos commented 1 year ago

Apologies for making a ticket for this. I don't have IRC, slack, or even a twitter. I didn't see a need to create an account just for this. I'm trying to connect to multiple remote hosts and I'm lost on how to accomplish it. node explorer and cadvisor are running on the remote hosts, and the monitor-net is running on the primary machine. I see your note says to point prometheus at the remote devices, but I've been unable to figure out how to do that. please help! thanks!!

nightah commented 1 year ago

You add additional scape_configs for nodeexporter and advisor for each remote node in your prometheus.yml.

As per the below, you would give each a unique job_name and the target should be either the hostname of the remote node or the IP address. This needs to be exposed at the host level for this to work so make sure if you're running both cadvisor/nodeexporter in docker that you publish the ports.

https://github.com/stefanprodan/dockprom/blob/d8081ae56b15f881e0cd94289eab8398885e087d/prometheus/prometheus.yml#L15-L24

PostWarTacos commented 1 year ago

Thanks :)