ytti / oxidized

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

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

Closed filip7sr closed 9 years ago

filip7sr commented 9 years ago

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

ytti commented 9 years ago

Is the entire config single line of 'ERROR: System is busy', which command gives that output?

I guess you could do something like this:

cmd 'what ever' do |cfg|

filter cfg

raise 'router was busy' if cfg.include? /ERROR: System is busy/ cfg end

filip7sr commented 9 years ago

I don't know which commands returns that output. I tried your suggestion:

cmd 'show system' do |cfg| raise 'router was busy' if cfg.include? /ERROR: System is busy/ cfg = cfg.each_line.find{|line|line.match 'Description'} comment cfg.to_s.strip end

results to this in the log:

I, [2015-05-18T17:30:47.442818 #9534] INFO -- : Oxidized starting, running as pid 9534 I, [2015-05-18T17:30:47.826856 #9534] INFO -- : Loaded 2 nodes E, [2015-05-18T17:30:51.605457 #9534] ERROR -- : 192.168.253.101 raised TypeError with msg "can't convert Regexp into String", /root/.config/oxidized/crash.192.168.253.101 saved

ytti commented 9 years ago

sorry cfg.match /ERROR: System is busy/

filip7sr commented 9 years ago

Following configuration doesn't solve the issue:

class AOS < Oxidized::Model

Alcatel-Lucent Operating System

used in OmniSwitch

comment '! '

cmd :all do |cfg| cfg.each_line.to_a[1..-2].join end

cmd 'show system' do |cfg| cfg.match /ERROR: System is busy/ cfg = cfg.each_line.find{|line|line.match 'Description'} comment cfg.to_s.strip end

cmd 'show chassis' do |cfg| cfg.match /ERROR: System is busy/ comment cfg end

cmd 'show hardware info' do |cfg| cfg.match /ERROR: System is busy/ comment cfg end

cmd 'show configuration snapshot' do |cfg| cfg.match /ERROR: System is busy/ cfg end

cmd 'show stack topology' do |cfg| cfg.match /ERROR: System is busy/ cfg end

cfg :telnet do username /^login : / password /^password : / end

cfg :telnet, :ssh do pre_logout 'exit' end

ytti commented 9 years ago

You forgot to raise error.

raise 'blaablaa' if cfg.match /.../

ytti commented 9 years ago

Any update?

filip7sr commented 9 years ago

Problem solved, thank you!