summaryrefslogtreecommitdiff
path: root/lib/oxidized/nodes.rb
AgeCommit message (Collapse)Author
2015-02-21Force new job if too long since last jobSaku Ytti
MAX_INTER_JOB_GAP is now 300s, if latest job was started 300s ago, we add new job. Ratioanele is that if we want n jobs, and all these jobs are taking very very long, or perhaps hanging, then we are blocking everything else too. Consider you have use one job, because it's enough to meet your rotation interval quota. Then some one box is somehow taking tens of minutes or hours, we won't figure out new amount of workers until it finishes, so we're blocking all other jobs from spawning. I'm not super happy about this solution, not really sure what is the right wayt to tackle it.
2014-08-25Return true if node_want is nilJari Salo
- Otherwise all nodes can not be loaded.
2014-08-25Match IP address explicitlyJari Salo
- New method node_want? - Don't match node to node[:name] if node[:name] is an ip address. Otherwise we might match to wrong ip address.
2014-08-16Closes #32Saku Ytti
2014-07-04match node[:name] to ipSaku Ytti
When running Oxidized via oxidized-script you want just one node, and you specify that as Nodes.new(:node=>x) however as router.db usually lacks 'ip' field, and only has 'name' field'. If you have router.db with IP in 'name' field, and you do Nodes.new(:node='192.0.2.1') it won't return anything, as '192.0.2.1' is matched against node[:ip] which does not exist. This change makes IP match against IP and Name.
2014-05-07Save stats/last status during Nodes#load0.0.58Saku Ytti
We probably should just axe Node#last, as Node#stats contains all it does and more. However it would need changing web views and I'm too lazy for that right now. Perhaps Nodes/Node also needs some unique ID so two instances of Nodes can be compared exactly. Right now copying the old stats relies on name being identical, but can we trust name to be unique? Even with groups support?
2014-04-22we can't lock 'del', it's called from locked 'next'0.0.55Saku Ytti
2014-04-22missing paranthesisSaku Ytti
2014-04-22more work to fix issue shown in 09dfc11b5dfdSaku Ytti
2014-04-22potential fix to race conditionSaku Ytti
1) ssh fails 2) user clicks 'update' 3) node is reset and moved head of queue 4) telnet fails 5) node last time is set to current net result, head of queue will block until interval has passed, even though below head there are nodes which need to be processed.
2014-04-14Use 'asetus' for configuration filesSaku Ytti
Main benefits a) we get support for system wide configs b) we don't use symbols in config file, they're confusing to non-rubyist
2014-04-13IOS prompt now matches in config modeSaku Ytti
2014-04-13Subclass all errors from OxidizedErrorSaku Ytti
2014-04-13smarter match for IP address in nodesSaku Ytti
- add 'connnected?' method to ssh/telnet to query if or not we're connected - subclass OxidizedError from StandardError, all future OxidizedErrors should be subclasssed from this.
2014-04-12enable loading subset of all nodesSaku Ytti
potential use in perhaps upcoming CLI: [fisakytt@lan-login1 ~/projects/oxidized-cli]% ./oxi S-2250219.fi.cpe.tdc.net 'show ver' Dec 2 2009 00:19:01 Q.11.25 106 [fisakytt@lan-login1 ~/projects/oxidized-cli]% ./oxi 62.236.123.197 'show ver' Cisco IOS Software, C3560 Software (C3560-IPBASEK9-M), Version 12.2(55)SE1, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2010 by Cisco Systems, Inc. Compiled Thu 02-Dec-10 07:16 by prod_rel_team Image text-base: 0x01000000, data-base: 0x02D00000 ROM: Bootstrap program is C3560 boot loader BOOTLDR: C3560 Boot Loader (C3560-HBOOT-M) Version 12.2(35r)SE2, RELEASE SOFTWARE (fc1) S-1035880.fi uptime is 7 weeks, 3 days, 15 hours, 43 minutes System returned to ROM by power-on System restarted at 00:54:59 UTC Wed Feb 19 2014 System image file is "flash:c3560-ipbasek9-mz.122-55.SE1.bin" This product contains cryptographic features and is subject to United States and local country laws governing import, export, transfer and use. Delivery of Cisco cryptographic products does not imply third-party authority to import, export, distribute or use encryption. Importers, exporters, distributors and users are responsible for compliance with U.S. and local country laws. By using this product you agree to comply with applicable laws and regulations. If you are unable to comply with U.S. and local laws, return this product immediately. A summary of U.S. laws governing Cisco cryptographic products may be found at: http://www.cisco.com/wwl/export/crypto/tool/stqrg.html If you require further assistance please contact us by sending email to export@cisco.com. cisco WS-C3560-8PC (PowerPC405) processor (revision F0) with 131072K bytes of memory. Processor board ID FOC1449W2ZU Last reset from power-on 2 Virtual Ethernet interfaces 8 FastEthernet interfaces 1 Gigabit Ethernet interface The password-recovery mechanism is enabled. 512K bytes of flash-simulated non-volatile configuration memory. Base ethernet MAC Address : 10:8C:CF:F0:68:80 Motherboard assembly number : 73-10612-09 Power supply part number : 341-0207-02 Motherboard serial number : FOC14493DDW Power supply serial number : LIT14430ZXA Model revision number : F0 Motherboard revision number : A0 Model number : WS-C3560-8PC-S System serial number : FOC1449W2ZU Top Assembly Part Number : 800-28131-04 Top Assembly Revision Number : C0 Version ID : V04 CLEI Code Number : COML900ARA Hardware Board Revision Number : 0x01 Switch Ports Model SW Version SW Image ------ ----- ----- ---------- ---------- * 1 9 WS-C3560-8PC 12.2(55)SE1 C3560-IPBASEK9-M Configuration register is 0xF [fisakytt@lan-login1 ~/projects/oxidized-cli]% cat oxi require 'pry' require 'pp' require 'oxidized' require 'resolv' module Oxidized class Oxi def cmd command @model.cmd command end def disconnect @input.disconnect_cli end alias_method :close, :disconnect private def initialize node Oxidized.mgr = Manager.new @node = Nodes.new(:node=>node).first @model = @node.model @input = nil connect if block_given? yield self disconnect end end def connect @node.input.each do |input| begin @node.model.input = input.new @node.model.input.connect @node break rescue end end @input = @node.model.input @input.connect_cli end end end Oxidized::Oxi.new(ARGV[0]) do |cli| puts cli.cmd ARGV[1] end [fisakytt@lan-login1 ~/projects/oxidized-cli]% ls -la total 12 drwxrwxr-x 2 fisakytt fisakytt 4096 Apr 12 19:39 . drwxrwxr-x 7 fisakytt fisakytt 4096 Apr 12 17:52 .. -rwxr-xr-x 1 fisakytt fisakytt 820 Apr 12 19:39 oxi
2014-03-28rescue unresolvable namesSaku Ytti
2014-03-13modified worker to work on a node only once per intervalAnton Aksola
2014-03-02Change dynamic loadingSaku Ytti
If we use assignment method (#method=) we don't get return value, so we never know that manager fails to load. Also we do not want to rescue failures of input/output/source loading, they are catastrophic and should fail whole process, loading of model is not catastrophic.
2014-02-28Remove useless initializationSaku Ytti
2014-02-28Rescue all StandardError from modulesSaku Ytti
If module crashes with unexpected error class, rescue it, and write it backtrace Also log if unknown model is attempted instead of crash
2014-02-25Remove Mutex#owned? It is incompatible with 1.9.3Saku Ytti
I didn't like that solution anyhow, but wasn't sure my locked methods are not calling other external locked methods. That shouldn't be the case so synchronize should work.
2014-02-23Migrate to sinatra/puma from webrickSaku Ytti
As I can't do IO#select on sinatra/puma to run it when I have time, I have to run it on separate thread. This means Nodes container needs to be thread safe, it now has ghetto mutex locking, but I probably need to be be more focused what are the external methods that can be called and wrap those in @mutex.synchronize Provide also HTML UI not just JSON for ghetto UI to people who don't want to integrate
2013-10-25Fix fetch methodSaku Ytti
2013-10-15enhance fetch supportnopedial
2013-10-14implement fetch into output modelnopedial
2013-04-20Example of Syslog triggered fetchSaku Ytti
'syslog.rb' listed to UDP port (or reads file). When IOS or JunOS style config change/commit message is seen, it triggers immediate update ot config It transports commit message (junos) remote host from which change was mde (ios) and who made the change (junos+ios). This is carried over to the 'output' methods, that is, 'git blame' will show IOS/JunOS user-name who made the change.
2013-04-19Add restful APISaku Ytti
2013-04-17Initial commitSaku Ytti
Silly for shit-and-giggles attempt at rancid