Management

 View Only
last person joined: 23 days ago 

Ask questions and share experiences with Junos Space and network management.
  • 1.  scripting request system storage cleanup

    Posted 11-17-2022 09:50
    For scripting the command "request system storage cleanup" how do i pass yes for the confirmation on "Do you want to proceed?"

    ------------------------------
    MARK JOHNS
    ------------------------------


  • 2.  RE: scripting request system storage cleanup

     
    Posted 23 days ago
    An example for a SLAX script for Junos Space (I believe that this is what you are using).  If you require other examples, just drop a message and we can try to help you.

    version 1.2;
    
    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";
    
    /* Junos Space annotations */
    /* @CONTEXT = "/device" */
    /* @NAME = "Clean storage" */
    /* @DESCRIPTION = "clean storage on selected device" */
    /* @ISLOCAL = "true" */
    
    main <op-script-results> {
        /* open connection */
        var $connection = jcs:open();
    
        var $rpc = <request-system-storage-cleanup> {
            <no-confirm>;
        }
        var $results = jcs:execute($connection, $rpc);
        /* output block */
        <output> {
            uexpr $results;
        }
    
        /* close connection */
        var $closeResult = jcs:close ( $connection );
    }​


    ------------------------------
    Andy Sharp
    ------------------------------