Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device Type Library Importer behind a proxy #126

Closed
Dominik9798 opened this issue Mar 14, 2024 · 1 comment
Closed

Device Type Library Importer behind a proxy #126

Dominik9798 opened this issue Mar 14, 2024 · 1 comment

Comments

@Dominik9798
Copy link

Hello,

I have netbox 2.8.0 running and it works in my local network in a Debian VM.
For security reasons this VM is behind a Squid proxy to which I have no administrative access.
Name resolution works via another DNS server.
How do I get the script Device Type Library Importer to call a proxy?
The command: docker run -e "NETBOX_URL=http://192.xxx.xxx.xxx:8000/" -e "NETBOX_TOKEN=xxx" --env HTTP_PROXY="http://192.xxx.xxx.xxx:8080" ghcr.io/minitriga/netbox-device-type-library-import
does not work and ends in the following error:
Traceback (most recent call last): File "/app/nb-dt-import.py", line 853, in <module> main() File "/app/nb-dt-import.py", line 776, in main determine_features(nb) File "/app/nb-dt-import.py", line 39, in determine_features nb_ver = [int(x) for x in nb.version.split('.')] File "/usr/local/lib/python3.9/site-packages/pynetbox/api.py", line 212, in version version = Request( File "/usr/local/lib/python3.9/site-packages/pynetbox/core/query.py", line 189, in get_version raise RequestError(req) pynetbox.core.query.RequestError: The request failed with code 403 Forbidden but more specific details were not returned in json. Check the NetBox Logs or investigate this exception's error attribute.

Without --env HTTP_PROXY="http://192.xxx.xxx.xxx:8080"
I have the following error:
`Couldn't clone https://github.com/netbox-community/devicetype-library.git (Cmd('git') failed due to: exit code(128)
cmdline: git clone --branch=master -v https://github.com/netbox-community/devicetype-library.git /app/repo
stderr: 'Cloning into '/app/repo'...
fatal: unable to access 'https://github.com/netbox-community/devicetype-library.git/': Failed to connect to github.com port 443 after 2058 ms: Host is unreachable
')
No Vendors Specified, Gathering All Device-Types
0 Vendors Found
0 Device-Types Found
No Vendors Specified, Gathering All Module-Types
0 Module Vendors Found
0 Module-Types Found

Script took 0:00:02.170785 to run
0 devices created
0 interfaces/ports updated
0 manufacturers created
0 modules created
0 module interface / ports created`

Has someone any idea?

@Dominik9798
Copy link
Author

It works with --env **HTTPS_PROXY**="http://192.xxx.xxx.xxx:8080"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant