A perl script to convert Cisco IOS/Nexus/ASA configurations to HTML for easier comprehension

Jesse McGraw jlmcgraw at gmail.com
Thu Oct 13 17:04:33 UTC 2016


Lee,

   FWIW, the script will work under straight Windows and I use it there 
frequently.

I think Strawberry perl comes with cpanm (cpanminus) pre-installed so 
you can do:

     "cpanm Carton"

and then cd to wherever you've got the script saved and do:

     "carton install"

to install the dependencies


Or, if you've got a set of configs with nothing sensitive/private left 
in them, try the simple web version I set up:

https://hidden-waters-8218.herokuapp.com/



If I had a Windows VM setup I'd come up with a setup.bat

On 10/13/2016 12:38 PM, Lee wrote:
> On 10/13/16, Jesse McGraw <jlmcgraw at gmail.com> wrote:
>> Lee,
>>
>>     Check out the setup.sh script, hopefully it does everything necessary
>> to get the script working on a Debian-derived Linux system
> I'm using Windows + Cygwin; maybe it's just that I don't have them
> installed, but there is no sudo or apt so setup.sh isn't going to work
> for me.  So while I was interested in seeing what this bit looked like
>> If you run it against multiple configuration files at once it will also attempt to link
>> between them when applicable (e.g. BGP neighbors, route next hops, interfaces
>> on the same subnet etc).
> I'm not willing to take any more time on this.
>
> I appreciate all the people who've tried to help but at least for now, I'm done.
>
> Thanks,
> Lee
>
>
>> I've attempted to make the only globally-installed dependencies be cpanm
>> and carton.  Once those are installed it uses carton to install the
>> dependencies locally
>>
>>
>> On 10/12/2016 07:59 PM, Lee wrote:
>>> On 10/12/16, Jason Hellenthal <jhellenthal at 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
>>>> they
>>>> 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 at gmail.com> wrote:
>>>>>
>>>>> On 10/10/16, Jay Hennigan <jay at 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’ve been working on a perl script to
>>>>>>> convert
>>>>>>> these text-based configuration files into HTML with links between the
>>>>>>> different elements (e.g. To an access-list from the interface where
>>>>>>> it’s
>>>>>>> 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 command
>>>>>>> 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=1; }
>>>>> 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
>>> .
>>>
>>




More information about the NANOG mailing list