[192056] in North American Network Operators' Group
Re: A perl script to convert Cisco IOS/Nexus/ASA configurations to
daemon@ATHENA.MIT.EDU (shawn wilson)
Wed Oct 12 21:23:05 2016
X-Original-To: nanog@nanog.org
In-Reply-To: <CAD8GWstkWXR8qJ9Qk30R+OOppNZLKVq_frpUtCL2h+wzAasEaQ@mail.gmail.com>
From: shawn wilson <ag4ve.us@gmail.com>
Date: Wed, 12 Oct 2016 21:23:01 -0400
To: Lee <ler762@gmail.com>
Cc: North American Network Operators Group <nanog@nanog.org>
Errors-To: nanog-bounces@nanog.org
Cpan? Cpan minus? Or just download [1] and there's probably a Make::Maker
or similar Build.PL to build a makefile or just install it for you -
there's a #perl channel on freenode if you need more and Google doesn't get
you set.
1.
http://search.cpan.org/~chromatic/Modern-Perl-1.20161005/lib/Modern/Perl.pm
On Oct 12, 2016 8:02 PM, "Lee" <ler762@gmail.com> wrote:
> On 10/12/16, Jason Hellenthal <jhellenthal@dataix.net> wrote:
> > Give these a shot. https://github.com/jlmcgraw/networkUtilities
> >
> > I know J could use a little feedback on those as well but all in all th=
ey
> > are pretty solid.
>
> Where does one get Modern/Perl.pm ?
>
> Can't locate Modern/Perl.pm in @INC (you may need to install the
> Modern::Perl module) (@INC contains: /tmp/local/lib/perl5
> /usr/lib/perl5/site_perl/5.22/i686-cygwin-threads-64int
> /usr/lib/perl5/site_perl/5.22
> /usr/lib/perl5/vendor_perl/5.22/i686-cygwin-threads-64int
> /usr/lib/perl5/vendor_perl/5.22
> /usr/lib/perl5/5.22/i686-cygwin-threads-64int /usr/lib/perl5/5.22 .)
> at /tmp/iosToHtml.pl line 87.
> BEGIN failed--compilation aborted at /tmp/iosToHtml.pl line 87.
>
> Lee
>
>
>
> >
> >> On Oct 11, 2016, at 08:48, Lee <ler762@gmail.com> wrote:
> >>
> >> On 10/10/16, Jay Hennigan <jay@west.net> wrote:
> >>> On 10/6/16 1:26 PM, Jesse McGraw wrote:
> >>>> Nanog,
> >>>>
> >>>> (This is me scratching an itch of my own and hoping that sharing =
it
> >>>> might be useful to others on this list. Apologies if it isn't)
> >>>>
> >>>> When I'm trying to comprehend a new or complicated Cisco router,
> >>>> switch or firewall configuration an old pet-peeve of mine is how
> >>>> needlessly difficult it is to follow deeply nested logic in
> route-maps,
> >>>> ACLs, QoS policy-maps etc etc
> >>>>
> >>>> To make this a bit simpler I=E2=80=99ve been working on a perl scrip=
t to
> >>>> convert
> >>>> these text-based configuration files into HTML with links between th=
e
> >>>> different elements (e.g. To an access-list from the interface where
> >>>> it=E2=80=99s
> >>>> applied, from policy-maps to class-maps etc), hopefully making it
> >>>> easier
> >>>> to to follow the chain of logic via clicking links and using the
> >>>> forward
> >>>> and back buttons in your browser to go back and forth between comman=
d
> >>>> and referenced list.
> >>>
> >>> Way cool. Now to hook it into RANCID....
> >>
> >> It looks like what I did in 2.3.8 should still work - control_rancid
> >> puts the diff output into $TMP.diff so add this bit:
> >> grep "^Index: " $TMP.diff | awk '/^Index: configs/{
> >> if ( ! got1 ) { printf("/usr/local/bin/myscript.sh "); got1=3D1; }
> >> printf("%s ", $2)
> >> }
> >> END{ printf("\n") }
> >> ' >$TMP.doit
> >> /bin/sh $TMP.doit >$TMP.out
> >> if [ -s $TMP.out ] ; then
> >> .. send mail / whatever
> >> rm $TMP.doit $TMP.out
> >> fi
> >>
> >> Regards,
> >> Lee
> >
> >
> > --
> > Jason Hellenthal
> > JJH48-ARIN
>