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

Problem starting oxidized #1059

Closed FrankyLibre closed 7 years ago

FrankyLibre commented 7 years ago

have a Problem to start oxidized: any ideas ?

root@LibreNMS:/opt/librenms/oxidized/docs# oxidized I, [2017-10-08T21:50:06.489809 #15316] INFO -- : Oxidized starting, running as pid 15316 F, [2017-10-08T21:50:06.491765 #15316] FATAL -- : Oxidized crashed, crashfile written in /root/.config/oxidized/crash undefined method empty?' for nil:NilClass /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/source/csv.rb:9:insetup': undefined method empty?' for nil:NilClass (NoMethodError) from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/manager.rb:19:inload' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/manager.rb:53:in add_source' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/nodes.rb:13:inblock in load' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/nodes.rb:127:in synchronize' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/nodes.rb:127:inwith_lock' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/nodes.rb:10:in load' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/nodes.rb:122:ininitialize' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/core.rb:14:in new' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/core.rb:14:ininitialize' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/core.rb:4:in new' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/core.rb:4:innew' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/cli.rb:12:in run' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/bin/oxidized:9:in<top (required)>' from /usr/local/bin/oxidized:23:in load' from /usr/local/bin/oxidized:23:in

'

config:

username: admin password: ***** model: procurve interval: 3600 use_syslog: false debug: false threads: 30 timeout: 20 retries: 3 prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/ rest: 127.0.0.1:8888 next_adds_job: false vars: {} groups: {} models: {} pid: ~/.config/oxidized/pid input: default: ssh, telnet debug: true ssh: secure: false output: default: git file: directory: ~/.config/oxidized/configs output: default: git git: user: Oxidized email: o@example.com repo: "~/.config/oxidized/devices.git" source: default: csv csv: file: ~/.config/oxidized/router.db delimiter: !ruby/regexp /:/ map: name: 0 model: 1 username: 2 password: 3 vars_map: enable: 4 gpg: false model_map: cisco: ios juniper: junos hp: procurve

router.db

Switches

switch-extruder7.j-a.de:hp:admin:****:enable

FrankyLibre commented 7 years ago

have a Problem to start oxidized: any ideas ? root@LibreNMS:/opt/librenms/oxidized/docs# oxidized I, [2017-10-08T21:50:06.489809 #15316] INFO -- : Oxidized starting, running as pid 15316 F, [2017-10-08T21:50:06.491765 #15316] FATAL -- : Oxidized crashed, crashfile written in /root/.config/oxidized/crash undefined method empty?' for nil:NilClass /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/source/csv.rb:9:insetup': undefined method empty?' for nil:NilClass (NoMethodError) from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/manager.rb:19:inload' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/manager.rb:53:in add_source' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/nodes.rb:13:inblock in load' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/nodes.rb:127:in synchronize' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/nodes.rb:127:inwith_lock' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/nodes.rb:10:in load' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/nodes.rb:122:ininitialize' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/core.rb:14:in new' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/core.rb:14:ininitialize' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/core.rb:4:in new' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/core.rb:4:innew' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/lib/oxidized/cli.rb:12:in run' from /var/lib/gems/2.3.0/gems/oxidized-0.20.0/bin/oxidized:9:in<top (required)>' from /usr/local/bin/oxidized:23:in load' from /usr/local/bin/oxidized:23:in '

config: username: admin password: ***** model: procurve interval: 3600 use_syslog: false debug: false threads: 30 timeout: 20 retries: 3 prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/ rest: 127.0.0.1:8888 next_adds_job: false vars: {} groups: {} models: {} pid: ~/.config/oxidized/pid input: default: ssh, telnet debug: true ssh: secure: false output: default: git file: directory: /.config/oxidized/configs output: default: git git: user: Oxidized email: o@example.com repo: "/.config/oxidized/devices.git" source: default: csv csv: file: ~/.config/oxidized/router.db delimiter: !ruby/regexp /:/ map: name: 0 model: 1 username: 2 password: 3 vars_map: enable: 4 gpg: false model_map: cisco: ios juniper: junos hp: procurve router.db

Switches

switch-extruder7.j-a.de:hp:admin:****:enable

cryol commented 7 years ago

@FrankyLibre this not correct:

repo: "/.config/oxidized/devices.git" directory: /.config/oxidized/configs

I recommend changing all paths to absolute ones (including file: ~/ .config/oxidized/router.db) see my config

FrankyLibre commented 7 years ago

i change the config, but the same error


username: admin password: taylormade model: procurve interval: 3600 use_syslog: false debug: false threads: 30 timeout: 20 retries: 3 prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/ rest: 127.0.0.1:8888 next_adds_job: false vars: {} groups: {} models: {} pid: /home/oxidized/.config/oxidized/pid input: default: ssh, telnet debug: true ssh: secure: false output: default: git file: directory: /home/oxidized/.config/oxidized/configs output: default: git git: user: Oxidized email: o@example.com repo: "/home/oxidized/.config/oxidized/devices" source: default: csv csv: file: /home/oxidized/.config/oxidized/router.db delimiter: !ruby/regexp /:/ map: name: 0 model: 1 username: 2 password: 3 vars_map: enable: 4 gpg: false model_map: cisco: ios juniper: junos hp: procurve

cryol commented 7 years ago

@FrankyLibre, see this: https://pastebin.com/HEuAcb1s it's work!

laf commented 7 years ago

Can this be closed @FrankyLibre ?

sau70networkadmin commented 7 years ago

I am getting the same error. I'm on Centos 7.

uname -a: Linux blah.example.org 3.10.0-693.5.2.el7.x86_64 #1 SMP Fri Oct 20 20:32:50 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

The crash log:

2017-11-05 17:01:17 UTC
undefined method `empty?' for nil:NilClass [NoMethodError]
/usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/output/file.rb:12:in `setup'
/usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/manager.rb:19:in `load'
/usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/manager.rb:40:in `add_output'
/usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/node.rb:155:in `resolve_output'
/usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/node.rb:22:in `initialize'
/usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/nodes.rb:19:in `new'
/usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/nodes.rb:19:in `block (2 levels) in load'
/usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/nodes.rb:15:in `each'
/usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/nodes.rb:15:in `block in load'
/usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/nodes.rb:128:in `synchronize'
/usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/nodes.rb:128:in `with_lock'
/usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/nodes.rb:10:in `load'
/usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/nodes.rb:123:in `initialize'
/usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/core.rb:14:in `new'
/usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/core.rb:14:in `initialize'
/usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/core.rb:4:in `new'
/usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/core.rb:4:in `new'
/usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/cli.rb:12:in `run'
/usr/local/share/gems/gems/oxidized-0.21.0/bin/oxidized:9:in `<top (required)>'
/usr/local/bin/oxidized:23:in `load'
/usr/local/bin/oxidized:23:in `<main>'

My config is

---
username: manager
password: sekrit
model: procurve
interval: 600
use_syslog: false
debug: false
threads: 30
timeout: 20
retries: 3
prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/
rest: 127.0.0.1:8787
next_adds_job: false
vars: 
  enable: s00persekrit
  remove_secret: true
groups: {}
models: {}
pid: /home/oxidized/.config/oxidized/pid
input:
  default: ssh, telnet
  debug: false
  ssh:
    secure: false
output:
  default: file
  file:
  directory: /home/oxidized/deviceconfigs
source:
  default: csv
  csv:
    file: /home/oxidized/.config/oxidized/router.db
    delimiter: !ruby/regexp /:/
    map:
      name: 0
      model: 1
      username: 2
      password: 3
    vars_map:
      enable: 4
model_map:
  cisco: ios
  juniper: junos

My router.db file contains a single IP address of a ProCurve switch.

File listings/permissions:

[oxidized@woody ~]$ pwd
/home/oxidized
[oxidized@woody ~]$ ls -al
total 20
drwx------  5 oxidized oxidized  141 Nov  5 12:08 .
drwxr-xr-x. 5 root     root       49 Nov  5  2016 ..
-rw-------  1 oxidized oxidized 1002 Nov  5 12:02 .bash_history
-rw-r--r--  1 oxidized oxidized   18 Aug  2  2016 .bash_logout
-rw-r--r--  1 oxidized oxidized  193 Aug  2  2016 .bash_profile
-rw-r--r--  1 oxidized oxidized  231 Aug  2  2016 .bashrc
drwxrwxr-x  3 oxidized oxidized   17 Nov  5 11:41 .cache
drwxrwxr-x  4 oxidized oxidized   32 Nov  5 11:41 .config
drwxrwxr-x  2 oxidized oxidized    6 Nov  5 11:41 deviceconfigs
-rw-------  1 oxidized oxidized 2163 Nov  5 12:08 .viminfo
[oxidized@woody ~]$ ls -al .config/
total 0
drwxrwxr-x 4 oxidized oxidized  32 Nov  5 11:41 .
drwx------ 5 oxidized oxidized 141 Nov  5 12:08 ..
drwxrwxr-x 2 oxidized oxidized   6 Nov  5 11:41 abrt
drwxrwxr-x 5 oxidized oxidized  96 Nov  5 12:08 oxidized
[oxidized@woody ~]$ ls -al .config/oxidized/
total 16
drwxrwxr-x 5 oxidized oxidized   96 Nov  5 12:08 .
drwxrwxr-x 4 oxidized oxidized   32 Nov  5 11:41 ..
-rw-rw-r-- 1 oxidized oxidized  739 Nov  5 12:01 config
drwxrwxr-x 2 oxidized oxidized    6 Nov  5 11:59 configs
-rw-rw-r-- 1 oxidized oxidized 1871 Nov  5 12:07 crash
drwxrwxr-x 2 oxidized oxidized    6 Nov  5 11:59 devices
-rw-rw-r-- 1 oxidized oxidized  674 Nov  5 11:55 log
drwxrwxr-x 2 oxidized oxidized    6 Nov  5 11:50 logs
-rw-rw-r-- 1 oxidized oxidized   35 Nov  5 12:08 router.db

I ran yum -y update and restarted the server, but no change. Any ideas?

Thank you,

-- MB

laf commented 7 years ago

That's not the same error though.

From the output, it indicates that the config is empty - are you starting oxidized as the user oxidized?

sau70networkadmin commented 7 years ago

Sorry, I thought it was the same. I am running as user oxidized:

[oxidized@woody ~]$ whoami oxidized [oxidized@woody ~]$ oxidized I, [2017-11-05T17:27:04.337310 #12479] INFO -- : Oxidized starting, running as pid 12479 I, [2017-11-05T17:27:04.337760 #12479] INFO -- : lib/oxidized/nodes.rb: Loading nodes F, [2017-11-05T17:27:04.375039 #12479] FATAL -- : Oxidized crashed, crashfile written in /home/oxidized/.config/oxidized/crash undefined method empty?' for nil:NilClass /usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/output/file.rb:12:insetup': undefined method empty?' for nil:NilClass (NoMethodError) from /usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/manager.rb:19:inload' from /usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/manager.rb:40:in add_output' from /usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/node.rb:155:inresolve_output' from /usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/node.rb:22:in initialize' from /usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/nodes.rb:19:innew' from /usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/nodes.rb:19:in block (2 levels) in load' from /usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/nodes.rb:15:ineach' from /usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/nodes.rb:15:in block in load' from /usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/nodes.rb:128:insynchronize' from /usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/nodes.rb:128:in with_lock' from /usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/nodes.rb:10:inload' from /usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/nodes.rb:123:in initialize' from /usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/core.rb:14:innew' from /usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/core.rb:14:in initialize' from /usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/core.rb:4:innew' from /usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/core.rb:4:in new' from /usr/local/share/gems/gems/oxidized-0.21.0/lib/oxidized/cli.rb:12:inrun' from /usr/local/share/gems/gems/oxidized-0.21.0/bin/oxidized:9:in <top (required)>' from /usr/local/bin/oxidized:23:inload' from /usr/local/bin/oxidized:23:in `

'

Thank you,

-- MB

laf commented 7 years ago

output: default: file file: directory: /home/oxidized/deviceconfigs

This should be:

output:
  file:
    directory: /home/oxidized/deviceconfigs
sau70networkadmin commented 7 years ago

@laf THANK YOU that did it! 👍