[j-nsp] TEXT->XML, XML examples?

Per Ole Klemetsrud perole at kirurg.org
Mon Nov 6 12:56:43 EST 2006


The junoscript api perl client
(https://www.juniper.net/support/xml/junoscript/archive.html), includes a 
script called get_config.pl that does what you want, almost.  That is, it 
logs onto the router and saves the config as an XML file.  You can also 
use "|display xml" on most commands from the CLI, including show config 
if you're just playing around.

=) PO

On Mon, 6 Nov 2006, Pekka Savola wrote:

> Hi,
>
> I'm looking for an example (perl?) script that takes a text JunOS
> config and 1) spits it out in XML, and 2) parses the XML for further
> processing.  I've done quite a bit of looking around, but haven't
> found one yet. The examples in 'junoscript-perl-6.4I0' may be able to
> do 2), but I didn't see them do 1).
>
> As a bonus, I'd also like simple examples of scripts that perform some
> configuration checks something like the commit scripts but offline,
> based on text configs.  In the past I've done this using grep, perl
> and friends w/ the text config, but using XML natively might be the
> way to go if doing so is simple enough...
>
> Pointers welcome.
>
>


More information about the juniper-nsp mailing list