I only need this section then?
/* Shows similar header as seen in show route brief */
template show-route-table-header( $table ) {
var $first-line = $table/table-name _ ": " _ $table/destination-count _
" destinations, " _ $table/total-route-count _ " routes (" _ $table/active-route-count _
" active, " _ $table/holddown-route-count _ " holddown, " _ $table/hidden-route-count _
" hidden)";
var $second-line = "+ = Active Route, - = Last Active, * = Both";
expr jcs:output( "\n", $first-line );
expr jcs:output( $second-line, "\n_\r " );
}
template show-route-table-routes( $table ) {
/* Each route has multiple route entries */
for-each( $table/rt ) {
var $destination = {
if( string-length( ./rt-prefix-length ) ) {
expr ./rt-destination _ "/" _ ./rt-prefix-length;
}
else {
expr ./rt-destination;
}
}
for-each( ./rt-entry ) {
/* Grab the protocol specific lines */
var $lines-rtf = {
if( ./protocol-name == "BGP" ) {
call build-bgp-lines( $route = . );
}
else if( ./protocol-name == "Local" ) {
call build-local-lines( $route = . );
}
else if( ./protocol-name == "Direct" ) {
call build-direct-lines( $route = . );
}
else {
call build-other-lines( $route = . );
}
}
var $lines = ext:node-set( $lines-rtf );
/* First line */
/* Only show destination for first entry */
if( position() == 1 ) {
var $first-line = jcs:printf( "%-20s %s", $destination, $lines/first );
expr jcs:output( $first-line );
}
else {
var $first-line = jcs:printf( "%-20s %s", "", $lines/first );
expr jcs:output( $first-line );
}
/* Second line */
var $second-line = jcs:printf( "%-20s %s", "", $lines/second );
expr jcs:output( $second-line );
if( string-length( $lines/third ) > 0 ) {
var $third-line = jcs:printf( "%-20s %s", "", $lines/third );
expr jcs:output( $third-line );
}
if( string-length( $lines/fourth ) > 0 ) {
var $fourth-line = jcs:printf( "%-20s %s", "", $lines/fourth );
expr jcs:output( $fourth-line );
}
}
}
}
------------------------------
MARK JOHNS
------------------------------
Original Message:
Sent: 01-09-2023 13:24
From: Teodor Adrian Soroceanu
Subject: script or report to list/display route table
Hi Mark,
Under job id you have a button Export CSV:
------------------------------
Teodor Adrian Soroceanu
Original Message:
Sent: 01-09-2023 12:51
From: MARK JOHNS
Subject: script or report to list/display route table
Where is the csv?
------------------------------
MARK JOHNS
Original Message:
Sent: 01-09-2023 12:32
From: Teodor Adrian Soroceanu
Subject: script or report to list/display route table
Hi Mark,
There is an option to put a slax script in Junos Space under - Image and Scripts, for your case you can yous this slax script found_here . Practicaly you stage the script on the device and execute and you will get a csv with the results. Hope this helps.
Thanks,
Adrian.
------------------------------
Teodor Adrian Soroceanu
Original Message:
Sent: 01-09-2023 11:29
From: MARK JOHNS
Subject: script or report to list/display route table
Correct, Junos Space. I want to get the route table on a device and run a report on it or at least get sent/saved somewhere in a readable format.
------------------------------
MARK JOHNS
Original Message:
Sent: 01-09-2023 11:26
From: Teodor Adrian Soroceanu
Subject: script or report to list/display route table
Hi Mark,
Can you please give more insights on what is that you are trying to achieve? And i believe you are talking about Junos Space, right?
Thanks,
Adrian.
------------------------------
Teodor Adrian Soroceanu
Original Message:
Sent: 01-09-2023 11:19
From: MARK JOHNS
Subject: script or report to list/display route table
Is there some way in space to report on the route table for a device or gather the information to at least report on?
------------------------------
MARK JOHNS
------------------------------