|
Revision 10378, 454 bytes
(checked in by ihag, 5 years ago)
|
|
propset
|
-
Property svn:executable set to
*
-
Property svn:keywords set to
Id
|
| Line | |
|---|
| 1 | #!/usr/local/bin/ruby |
|---|
| 2 | # Sample script: Collect configurations from routers |
|---|
| 3 | # $Id$ |
|---|
| 4 | |
|---|
| 5 | $LOAD_PATH << File.dirname($0) |
|---|
| 6 | require 'router' |
|---|
| 7 | load "router-list.rb" |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | Routers.each_key do |host| |
|---|
| 11 | file = "#{host}.txt" |
|---|
| 12 | router = Routers[host][:arch].new(host, Routers[host]) |
|---|
| 13 | router.open('Output_log' => file) do |router| |
|---|
| 14 | puts "Getting config from #{router.hostname} (#{router.addr})" |
|---|
| 15 | router.login.enable.no_paging.get_config |
|---|
| 16 | puts " => done." |
|---|
| 17 | end |
|---|
| 18 | end |
|---|