Junos OS

last person joined: 7 days ago 

Ask questions and share experiences about Junos OS.
  • 1.  Syntax error when trying to enable a slax script

    Posted 03-03-2016 07:16

    Hi all,

    I am learning how to use slax scripts and I am a bvery beginner user.

    I am reading the "Applying Junos Automation" ebook  and I am trying to run my first "Hello World" script but I got a problem while I register the script.

    Could you help me understanding what is wrong?

     

     

    Thank You

     

    Regards

     

     

     

    root@SWServer:RE:0% cat hello_world.slax
    version 1.0;

    ns junos = "http://xml.juniper.net/junos/*/junos";
    ns xnm = "http://xml.juniper.net/xnm/1.1/xnm";
    ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0";

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

    match / {
    <op-script-results> {
    <output> "Hello World!";
    }
    }

    root@SWServer:RE:0% set system scripts op file hello_world.slax
    set: Syntax Error.



  • 2.  RE: Syntax error when trying to enable a slax script
    Best Answer

    Posted 03-03-2016 07:49

    Hello,

     


    @mauog wrote:

     

    root@SWServer:RE:0% set system scripts op file hello_world.slax
    set: Syntax Error.


    You are trying to configure SLAX script from FreeBSD shell. This is not supported.

    First, please copy Your script file to /var/db/scripts/op directory on BOTH RE if You have 2.

    Then please enter JUNOS CLI

     

    root@SWServer:RE:0%> cli

     

    and execute the following:

     

    > edit
    # set system scripts op file hello_world.slax
    # commit and-quit

    HTH

    Thx

    Alex