[j-nsp] Junoscript API
Richard A Steenbergen
ras at e-gerbil.net
Thu Jun 15 20:40:10 EDT 2006
Has anyone done any work with using junoscript/netconf while handling
large datasets? I'm currently trying to use the perl API (ick) interface
provided by Juniper just to do a "show route receive-protocol bgp x.x.x.x
detail table inet.0", but I'm encountering some pretty absurd memory
requirements.
For example, receiving a full transit table of approx 180k routes consumes
around 900MB of memory. I know XML sucks hairy donkey balls and all, but
900MB seems a little excessive even for poorly encoded XML and a crappy
implementation. In the interests of laziness (and not having to redo this
API with SAX instead of DOM), I'm wondering if this is something that
other people have encountered and dealt with or not? :)
Just doing:
my %queryargs = (
"receive-protocol-name" => "bgp",
"peer" => "x.x.x.x",
"table" => "inet.0",
"detail" => 1
);
my $doc = $jnx->get_route_information(%queryargs);
An example of the returned data for a single route (I recommend skipping
over that as-path tag if you've just eatten lunch):
<rt junos:style="bgp-detail">
<rt-destination>x.x.x.x</rt-destination>
<rt-prefix-length>17</rt-prefix-length>
<rt-entry-count junos:format="9 entries">9</rt-entry-count>
<rt-announced-count>1</rt-announced-count>
<rt-state>OnList NoChange</rt-state>
<rt-entry>
<active-tag> </active-tag>
<protocol-name>BGP</protocol-name>
<nh>
<to>x.x.x.x</to>
</nh>
<as-path>701 1239 4323 13471 I (Originator) Cluster list: 64.142.1.30 Originator ID: 64.142.1.33</as-path>
<communities>
<community>2152:25664</community>
<community>2152:65298</community>
<community>2152:65436</community>
<community>2152:65438</community>
<community>2152:65439</community>
<community>2152:65498</community>
<community>2152:65511</community>
<community>2153:65418</community>
<community>2153:65436</community>
<community>2153:65438</community>
</communities>
</rt-entry>
</rt>
--
Richard A Steenbergen <ras at e-gerbil.net> http://www.e-gerbil.net/ras
GPG Key ID: 0xF8B12CBC (7535 7F59 8204 ED1F CC1C 53AF 4C41 5ECA F8B1 2CBC)
More information about the juniper-nsp
mailing list