summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2014-04-15Use String subclass in model#cmdSaku Ytti
Will allow convenience methods such as cmd :all do |cfg| cfg.pop.shift end instead of: cmd :all do |cfg| cfg.each_line.to_a[1..-2].join end And what ever convenience configs we come up with
2014-04-15the second to last line isn't always emptySaku Ytti
sh ip bgp | i foo and you won't see empty line before prompt, ergo, we cannot always remove it. But I'm not too surprised JunOS + IOS templates are still mostly exactly the same they were from my testing to see how Oxidized works over year ago, they need rework to be production quality.
2014-04-15Waittime => TimeoutSaku Ytti
Waittime is how long it waits for /more/ input /after/ matching to RE. This has been wrong always in Oxidized but only after changing default timeout to 30, it became apparent. When timeout was 5s, it just gave 5s delay to every command, now it gives 30s delay.
2014-04-15use Asetus#create to create missing config0.0.52Saku Ytti
2014-04-14update to newer asetus version0.0.51Saku Ytti
2014-04-14depend on AsetusSaku Ytti
Change models to Asetus syntax
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-12Don't define enablePW by defaultSaku Ytti
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-04-12allow running post_login separatelySaku Ytti
2014-04-09add model for ALU TiMOSAnton Aksola
tested on SR and SAS routers
2014-04-09add model for AOS7 (Omniswitch 6900/10k)Anton Aksola
supports virtual chassis for OS6900
2014-04-09fix telnet username promptAnton Aksola
2014-04-07minor fixAnton Aksola
2014-04-07add support for non-vdom-enabled environmentsAnton Aksola
2014-04-07add model for Fortinet FortiOS used in Fortigate firewalls. Should workAnton Aksola
at least from version 5 onwards
2014-04-07add ACOS model for A10 AX and Thunder series0.0.44Anton Aksola
2014-04-07pass command string to :all block for (example) to comment a commandAnton Aksola
that was run
2014-03-28comment expects stingSaku Ytti
2014-03-28added AOSW (AOS Wireless / Aruba) supportSaku Ytti
2014-03-28if disconnect_cli does not disconnect us, give upSaku Ytti
If we stay connected on the device (model broken?) give up after timeout, instead of sitting in the model forever
2014-03-28prokurwa may ask to save config, answer 'no'Saku Ytti
2014-03-28\w contains \d and _Saku Ytti
2014-03-28rescue unresolvable namesSaku Ytti
2014-03-21Rescue git timeout, fixes #10Saku Ytti
At least I hope it fixes #10, since I didn't figure out how to introduce 10s I/O latency to confirm.
2014-03-18Be more liberal about username promptSaku Ytti
^\r? was too strict Also move non-config above of config, rancid-style. Also Procurve is unbelievably shitty crapbox, screen drawing is shit, telnet password is maximum 17 chars, ssh password maximum 16 chars, que?
2014-03-17Fix JunOS modelSaku Ytti
Block must return string, it returned nil which broke it. Also coerce type to string in future, so block won't fail so catastrophically, just output missing.
2014-03-14Introduce 'post' and 'pre' commandsSaku Ytti
Both post and pre are called after all 'cmd' are already called, but output from 'pre' is put on top of configuration output and output from 'post' is put on bottom of confguration output. Rationale is dynamic configuration, where you'll only know after running some commands what commands you want to run. Both except blocks, such as pre do # commands to execute end Both can be called multiple times
2014-03-13modified worker to work on a node only once per intervalAnton Aksola
2014-03-07add better formatting to Arista modelSamer Abdel-Hafez
2014-03-07add Arista EOS and Cisco IOS XR modelsSamer Abdel-Hafez
2014-03-05Ignore rogue adhoc alert macsSaku Ytti
They keep changing dynamically in config
2014-03-05Add AireOS supportSaku Ytti
Crappy Cisco WLC 5k, much quality, very implementation, such secure * stop pre_logout from expecting prompt by default
2014-03-03Make node table sortableSaku Ytti
2014-03-02We need 'pp' for webapi /node/xSaku Ytti
2014-03-02Give up after timeout on SSH#expectSaku Ytti
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-03-01Switch from CSS to SASSSaku Ytti
I probably should figure out how to start rack in the code, so I'd get caching of the SASS (and in future Coffee) files, instead of Sinatra generating them always on the fly
2014-03-01Add Model#output methodSaku Ytti
Outputs about what we've seen last in input class. Quite dirty in telnet, so not sure I'm going to support it. Let's see if there is use-case for it.
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-27Slightly less ugly nodes pageSaku Ytti
2014-02-27Redirect / to /nodesSaku Ytti
2014-02-27Switch to syslog instead of fileSaku Ytti
1.9.3 does not have Syslog::Logger so in 1.9.3 keep on logging to files
2014-02-26Switch OpenStruct#to_h to #marshal_dump for 1.9Saku Ytti
1.9 does not have #to_h, unnecessarily breaks compatibility downwards
2014-02-25Fix crashes on missing configSaku Ytti
We now merge user config with bootstrap config ensuring all configuratio options are set even if not in configuratatin. Allowing us to add new configuration options, without needing for users to touch their existing configuration. All default values are still written to user config when ever CFG.save is called, which means when you change your output/input/source models and configuration is missing, instead of just adding the configuration needed for that particular module, it'll save full config to file. Don't really think that is a bug, but might be something to fix later on with maybe parameter to 'save'. Which would load user config, merge it with 'save' argument level and save user config. But unless someone is bothered by it, I won't do it. This commit fixes #1
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.