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

Can't have http as both input and source #3244

Open
michieltimmers opened this issue Aug 10, 2024 · 1 comment
Open

Can't have http as both input and source #3244

michieltimmers opened this issue Aug 10, 2024 · 1 comment

Comments

@michieltimmers
Copy link

I have the following part in my Oxidized config. I need to have telnet, and http as possible methods to pull configuration.

input:
  default: telnet,ssh,http
  debug: true
  ssh:
    secure: false
  ftp:
    passive: true
  http:
    secure: false
  utf8_encoded: true

When I use that with the following source all works just fine.

source:
  debug: false
  csv:
    file: "/home/oxidized/.config/oxidized/router.db"
    delimiter: !ruby/regexp /:/
    map:
      name: 0
      model: 1
    gpg: false

But when I the the following input config via http (librenms) then I can't start Oxidized.

source:
  debug: false
  http:
    url: http://127.0.0.1/api/v0/oxidized
    scheme: http
    map:
      name: hostname
      model: os
    group: group
    headers:
      X-Auth-Token: xxxxxxxxxxxxx

I receive the following error when I try to start Oxidized

$ oxidized -d
superclass mismatch for class HTTP
/var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/input/http.rb:6:in `<module:Oxidized>': superclass mismatch for class HTTP (TypeError)
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/input/http.rb:1:in `<top (required)>'
	from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/manager.rb:9:in `load'
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/manager.rb:61:in `loader'
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/manager.rb:36:in `add_input'
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/node.rb:162:in `block in resolve_input'
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/node.rb:161:in `map'
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/node.rb:161:in `resolve_input'
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/node.rb:24:in `initialize'
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/nodes.rb:22:in `new'
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/nodes.rb:22:in `block (2 levels) in load'
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/nodes.rb:17:in `each'
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/nodes.rb:17:in `block in load'
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/nodes.rb:133:in `synchronize'
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/nodes.rb:133:in `with_lock'
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/nodes.rb:11:in `load'
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/nodes.rb:128:in `initialize'
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/core.rb:14:in `new'
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/core.rb:14:in `initialize'
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/core.rb:4:in `new'
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/core.rb:4:in `new'
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/lib/oxidized/cli.rb:13:in `run'
	from /var/lib/gems/3.0.0/gems/oxidized-0.30.1/bin/oxidized:5:in `<top (required)>'
	from /usr/local/bin/oxidized:25:in `load'
	from /usr/local/bin/oxidized:25:in `<main>'

When change the "input: default: telnet,ssh,http" to "input: default: telnet,ssh" then I can start Oxidized without any problems. But then I can't use http for fetching configs for some of my devices.

@yoakim
Copy link

yoakim commented Aug 12, 2024

Hey, this is a known bug, I have it too.
Here is a workaround:
#2154

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

2 participants