ytti / oxidized

Oxidized is a network device configuration backup tool. It's a RANCID replacement!
Apache License 2.0
2.8k stars 927 forks source link

Error on startup with oxidized in Ubuntu 22.04 #3094

Closed petreanv27 closed 3 months ago

petreanv27 commented 8 months ago

I'm getting the following error on startup with oxidized in Ubuntu 22.04. Any ideas on a possible cause?

cannot interpret as DNS name: nil
/usr/lib/ruby/3.0.0/resolv.rb:1248:in `create': cannot interpret as DNS name: nil (ArgumentError)
        from /usr/lib/ruby/3.0.0/resolv.rb:1088:in `generate_candidates'
        from /usr/lib/ruby/3.0.0/resolv.rb:1117:in `resolv'
        from /usr/lib/ruby/3.0.0/resolv.rb:521:in `fetch_resource'
        from /usr/lib/ruby/3.0.0/resolv.rb:507:in `each_resource'
        from /usr/lib/ruby/3.0.0/resolv.rb:402:in `each_address'
        from /usr/lib/ruby/3.0.0/resolv.rb:116:in `block in each_address'
        from /usr/lib/ruby/3.0.0/resolv.rb:115:in `each'
        from /usr/lib/ruby/3.0.0/resolv.rb:115:in `each_address'
        from /usr/lib/ruby/3.0.0/resolv.rb:93:in `getaddress'
        from /var/lib/gems/3.0.0/gems/oxidized-0.29.1/lib/oxidized/node.rb:20:in `initialize'
        from /var/lib/gems/3.0.0/gems/oxidized-0.29.1/lib/oxidized/nodes.rb:22:in `new'
        from /var/lib/gems/3.0.0/gems/oxidized-0.29.1/lib/oxidized/nodes.rb:22:in `block (2 levels) in load'
        from /var/lib/gems/3.0.0/gems/oxidized-0.29.1/lib/oxidized/nodes.rb:17:in `each'
        from /var/lib/gems/3.0.0/gems/oxidized-0.29.1/lib/oxidized/nodes.rb:17:in `block in load'
        from /var/lib/gems/3.0.0/gems/oxidized-0.29.1/lib/oxidized/nodes.rb:133:in `synchronize'
        from /var/lib/gems/3.0.0/gems/oxidized-0.29.1/lib/oxidized/nodes.rb:133:in `with_lock'
        from /var/lib/gems/3.0.0/gems/oxidized-0.29.1/lib/oxidized/nodes.rb:11:in `load'
        from /var/lib/gems/3.0.0/gems/oxidized-0.29.1/lib/oxidized/nodes.rb:128:in `initialize'
        from /var/lib/gems/3.0.0/gems/oxidized-0.29.1/lib/oxidized/core.rb:14:in `new'
        from /var/lib/gems/3.0.0/gems/oxidized-0.29.1/lib/oxidized/core.rb:14:in `initialize'
        from /var/lib/gems/3.0.0/gems/oxidized-0.29.1/lib/oxidized/core.rb:4:in `new'
        from /var/lib/gems/3.0.0/gems/oxidized-0.29.1/lib/oxidized/core.rb:4:in `new'
        from /var/lib/gems/3.0.0/gems/oxidized-0.29.1/lib/oxidized/cli.rb:13:in `run'
        from /var/lib/gems/3.0.0/gems/oxidized-0.29.1/bin/oxidized:8:in `<top (required)>'
        from /usr/local/bin/oxidized:25:in `load'
        from /usr/local/bin/oxidized:25:in `<main>'

nano /root/.config/oxidized/config

---
username: admin
password: password
model: junos
resolve_dns: true
interval: 3600
use_syslog: false
debug: false
threads: 30
use_max_threads: false
timeout: 20
retries: 3
prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/
rest: 0.0.0.0:8888
next_adds_job: false
vars: {}
groups: {}
group_map: {}
models: {}
pid: "/root/.config/oxidized/pid"
log: "/root/.config/oxidized/log"
crash:
  directory: "/root/.config/oxidized/crashes"
  hostnames: false
stats:
  history_size: 10
input:
  default: ssh, telnet
  debug: false
output:
  default: git
  git:
    user: admin
    email: 0@example.com
    repo: "/root/.config/oxidized/devices"
output:
  default: file
  file:
    directory: "/root/.config/oxidized/configs"
source:
  default: csv
  csv:
    file: "/root/.config/oxidized/router.db"
    delimiter: !ruby/regexp /:/
  map:
    name: 0
    ip: 1
    model: 2
    username: 3
    password: 4
  vars_map:
    enable: 5
  gpg: false
model_map:
  cisco: ios
  juniper: junos
  hp: procurve
  mikrotik: routeros

nano /root/.config/oxidized/router.db

#Switches
sw1:192.168.1.1:juniper:admin:pass

(Formating updated by @robertcheramy for readablilty)

marmack95 commented 7 months ago

Did you try to set resolve_dns to false ?