unpoller / unpoller

Application: Collect ALL UniFi Controller, Site, Device & Client Data - Export to InfluxDB or Prometheus
https://unpoller.com
MIT License
2.03k stars 146 forks source link

Auth or Connection Error - connect: no route to host #741

Closed lZzozZl closed 1 month ago

lZzozZl commented 1 month ago

Im getting this error when i try to start the container: sudo docker run --rm --network my_bridge_network --ip 192.168.10.10 -p 9130:9130 -v /home/o-monitor/unpoller.conf:/etc/unpoller/up.conf ghcr.io/unpoller/unpoller

[INFO] Loading Configuration File: /etc/unpoller/up.conf [INFO] UniFi Poller v2.11.2 Starting Up! PID: 1 [ERROR] Controller 1 of 1 Auth or Connection Error, retrying: unifi controller: making request: Get "https://192.168.11.11:8443/": dial tcp 192.168.11.11:8443: connect: no route to host [INFO] Prometheus is enabled [INFO] Prometheus exported at http://192.168.10.10:9130/ - namespace: unpoller

my_bridge_network bridge local

[
    {
        "Name": "my_bridge_network",
        "Id": "id",
        "Created": "date",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": {},
            "Config": [
                {
                    "Subnet": "192.168.10.0/24"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {},
        "Options": {},
        "Labels": {}
    }
]

Host can ping and curl the Uni console.

davidnewhall commented 1 month ago

If the host can ping it, run it on the host? The docker network has no route to that IP.

EDIT:

Your problem is likely with one of these options:

--network my_bridge_network --ip 192.168.10.10

Maybe try removing both of them and see if it works.

lZzozZl commented 1 month ago

if i remove --ip part it gives same error and also 2024/07/30 11:42:58 [ERROR] listen tcp 192.168.10.10:9130: bind: cannot assign requested address

im using Unifi 8.1.113 ( UniFi Network Application ) Can poller work with it ?

platinummonkey commented 1 month ago

Likely your docker setup masks this IP space. You can fix that or just run it on your host which presumably is Linux or Mac based on the docker cli arguments passed in

lZzozZl commented 1 month ago

Likely your docker setup masks this IP space. You can fix that or just run it on your host which presumably is Linux or Mac based on the docker cli arguments passed in

Bu run it on your host you mean https://unpoller.com/docs/install/linux ? Without using docker?

platinummonkey commented 1 month ago

correct

lZzozZl commented 1 month ago

correct

Thanx. Now is running.

Jul 30 16:05:12 mon unpoller[73996]: 2024/07/30 16:05:12 [INFO] Loading Configuration File: /etc/unpoller/up.conf
Jul 30 16:05:12 mon unpoller[73996]: 2024/07/30 16:05:12 [INFO] UniFi Poller v2.11.2 Starting Up! PID: 73996
Jul 30 16:05:13 mon unpoller[73996]: 2024/07/30 16:05:13 [INFO] Found 1 site(s) on controller https://192.168.11.11:8443: default (Default)
Jul 30 16:05:13 mon unpoller[73996]: 2024/07/30 16:05:13 [INFO] Configured UniFi Controller 1 of 1:
Jul 30 16:05:13 mon unpoller[73996]: 2024/07/30 16:05:13 [INFO]    => URL: https://192.168.11.11:8443 (verify SSL: false)
Jul 30 16:05:13 mon unpoller[73996]: 2024/07/30 16:05:13 [INFO]    => Version: 8.1.113 (vid)
Jul 30 16:05:13 mon unpoller[73996]: 2024/07/30 16:05:13 [INFO]    => Username: someuser (has password: true)
Jul 30 16:05:13 mon unpoller[73996]: 2024/07/30 16:05:13 [INFO]    => Hash PII false / Drop PII false / Poll Sites: all
Jul 30 16:05:13 mon unpoller[73996]: 2024/07/30 16:05:13 [INFO]    => Save Sites true / Save DPI false (metrics)
Jul 30 16:05:13 mon unpoller[73996]: 2024/07/30 16:05:13 [INFO]    => Save Events false / Save IDS false (logs)
Jul 30 16:05:13 mon unpoller[73996]: 2024/07/30 16:05:13 [INFO]    => Save Alarms false / Anomalies false (logs)
Jul 30 16:05:13 mon unpoller[73996]: 2024/07/30 16:05:13 [INFO]    => Save Rogue APs: false
Jul 30 16:05:13 mon unpoller[73996]: 2024/07/30 16:05:13 [INFO] Prometheus is enabled
Jul 30 16:05:13 mon unpoller[73996]: 2024/07/30 16:05:13 [INFO] Prometheus exported at http://192.168.10.10:9130/ - namespace: unpoller

just one question outside of the context. How can i check is login working and getting metrics from Unifi 8.1.113 ( UniFi Network Application )

davidnewhall commented 1 month ago

Login worked:

Jul 30 16:05:13 o-monitoring unpoller[73996]: 2024/07/30 16:05:13 [INFO]    => Version: 8.1.113 (vid)

The metrics part is going to be in Prometheus.

lZzozZl commented 1 month ago

Login worked:

Jul 30 16:05:13 mon unpoller[73996]: 2024/07/30 16:05:13 [INFO]    => Version: 8.1.113 (vid)

The metrics part is going to be in Prometheus.

I imported all of the 6 prometheus dashboards and all of them show no data...

davidnewhall commented 1 month ago

How often to you see prometheus scraping the poller?

lZzozZl commented 1 month ago

30 s

Manage to fix it Changed the ip of unpoller scrape job in the prometheus conf