First of all, I need to mention that my knowledge of XML is very poor...

That said, I'm a Networking IT guy that work with Cisco, Acatel, Juniper and other vendor equipment on a daily basis. I regularly build perl scripts to interract with configuration files of those vendors and I wonder if XML would be of any help regarding this.

Cisco IOS config files don't really have a real structure that is easily convertible to a XML logical structure. Still, I'm giving it a try in case any one have ever did something intelligent with this type of config.

On the other hand, Alcatel and Juniper configs does have a very well structured output that can easily be converted to an XML format (see examples below).

Here are the questions (well for now...) :

- Is there any existing module that can convert Cisco configs to XML?
- Is there existing module that can convert structure similar to Alcatel or Juniper (again see below) to XML?
- If no sutch module exists, how hard would it be to adapt one to recognize this kind of hierarchy?

My goal here is to try see if any benefits could be acheived by using XML to work with config files instead of doing legacy code all the time.

Alcatel TiMOS example
#-------------------------------------------------- echo "System Configuration" #-------------------------------------------------- system name "HOSTNAME" location "Some location" power-supply 1 dc power-supply 2 dc snmp packet-size 8000 exit login-control ftp inbound-max-sessions 2 exit pre-login-message "Some Message\n" motd url "motd.txt" exit time sntp server-address x.x.x.x no shutdown exit exit thresholds rmon exit exit exit #-------------------------------------------------- ...
Juniper JUNOS Example
system { time-zone America/xxxxxxxx; no-redirects; root-authentication { encrypted-password "Encripted Password"; } tacplus-server { x.x.x.x { secret "password"; timeout 2; source-address x.x.x.x; } } accounting { events [ login change-log ]; destination { tacplus { server { x.x.x.x { secret "password"; timeout 5; source-address x.x.x.x; } } } } } } ...

In reply to Config files To XML by LiNuXaDDiKt

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.