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

Fetching process fails when device is reached via an ipv6 address #2904

Closed
ocl80 opened this issue Aug 11, 2023 · 2 comments
Closed

Fetching process fails when device is reached via an ipv6 address #2904

ocl80 opened this issue Aug 11, 2023 · 2 comments

Comments

@ocl80
Copy link

ocl80 commented Aug 11, 2023

Hello,
I'm relatively new to Oxidized (and Ruby), but I have it working nicely except for devices reached via IPv6.
A device whose name resolves to an IPv6 address looks normal until the job is added to the queue then generates the output below in the debug log:

D, [2023-08-11T11:27:42.206040 #16344] DEBUG -- : resolving DNS for ip6device.lab...
D, [2023-08-11T11:27:42.206054 #16344] DEBUG -- : IPADDR 

then

D, [2023-08-11T11:27:54.451830 #16344] DEBUG -- : lib/oxidized/worker.rb: Added Cisco Lab/ip6device.lab to the job queue
D, [2023-08-11T11:27:54.452190 #16344] DEBUG -- : lib/oxidized/worker.rb: 1 jobs running in parallel
D, [2023-08-11T11:27:54.451901 #16344] DEBUG -- : lib/oxidized/job.rb: Starting fetching process for ip6device.lab at 2023-08-11 11:27:54 UTC
D, [2023-08-11T11:27:54.452285 #16344] DEBUG -- : lib/oxidized/job.rb: Config fetched for ip6device.lab at 2023-08-11 11:27:54 UTC
W, [2023-08-11T11:27:55.453586 #16344]  WARN -- : Cisco Lab/ip6device.lab status fail, retry attempt 1

I see the same result whether resolving the hostname, or declaring the IPv6 address explicitly in router.db.
I'm not seeing any clues as to specifically what is failing. Is it expected the Oxidized cannot reach devices using ipv6 ?

@ocl80
Copy link
Author

ocl80 commented Aug 14, 2023

After some further some further testing, I have understood that the problem occurs because I have set the delimiter for the CSV input to be not the default colon : so that I could declare ipv6 addresses (including colons) in the router.db (in my case I set the delimited to be a comma).

With delimiter for CSV input set to comma, the following check in node.rb fails and the input is skipped:

# don't try input if model is missing config block, we may need strong config to class_name map
cfg_name = input.to_s.split('::').last.downcase
next unless @model.cfg[cfg_name] && (not @model.cfg[cfg_name].empty?)

I have not yet fully understood what this check is doing, but if either comment it out, or set delimiter to default colon : and use DNS to find the connection address, oxidized successfully connects to the device and collects its config.

I am now looking for a good way to be able to use an explicitly declared ipv6 address in router.db.

@ocl80
Copy link
Author

ocl80 commented Aug 14, 2023

I suspect I made a mistake in the config initially, with the delimiter pattern configured.
With a more specific delimiter in the config file of /::*/ and explicitly declared ipv6 address in router.db, I can fetch configs OK.
So I'm closing the issue.

@ocl80 ocl80 closed this as completed Aug 14, 2023
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