[nmstools-cvs] src/bin mpls_collect_vpn_rt.pl.in,NONE,1.1
Brought to you by:
ssinyagin
|
From: Michel H. <mi...@us...> - 2002-11-19 14:47:19
|
Update of /cvsroot/nmstools/src/bin
In directory sc8-pr-cvs1:/tmp/cvs-serv18446
Added Files:
mpls_collect_vpn_rt.pl.in
Log Message:
initial import
--- NEW FILE: mpls_collect_vpn_rt.pl.in ---
#!%%PERL%%
#
# NMSTOOLS -- NMS Helper Tools
# $Id: mpls_collect_vpn_rt.pl.in,v 1.1 2002/11/19 14:47:12 mihahn Exp $
#
# Author: Michel Hahne <morangie at bluemail dot ch>
# Copyright (C) 2001, 2002 Fault Correction and Maintenance, Cablecom GmbH
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Revision history:
# $Log: mpls_collect_vpn_rt.pl.in,v $
# Revision 1.1 2002/11/19 14:47:12 mihahn
# initial import
#
require '%%NMSTOOLS_HOME%%/lib/lib_nmstools.pl';
$Expect::Log_Stdout=1;
nms_readconfig('devlogin');
$vpn = $ARGV[0];
my $seednode = $nms_config{'env'}{'DATA'} . '/mpls/rr_seed';
$workingdir = $nms_config{'env'}{'DATA'} . '/mpls';
$rt_vpnint1_outfile = $workingdir . '/rt_vrf_' . $vpn;
#Enumerate nodes and collect information
nms_enumnodes( $seednode, \&cb_collectall );
sub cb_collectall
{
my ($telnet, $node, $hostname) = @_;
# Get "sh running" report
$telnet->log_file($rt_vpnint1_outfile, "w");
printf $telnet ("show ip route vrf " . $vpn . "\r", $_);
$telnet->expect(60, '-re', '\n\w+\#');
$telnet->log_file(undef);
}
|