diff options
author | ytti <saku@ytti.fi> | 2013-04-27 03:22:49 -0700 |
---|---|---|
committer | ytti <saku@ytti.fi> | 2013-04-27 03:22:49 -0700 |
commit | 7ebf7bee657e518ba4f2bf28febd78b0a189a497 (patch) | |
tree | 7f8881d21f0ff5e2a32e1d759368c85b8428b377 | |
parent | 80f5c733b3b9c1bf0be3bcafbb868574b77c91b2 (diff) | |
parent | e918061848b37c631fa40a52e52f2d7d0f788111 (diff) |
Merge pull request #1 from nopedial/master
Add 'ironware' and 'powerconnect' support
-rw-r--r-- | README.md | 14 | ||||
-rw-r--r-- | lib/oxidized/model/ironware.rb | 32 | ||||
-rw-r--r-- | lib/oxidized/model/powerconnect.rb | 24 |
3 files changed, 63 insertions, 7 deletions
@@ -8,12 +8,12 @@ # Install * early days, but try: - 1 rake build - 1 gem install gem/oxidized* - 1 oxidized - 1 vi ~/.config/oxidized - 1 (maybe point to your rancid/router.db or copy it there) - 1 oxidized + 1. apt-get install libsqlite3-dev + 2. gem install oxidized + 3. oxidized + 4. vi ~/.config/oxidized + 5. (maybe point to your rancid/router.db or copy it there) + 6. oxidized # API ## Input @@ -42,4 +42,4 @@ * can use 'cmd', 'prompt', 'comment', 'cfg' * cfg is executed in input/output/source context * cmd is executed in instance of model - * 'junos' and 'ios' implemented + * 'junos', 'ios', 'ironware' and 'powerconnect' diff --git a/lib/oxidized/model/ironware.rb b/lib/oxidized/model/ironware.rb new file mode 100644 index 0000000..3dd9ef2 --- /dev/null +++ b/lib/oxidized/model/ironware.rb @@ -0,0 +1,32 @@ +class IronWare < Oxidized::Model + + comment '! ' + + cmd :all do |cfg| + cfg.each_line.to_a[1..-3].join + end + + cmd 'show running-config' do |cfg| + cfg = cfg.each_line.to_a[3..-1].join + cfg + end + + cmd 'show version' do |cfg| + comment cfg + end + + cmd 'show chassis' do |cfg| + comment cfg + end + + cfg :telnet do + username /^Username:/ + password /^Password:/ + end + + cfg :telnet, :ssh do + post_login 'terminal length 0' + pre_logout 'exit' + end + +end diff --git a/lib/oxidized/model/powerconnect.rb b/lib/oxidized/model/powerconnect.rb new file mode 100644 index 0000000..7fa7f2c --- /dev/null +++ b/lib/oxidized/model/powerconnect.rb @@ -0,0 +1,24 @@ +class PowerConnect < Oxidized::Model + + comment '! ' + + cmd :all do |cfg| + cfg.each_line.to_a[1..-3].join + end + + cmd 'show running-config' do |cfg| + cfg = cfg.each_line.to_a[3..-1].join + cfg + end + + cfg :telnet do + username /^User Name:/ + password /^\r?Password:/ + end + + cfg :telnet, :ssh do + post_login 'terminal datadump' + pre_logout 'exit' + end + +end |