Setting up Juniper junos command aliases

At command prompt, create the file:

root@lab-SRX% vi /var/db/scripts/op/sit.slax

version 1.0;
ns junos = "*/junos";
ns xnm = "";
ns jcs = "";

import "../import/junos.xsl";

match / {

                var $cmd =  'show interfaces terse';
                var $out = jcs:invoke($cmd);
                copy-of ($out);

Edit configuration to activate the script:

set system scripts op file sit.slax

Run the alias at CLI:

root@lab-SRX> op sit
<< output of show interfaces terse >>

See more Juniper automation at:

This entry was posted in Networking. Bookmark the permalink.