Giter Site home page Giter Site logo

ytti / oxidized Goto Github PK

View Code? Open in Web Editor NEW
2.6K 129.0 902.0 2.38 MB

Oxidized is a network device configuration backup tool. It's a RANCID replacement!

License: Apache License 2.0

Ruby 96.48% Shell 2.87% Dockerfile 0.65%
nms network backup rancid

oxidized's People

Contributors

aschaber1 avatar cppmonkey avatar danilopopeye avatar davama avatar dependabot[bot] avatar elmobp avatar elvinefendi avatar emjemj avatar freddy36 avatar jsynack avatar laf avatar majesticfalcon avatar mikebryant avatar mjbnz avatar mrrj45 avatar nickhilliard avatar nopedial avatar ohaase-dev avatar ospfbgp avatar raunz avatar rfdrake avatar robertcheramy avatar roedie avatar sharteeya avatar skoef avatar sts avatar tphakala avatar udhos avatar wk avatar ytti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oxidized's Issues

more robust configuration handling

We expect configurations to exist, if they don't we don't handle it gracefully and fall back to default values, we should fix this by loading bootstrap values first then overload configuration from filesystem.

Array convert error in acos.rb

I'm try to pull config from A10 device and seems stuck on Aflex array. not a ruby enthusiastic but will try to sort out ๐Ÿ’จ

2014-12-05 12:31:55 UTC

can't convert Array into String [TypeError]

/var/lib/gems/1.9.1/gems/oxidized-0.3.0/lib/oxidized/string.rb:23:in initialize' /var/lib/gems/1.9.1/gems/oxidized-0.3.0/lib/oxidized/string.rb:23:ininitialize'
/var/lib/gems/1.9.1/gems/oxidized-0.3.0/lib/oxidized/model/model.rb:156:in new' /var/lib/gems/1.9.1/gems/oxidized-0.3.0/lib/oxidized/model/model.rb:156:inprocess_cmd_output'
/var/lib/gems/1.9.1/gems/oxidized-0.3.0/lib/oxidized/model/model.rb:91:in cmd' /var/lib/gems/1.9.1/gems/oxidized-0.3.0/lib/oxidized/model/acos.rb:39:inblock (3 levels) in class:ACOS'
/var/lib/gems/1.9.1/gems/oxidized-0.3.0/lib/oxidized/model/acos.rb:38:in each' /var/lib/gems/1.9.1/gems/oxidized-0.3.0/lib/oxidized/model/acos.rb:38:inblock (2 levels) in class:ACOS'
/var/lib/gems/1.9.1/gems/oxidized-0.3.0/lib/oxidized/model/acos.rb:36:in each' /var/lib/gems/1.9.1/gems/oxidized-0.3.0/lib/oxidized/model/acos.rb:36:inblock in class:ACOS'
/var/lib/gems/1.9.1/gems/oxidized-0.3.0/lib/oxidized/model/model.rb:136:in instance_eval' /var/lib/gems/1.9.1/gems/oxidized-0.3.0/lib/oxidized/model/model.rb:136:inblock in get'
/var/lib/gems/1.9.1/gems/oxidized-0.3.0/lib/oxidized/model/model.rb:135:in each' /var/lib/gems/1.9.1/gems/oxidized-0.3.0/lib/oxidized/model/model.rb:135:inget'
/var/lib/gems/1.9.1/gems/oxidized-0.3.0/lib/oxidized/input/cli.rb:13:in get' /var/lib/gems/1.9.1/gems/oxidized-0.3.0/lib/oxidized/node.rb:54:inrun_input'
/var/lib/gems/1.9.1/gems/oxidized-0.3.0/lib/oxidized/node.rb:32:in block in run' /var/lib/gems/1.9.1/gems/oxidized-0.3.0/lib/oxidized/node.rb:30:ineach'
/var/lib/gems/1.9.1/gems/oxidized-0.3.0/lib/oxidized/node.rb:30:in run' /var/lib/gems/1.9.1/gems/oxidized-0.3.0/lib/oxidized/job.rb:8:inblock in initialize'

PowerConnect 54xx and 55xx

We have a large amount of these switches, and it looks like model/powerconnect.rb used to use:

post_login "terminal datadump"
pre_logout "exit"

This was changed some time ago to this, which is suitable for some models of PowerConnect but not the 54xx and 55xx.

post_login "terminal length 0"
pre_logout "logout"

I have tried to extract the model number from "show system" so the module can decide which commands to use, but I wasnt able to get this to work correctly.

Nagios monitoring script

The following is a small script which we wrote to add failing oxidized nodes to our monitoring system. Might be worth to include it.

#!/usr/bin/env ruby

require 'open-uri'
require 'json'

critical = false
critical_nodes = []

json = JSON.load(open("http://localhost:8888/nodes.json"))
json.each do |node|
    last = node['last']
    if node['last']['status'] != 'success'
        critical_nodes << node['name']
        critical = true
    end
end

if critical
    puts 'Unable to backup: ' + critical_nodes.join(' ')
    exit 2
else
    puts 'Backup of all nodes completed successfully.'
    exit 0
end

Comments in CSV source

Hey,

Thank you for this tool :)

I noticed that rancid supports comments in router.db (lines beginning with '#') but it doesn't seem to work in oxidized:

 E, [2014-12-12T15:25:21.900916 #3800] ERROR -- : node {:name=>"# comment"

I don't know ruby otherwise I'd send a PR. I guess it's a fairly small change?

Thanks

Request feature to trigger config download per-device

Would like the ability to tell Oxidized when a device's config has changed (as indicated by the device sending a syslog message or SNMP trap to a monitoring system) and cause it to immediately retrieve the updated config for that device only.

Ideally, also to be able to configure 'interval' on a per-model level. So we can make the interval short for models which do not support the above (sending a message on config change), and long for those which do.

dell powerconnect prompt not detected

Hi (again!)

I'm having issues with my Dell PowerConnects. I have a prompt in the format 'FW-XX-001>' but that's as far as it gets. The logs show the following and no backup is being peformed:

FW-XX-001> Type help or '?' for a list of available commands.

I noticed the prompt regex ^([\w\s.@-]+[#>]\s?)$ in file powerconnect.rb line 3. This doesn't match my prompt.

Expose Git Versions

It should be possible to browse different versions of configurations stored per item in GIT, through the web interface. Therefore we would need to a couple of new API calls:

  • expose whether GIT output is enabled
  • get a list of stored commits per item including metadata
  • get a specific version of an item including metadata
  • get a diff between two named versions (the rugged gem seems to provide a way to do so)

Any thoughts on this?

Allow push to remote

Since rugged/libgit2 ignores hooks, an option would be nice to let oxidized automatically push new commits to a configurable remote.

ASA 5525-X not supported

Hi,

I'm testing with oxidized v0.2.3. Hardware is Cisco ASA 5525-X. I tried 'asa' and 'ios' models in the configuration. N.B. we may not have have hostnames/DNS set up correctly.

hardware details:

FW-XX-001> show version

Cisco Adaptive Security Appliance Software Version 9.0(1) 
Device Manager Version 7.0(2)

Compiled on Fri 26-Oct-12 17:15 PDT by builders
System image file is "disk0:/asa901-smp-k8.bin"
Config file at boot was "startup-config"

FW-XX-001 up 1 year 30 days
failover cluster up 2 years 45 days

Hardware:   ASA5525, 8192 MB RAM, CPU Lynnfield 2394 MHz, 1 CPU (4 cores)
            ASA: 4096 MB RAM, 1 CPU (1 co

When I ssh, this is the output:

[email protected]'s password: 
Type help or '?' for a list of available commands.
FW-XX-001>

The last line of the ssh input log is "FW-XX-001> ?" and no backup is made.

Also, regarding recent commits:

  • c59b4b5 there is no slash in my prompt (I believe you have to enable this via "prompt hostname state priority")
  • 34c4559 there's no '@' in my prompt

git garbage collection

I have oxidized polling >100 Devices for quite some time (~1 year) and noticed that the .git directory kept taking up inodes. In numbers: 3340120 and it began to become a problem.
After a git gc --aggressive run the inode count was reduced to 31.
Adding gc.auto to the git config could solve this problem.

ERROR: System is busy. Please try later. (1008)

This isn't really an Oxidized issue since the program works flawless. However, I'd love to see some functionality to resolve the issue above. The notification is quite clear: from time to time our AOS switches are too busy which makes them return the error above. Functionality to filter for this kind of messages, so Oxidized wouldn't push it to Git, would come in very handy.

shot 2015-05-18 at 16 37 27

undefined method `write' for nil:NilClass [NoMethodError]

Try to pull config from PowerConnect device and come out with crash result, not really sure what I do have miss in configuration

router.db
10.0.1.2:power connect:admin:pass:pass

2014-12-02 09:08:19 UTC

undefined method `write' for nil:NilClass [NoMethodError]

/var/lib/gems/1.9.1/gems/oxidized-0.2.3/lib/oxidized/input/telnet.rb:38:in send' /var/lib/gems/1.9.1/gems/oxidized-0.2.3/lib/oxidized/model/powerconnect.rb:34:inblock in class:PowerConnect'
/var/lib/gems/1.9.1/gems/oxidized-0.2.3/lib/oxidized/input/telnet.rb:12:in instance_exec' /var/lib/gems/1.9.1/gems/oxidized-0.2.3/lib/oxidized/input/telnet.rb:12:inblock in connect'
/var/lib/gems/1.9.1/gems/oxidized-0.2.3/lib/oxidized/input/telnet.rb:12:in each' /var/lib/gems/1.9.1/gems/oxidized-0.2.3/lib/oxidized/input/telnet.rb:12:inconnect'
/var/lib/gems/1.9.1/gems/oxidized-0.2.3/lib/oxidized/node.rb:53:in run_input' /var/lib/gems/1.9.1/gems/oxidized-0.2.3/lib/oxidized/node.rb:32:inblock in run'
/var/lib/gems/1.9.1/gems/oxidized-0.2.3/lib/oxidized/node.rb:30:in each' /var/lib/gems/1.9.1/gems/oxidized-0.2.3/lib/oxidized/node.rb:30:inrun'
/var/lib/gems/1.9.1/gems/oxidized-0.2.3/lib/oxidized/job.rb:8:in `block in initialize'

Not matching configured prompt

When running Oxidized I'm getting this in my logs:

I, [2015-03-16T15:59:21.131421 #10744] INFO -- : Oxidized starting, running as pid 10744
I, [2015-03-16T15:59:21.205009 #10744] INFO -- : Loaded 1 nodes
D, [2015-03-16T15:59:21.731407 #10744] DEBUG -- : Jobs 0, Want: 1
W, [2015-03-16T15:59:42.584389 #10744] WARN -- : *_IP_* raised Oxidized::PromptUndetect with msg "
Welcome to the Alcatel-Lucent OmniSwitch 6000
Software Version 6.4.4.707.R01 Service Release, September 17, 2014.

Copyright(c), 1994-2011 Alcatel-Lucent. All Rights reserved.

OmniSwitch(TM) is a trademark of Alcatel-Lucent registered
in the United States Patent and Trademark Office.

_WELCOME_MESSAGE_
****************************************************************************FE-001-> not matching >configured prompt (?-mix:^([\w.@-]+[#>]\s?)$)"
D, [2015-03-16T15:59:42.589125 #10744] DEBUG -- : 192.168.253.101 raised >Errno::ECONNREFUSED with msg "Connection refused - connect(2)"
W, [2015-03-16T15:59:42.735280 #10744] WARN -- : ***
DNS
* status no_connection, retry >attempt 1
D, [2015-03-16T15:59:42.735462 #10744] DEBUG -- : Jobs 0, Want: 1

Can someone help me out?

Numeric ordering for devices names

The webinterface's ordering seems wrong:

sw1.foo
sw10.bar
sw11.quux
sw2.quuux

Wheras it should be ordered like so:

sw1.foo
sw2.quuux
sw10.bar
sw11.quux

Running SyslogMonitor

What is the best way to run the Syslog Monitor? I have tried this:

[program:oxidized-syslog]
command=/var/lib/gems/1.9.1/gems/oxidized-0.4.1/extra/syslog.rb
autostart=true
autorestart=true
user=oxidized
stderr_logfile=/var/log/oxidized-syslog.err.log
stdout_logfile=/var/log/oxidized-syslog.out.log

It fails with this:

/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- ./rest_client (LoadError) from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from /var/lib/gems/1.9.1/gems/oxidized-0.4.1/extra/syslog.rb:17:in `

'

Hard coding the full path to rest_client.rb works fine, but all of this is version specific.

What would be nice would be to have /usr/local/bin/oxidized-syslog which can be ran and doesnt depend on the version number or hard coding paths :)

IOS: Fails to recognized User Name: and Password prompt on Cisco SG300-52

Oxidized fails to authenticate using Telnet or SSH connection with IOS model on Cisco SG300-52.

#show version
SW version    1.3.7.18 ( date  12-Jan-2014 time  18:02:59 )
Boot version    1.3.5.06 ( date  21-Jul-2013 time  15:12:10 )
HW version    V02

Manually connecting looks like:

$ ssh 192.168.0.253




User Name:admin
Password:******************************

Using Oxidized, debugging @output in the expect method shows:

"\r\n\r\r\n\r\n\r\nUser Name:"
"admin\r\n\rPassword:"

Yes, there is a mismatched \r in there. It appears the first instance of a line ending is \r\n\r.

fix memory leak

Oxidized probably leaks memory:

aug 14th
rancid 14581 5.1 26.6 1186764 271472 pts/9 Sl+ Jul29 1191:01 ruby /var/rancid//.rvm/gems/ruby-2.1.2/bin/oxidized

aug 19th
rancid 14581 5.5 27.6 1187792 281764 pts/9 Sl+ Jul29 1683:14 ruby /var/rancid//.rvm/gems/ruby-2.1.2/bin/oxidized

This is with some 4k nodes (with 1h rotation), some new boxes may have been added in between, but shouldn't explain the increase.

I've done some research into this, but it's not exactly trivial to troubleshoot memory use in MRI. It might also be better if instead trying to fix this, we refactor Nodes class out or at least make keep in memory at once only nodes being worked on, store it in disk in SQLite and get data from there. Would also give persistence on stats etc.

Error for incorrect .git permissions is quite opaque

If the .git repo is not writeable, the error seems to be:

== Sinatra/1.4.5 has taken the stage on 8888 for development with backup from Puma
wrong argument type Rugged::Repository (expected String)
== Sinatra has ended his set (crowd applauds)
/var/lib/gems/1.9.1/gems/oxidized-0.2.3/lib/oxidized/output/git.rb:36:in `init_at': wrong argument type Rugged::Repository (expected String) (TypeError)

Not very obvious!

Emtpy line in router.db kills oxidized

oxidized@ubuntu:~$ oxidized -d
cannot interpret as DNS name: nil
/usr/lib/ruby/1.9.1/resolv.rb:1144:in `create': cannot interpret as DNS name: nil (ArgumentError)
    from /usr/lib/ruby/1.9.1/resolv.rb:990:in `generate_candidates'
    from /usr/lib/ruby/1.9.1/resolv.rb:1015:in `resolv'
    from /usr/lib/ruby/1.9.1/resolv.rb:498:in `each_resource'
    from /usr/lib/ruby/1.9.1/resolv.rb:391:in `each_address'
    from /usr/lib/ruby/1.9.1/resolv.rb:115:in `block in each_address'
    from /usr/lib/ruby/1.9.1/resolv.rb:114:in `each'
    from /usr/lib/ruby/1.9.1/resolv.rb:114:in `each_address'
    from /usr/lib/ruby/1.9.1/resolv.rb:92:in `getaddress'
    from /usr/lib/ruby/1.9.1/resolv.rb:43:in `getaddress'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/node.rb:13:in `initialize'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/nodes.rb:23:in `new'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/nodes.rb:23:in `block (2 levels) in load'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/nodes.rb:15:in `each'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/nodes.rb:15:in `block in load'
    from <internal:prelude>:10:in `synchronize'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/nodes.rb:100:in `with_lock'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/nodes.rb:10:in `load'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/nodes.rb:95:in `initialize'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/core.rb:18:in `new'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/core.rb:18:in `initialize'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/core.rb:11:in `new'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/core.rb:11:in `new'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/cli.rb:9:in `run'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/bin/oxidized:8:in `<top (required)>'
    from /usr/local/bin/oxidized:23:in `load'
    from /usr/local/bin/oxidized:23:in `<main>'
oxidized@ubuntu:~$ 

Oxidized dies on HUP reload

xxxx 22685 2.2 0.5 829120 42916 pts/1 Sl+ 13:55 0:11 /usr/bin/ruby1.9.1 /usr/local/bin/oxidized

xxxx@mon01:~$ kill -HUP 22685

xxxx@mon01:~/.config/oxidized$ oxidized
Puma 2.11.1 starting...

  • Min threads: 0, max threads: 16
  • Environment: development
  • Listening on tcp://10.0.0.31:8888
    Hangup

Log doesn't show anything obvious.

Have to create logfile by hand

It does not create its own log file:

~/work/git/oxidized# oxidized
No such file or directory - /home/oxidized/.config/oxidized/log
~/work/git/oxidized# 

Node counter is 0 on initial start

I, [2015-02-26T13:51:07.298977 #14223] INFO -- : Oxidized starting, running as pid 14223
I, [2015-02-26T13:51:07.343582 #14223] INFO -- : Loaded 0 nodes

It works, if I reload it via the REST API

Dies silently with broken router.db

I autogenerate my router list and had a debug message in my router.db:

----- HOST XXX does not have a CNAME nor A record!

and oxidized simply did nothing. It started, offered WWW, but didn't make any backups at all.

Misleading error message with tab in config file

If I have a tab char in ~/.config/oxidized/config by mistake, the resulting error is misleading:

richih@titanium  ~/test/oxidized % oxidized
(<unknown>): found a tab character that violate intendation while scanning a plain scalar at line 2 column 11
/var/lib/gems/2.1.0/gems/oxidized-0.0.61/bin/oxidized:11:in `rescue in <top (required)>': uninitialized constant Oxidized::CFG (NameError)
    from /var/lib/gems/2.1.0/gems/oxidized-0.0.61/bin/oxidized:6:in `<top (required)>'
    from /usr/local/bin/oxidized:23:in `load'
    from /usr/local/bin/oxidized:23:in `<main>'
richih@titanium  ~/test/oxidized % 

crash on git timeout

I assume this can happen when the disk r/w is so slow we get a timeout. (as this host often pauses frequently with it's heavy RRD access).

--------------------------------------------------
2014-03-12 21:57:48 UTC
Grit::Git::GitTimeout [Grit::Git::GitTimeout]
--------------------------------------------------
/opt/oxidized-omnibus/embedded/lib/ruby/gems/1.9.1/gems/grit-2.5.0/lib/grit/git.rb:363:in `rescue in native'
/opt/oxidized-omnibus/embedded/lib/ruby/gems/1.9.1/gems/grit-2.5.0/lib/grit/git.rb:314:in `native'
/opt/oxidized-omnibus/embedded/lib/ruby/gems/1.9.1/gems/grit-2.5.0/lib/grit/git.rb:372:in `method_missing'
/opt/oxidized-omnibus/embedded/lib/ruby/gems/1.9.1/gems/grit-2.5.0/lib/grit/git-ruby.rb:55:in `rev_list'
/opt/oxidized-omnibus/embedded/lib/ruby/gems/1.9.1/gems/grit-2.5.0/lib/grit/commit.rb:122:in `find_all'
/opt/oxidized-omnibus/embedded/lib/ruby/gems/1.9.1/gems/grit-2.5.0/lib/grit/repo.rb:381:in `commits'
/opt/oxidized-omnibus/embedded/lib/ruby/gems/1.9.1/gems/oxidized-0.0.38/lib/oxidized/output/git.rb:58:in `update_repo'
/opt/oxidized-omnibus/embedded/lib/ruby/gems/1.9.1/gems/oxidized-0.0.38/lib/oxidized/output/git.rb:33:in `store'
/opt/oxidized-omnibus/embedded/lib/ruby/gems/1.9.1/gems/oxidized-0.0.38/lib/oxidized/worker.rb:29:in `process'
/opt/oxidized-omnibus/embedded/lib/ruby/gems/1.9.1/gems/oxidized-0.0.38/lib/oxidized/worker.rb:13:in `block in work'
/opt/oxidized-omnibus/embedded/lib/ruby/gems/1.9.1/gems/oxidized-0.0.38/lib/oxidized/worker.rb:13:in `each'
/opt/oxidized-omnibus/embedded/lib/ruby/gems/1.9.1/gems/oxidized-0.0.38/lib/oxidized/worker.rb:13:in `work'
/opt/oxidized-omnibus/embedded/lib/ruby/gems/1.9.1/gems/oxidized-0.0.38/lib/oxidized/core.rb:30:in `run'
/opt/oxidized-omnibus/embedded/lib/ruby/gems/1.9.1/gems/oxidized-0.0.38/lib/oxidized/core.rb:23:in `initialize'
/opt/oxidized-omnibus/embedded/lib/ruby/gems/1.9.1/gems/oxidized-0.0.38/lib/oxidized/core.rb:10:in `new'
/opt/oxidized-omnibus/embedded/lib/ruby/gems/1.9.1/gems/oxidized-0.0.38/lib/oxidized/core.rb:10:in `new'
/opt/oxidized-omnibus/embedded/lib/ruby/gems/1.9.1/gems/oxidized-0.0.38/bin/oxidized:8:in `<top (required)>'
/opt/oxidized-omnibus/bin/../embedded/bin/oxidized:23:in `load'
/opt/oxidized-omnibus/bin/../embedded/bin/oxidized:23:in `<main>'
--------------------------------------------------

Fails silently with broken router.db

#32

Sorry for re-opening, but this is not closed.

At the very least, it should print lines it can not interpret so the admin sees what's happening. Ideally, also expose that information in the web UI. Maybe create & link a "warning" page if any warnings occur.

Removing machines from router.db can lead to oxidized dying

If you remove a machine from router.db, and then click the reload link, oxidized can die with an error that it's unable to find said machine.

oxidized@noc1  ~ % unable to find '$machine'
== Sinatra has ended his set (crowd applauds)                                   
== Sinatra has ended his set (crowd applauds)                                   

[1]  + 39551 done       oxidized

Cisco ASR/IOS-XE - Parsing Broken

I would like to backup configuration of a Cisco ASR 1001 and it seems pulling the backup doesn't really work. Below is the output of the stored configuration. This is a complete show inventory of the host.

! Cisco IOS Software, IOS-XE Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 15.2(4)S6, RELEASE SOFTWARE (fc4)
! NAME: "Chassis", DESCR: "Cisco ASR1001 Chassis w/o IDC"
! PID: ASR1001           , VID: V01, SN: XXXXXXXXXXX
! 
! NAME: "Power Supply Module 0", DESCR: "Cisco ASR1001 AC Power Supply"
! PID: ASR1001-PWR-AC    , VID: V01, SN: XXXXXXXXXXX
! 
! NAME: "Power Supply Module 1", DESCR: "Cisco ASR1001 AC Power Supply"
! PID: ASR1001-PWR-AC    , VID: V01, SN: XXXXXXXXXXX
! 
! NAME: "module 0", DESCR: "Cisco ASR1001 SPA Interface Processor"
! PID: ASR1001           , VID:    , SN:            
! 
! NAME: "SPA subslot 0/0", DESCR: "4-port Gigabit Ethernet Shared Port Adapter"
! PID: ASR1001           , VID:    , SN:            
! 
! NAME: "subslot 0/0 transceiver 0", DESCR: "GE T"
! PID: N/A                 , VID: F   , SN: XXXXXXXXXXX
! 
! NAME: "subslot 0/0 transceiver 1", DESCR: "GE T"
! PID: N/A                 , VID: E   , SN: XXXXXXXXXXX     
! 
! NAME: "subslot 0/0 transceiver 3", DESCR: "GE T"
! PID: N/A                 , VID: 11.0, SN: XXXXXXXXXXX    
! 
! NAME: "module R0", DESCR: "Cisco ASR1001 Route Processor"
! PID: ASR1001           , VID: V01, SN: XXXXXXXXXXX
! 
! NAME: "module F0", DESCR: "Cisco ASR1001 Embedded Services Processor"
! PID: ASR1001           , VID:    , SN:            
! 
! 

Afterwards there is no more output (no traces of the show version, running-config).

Log Output from an update

D, [2014-10-22T17:48:20.147174 #15489] DEBUG -- : SSH: terminal length 0 @ asr01.example.org
D, [2014-10-22T17:48:20.550736 #15489] DEBUG -- : SSH: terminal width 0 @ asr01.example.org
D, [2014-10-22T17:48:20.956171 #15489] DEBUG -- : SSH: show version @ asr01.example.org
D, [2014-10-22T17:48:21.359670 #15489] DEBUG -- : SSH: show inventory @ asr01.example.org
D, [2014-10-22T17:48:21.763836 #15489] DEBUG -- : SSH: show running-config @ asr01.example.org
D, [2014-10-22T17:48:22.167758 #15489] DEBUG -- : SSH: exit @ asr01.example.org

Running the commands above manually using the CLI actually work

bin/oxs asr01.example.org -u foo -p xxxx --verbose -e xxxx --terse --debug 'show version' #=> OK
bin/oxs asr01.example.org -u foo -p xxxx --verbose -e xxxx --terse --debug 'show inventory' #=> OK
bin/oxs asr01.example.org -u foo -p xxxx --verbose -e xxxx --terse --debug 'show running-config' #=> OK

Is there also a way to debug parsing with the IOS module? The router is actually running IOS-XE, but all of the old IOS commands work when it comes to dumping configuration.

Existing but empty Git target breaks oxidized

If you have, e.g. /home/oxidized/configs.git existing, but empty (i.e. without any repo), you get:

oxidized@ubuntu:~$ oxidized -d
Puma 2.8.2 starting...
* Min threads: 0, max threads: 16
* Environment: development
* Listening on tcp://<redacted>:8888
== Sinatra/1.4.5 has taken the stage on 8888 for development with backup from Puma
undefined method `put_raw_object' for nil:NilClass
== Sinatra has ended his set (crowd applauds)
== Sinatra has ended his set (crowd applauds)
/var/lib/gems/1.9.1/gems/grit-2.5.0/lib/grit/git-ruby/repository.rb:112:in `put_raw_object': undefined method `put_raw_object' for nil:NilClass (NoMethodError)
    from /var/lib/gems/1.9.1/gems/grit-2.5.0/lib/grit/git.rb:52:in `put_raw_object'
    from /var/lib/gems/1.9.1/gems/grit-2.5.0/lib/grit/index.rb:209:in `write_tree'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/output/git.rb:63:in `update_repo'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/output/git.rb:36:in `store'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/worker.rb:36:in `process'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/worker.rb:13:in `block in work'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/worker.rb:13:in `each'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/worker.rb:13:in `work'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/core.rb:36:in `run'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/core.rb:29:in `initialize'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/core.rb:11:in `new'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/core.rb:11:in `new'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/cli.rb:9:in `run'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/bin/oxidized:8:in `<top (required)>'
    from /usr/local/bin/oxidized:23:in `load'
    from /usr/local/bin/oxidized:23:in `<main>'
oxidized@ubuntu:~$ 

Dont resolve name if IP given

We have alot of switches backed up using oxidized and they all have internal names, so no DNS for these.

I've modified "lib/oxidized/node.rb" with the following, and it seems to work well.

if opt[:ip].length > 0
@ip = opt[:ip]
else
@ip = Resolv.getaddress @name
end

Would it be possible to get this changed officially if people think this is a good idea?

Incorrect commits

-vlann 115 802.1q 3/47 "TAG for VoIP"
+vlan 115 802.1q 3/47 "TAG for VoIP"

While nothing changed on the switch.

oxidized does not check if git is installed

If grit is installed and git usage configured, but Git is not installed, this happens:

oxidized@ubuntu:~$ oxidized -d
Puma 2.8.2 starting...
* Min threads: 0, max threads: 16
* Environment: development
* Listening on tcp://<redacted>:8888
== Sinatra/1.4.5 has taken the stage on 8888 for development with backup from Puma
can't convert nil into String
== Sinatra has ended his set (crowd applauds)
== Sinatra has ended his set (crowd applauds)
/var/lib/gems/1.9.1/gems/posix-spawn-0.3.8/lib/posix/spawn.rb:187:in `_pspawn': can't convert nil into String (TypeError)
    from /var/lib/gems/1.9.1/gems/posix-spawn-0.3.8/lib/posix/spawn.rb:187:in `pspawn'
    from /var/lib/gems/1.9.1/gems/posix-spawn-0.3.8/lib/posix/spawn.rb:160:in `spawn'
    from /var/lib/gems/1.9.1/gems/posix-spawn-0.3.8/lib/posix/spawn.rb:312:in `popen4'
    from /var/lib/gems/1.9.1/gems/posix-spawn-0.3.8/lib/posix/spawn/child.rb:105:in `exec!'
    from /var/lib/gems/1.9.1/gems/posix-spawn-0.3.8/lib/posix/spawn/child.rb:80:in `initialize'
    from /var/lib/gems/1.9.1/gems/grit-2.5.0/lib/grit/git.rb:345:in `new'
    from /var/lib/gems/1.9.1/gems/grit-2.5.0/lib/grit/git.rb:345:in `native'
    from /var/lib/gems/1.9.1/gems/grit-2.5.0/lib/grit/git.rb:372:in `method_missing'
    from /var/lib/gems/1.9.1/gems/grit-2.5.0/lib/grit/git-ruby.rb:16:in `init'
    from /var/lib/gems/1.9.1/gems/grit-2.5.0/lib/grit/repo.rb:101:in `init_bare'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/output/git.rb:38:in `rescue in store'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/output/git.rb:33:in `store'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/worker.rb:36:in `process'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/worker.rb:13:in `block in work'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/worker.rb:13:in `each'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/worker.rb:13:in `work'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/core.rb:36:in `run'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/core.rb:29:in `initialize'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/core.rb:11:in `new'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/core.rb:11:in `new'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/lib/oxidized/cli.rb:9:in `run'
    from /var/lib/gems/1.9.1/gems/oxidized-0.0.63/bin/oxidized:8:in `<top (required)>'
    from /usr/local/bin/oxidized:23:in `load'
    from /usr/local/bin/oxidized:23:in `<main>'
oxidized@ubuntu:~$

Init Script

There is no way to automatically start oxidized and keep it running. What is the proposed way to do this?

/etc/hosts seems to be cached even after reload

After updating /etc/hosts with new hostnames and reloading oxidized's router.db it is not able to resolve those new hostnames until I fully restart it.

Seems there is some caching behaviour for /etc/hosts entries.

E, [2015-02-26T15:59:49.965555 #5825] ERROR -- : node {:name=>"es1.xxx.nn", :model=>"ironware", :group=>"edge"} is not resolvable, raised Resolv::ResolvError with message 'no address for es1.xxx.nn'
E, [2015-02-26T15:59:49.968067 #5825] ERROR -- : node {:name=>"es1.yyy.mm", :model=>"ironware", :group=>"edge"} is not resolvable, raised Resolv::ResolvError with message 'no address for es1.yyy.mm'
E, [2015-02-26T15:59:49.982379 #5825] ERROR -- : node {:name=>"es1.zzz.bb", :model=>"junos", :group=>"edge"} is not resolvable, raised Resolv::ResolvError with message 'no address for es1.zzz.bb'
I, [2015-02-26T15:59:49.984191 #5825] INFO -- : Loaded 58 nodes

Issues with storing configs in git repo

I currently have an installation where I started out having only a file output defined, this seems to work perfectly fine. But now I want to move to a git repo, but adding the name, email and repo to a git output, then setting this output as a default seems to not create any files within the git repo. Nothing weird is within the debug log. It contains the usual information that shows that it connects to the devices, runs a few commands and exits.

Suggestions to help me debugging this are very much welcome :-)

Needs -web without "rest"

~/.config/oxidized/config:


username: ytti
password: hkkl
model: junos
interval: 3600
log: "/home/richih/.config/oxidized/log"
debug: false
threads: 30
timeout: 30
prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/
vars: {}
groups: {}
remove_secret: false
input:
default: ssh, telnet
ssh:
secure: false
output:
default: file
source:
default: csv
csv:
file: "/home/richih/.config/oxidized/router.db"
delimiter: !ruby/regexp /:/
map:
name: 0
model: 1
model_map:
cisco: ios
juniper: junos

richih@titanium  ~/test/oxidized % oxidized
oxidized-web not found: sudo gem install oxidized-web
richih@titanium  ~/test/oxidized % 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.