TheNetworkGuy / netbox-zabbix-sync

Python script to synchronise Netbox devices to Zabbix.
MIT License
129 stars 31 forks source link

Name resolve error #78

Open aseok opened 5 days ago

aseok commented 5 days ago

Hi. getting following error running the docker container on ubuntu22: requests.exceptions.ConnectionError: HTTPConnectionPool(host='netbox-docker-netbox-1', port=8080): Max retries exceeded with url: /api/extras/custom-fields/?type=text&content_type_id=23&limit=0 (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x7fa729ce9f10>: Failed to resolve 'netbox-docker-netbox-1' ([Errno -2] Name does not resolve)"))

zabbix-server and netbox already running and functional on their separate containers with 10051:10051 and 8080 internal ports respectively on same ubuntu22.

TheNetworkGuy commented 3 days ago

Please double check your URL and Netbox token. The problem is somewhere there. And i'll do some adjustments in the code to help with better logging instead of this ugly crash.

TheNetworkGuy commented 2 days ago

I've added some checks in the new development branch to give you better logging:

2024-11-06 15:56:14,709 - Netbox-Zabbix-sync - ERROR - Unable to connect to Netbox with URL http://localhoost:8000. Please check the URL and status of Netbox.

2024-11-06 15:55:58,931 - Netbox-Zabbix-sync - ERROR - Netbox error: The request failed with code 403 Forbidden: {'detail': 'Invalid token'}

As for your specific question: check if the containers are both in the same docker network and if they are both reachable by their DNS name.