root/lang/ruby/router-confbot/get-config.rb @ 20368

Revision 10378, 454 bytes (checked in by ihag, 7 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)
6require 'router'
7load "router-list.rb"
8
9
10Routers.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
18end
Note: See TracBrowser for help on using the browser.