Automation

last person joined: yesterday 

Ask questions and share experiences about Apstra, Paragon, and all things network automation.
  • 1.  Error when commit event script

    Posted 09-23-2013 03:16

    Hi all,

    When i commit my script, it got error prevent i commit.

    Here are the error meassage:

     

    datnt11@juniper# show | compare 
    [edit]
    +  event-options {
    +      generate-event {
    +          every-minute time-interval 60;
    +      }
    +      policy check-port-b2b-subscriber {
    +          events every-minute;
    +          then {
    +              event-script check-port-b2b-subscriber.slax;
    +          }
    +      }
    +      event-script {
    +          file check-port-b2b-subscriber.slax;
    +      }
    +  }
    
    {master}[edit]
    datnt11@juniper# commit check 
    re1: 
    configuration check succeeds
    re0: 
    error: invalid filename: /var/db/scripts/event//check-port-b2b-subscriber.slax
    error: Reading the configuration from event scripts failed
    error: configuration check-out failed
    re1: 
    error: remote commit-configuration failed on re0
    
    

     here are the script:

    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";
    
    match / {
    	<op-script-results> {
    	var $cmd = <command> "show subscribers summary port";
        var $results = jcs:invoke($cmd);
    	
    	var $kq = {
    		for-each ( $results/counters/port-name ) {
    			expr . _ " " _ ./following-sibling::port-count _ " ";
    		}
    	}
    	
    	var $rpc = <request-snmp-utility-mib-set> {
               <object-type> "string";
               <instance> "subscriber_b2b";
    	    <object-value> $kq;
            }
    
        var $res = jcs:invoke($rpc);
    	
    	
    	}
    }

    Can anyone tell me how can i do to slove this problem?



  • 2.  RE: Error when commit event script

    Posted 09-23-2013 09:21

    Make sure your event script is stored in /var/run/scripts/event rather than /var/run/scripts/op

     

     



  • 3.  RE: Error when commit event script

    Posted 09-23-2013 09:48

    Hi CCall,

    I store script in /var/db/scripts/event/ and /var/db/scripts/event/ but it still not work

    datnt11@juniper> file list /var/run/scripts/event/
    /var/run/scripts/event/:
    check-port-b2b-subscriber.slax
    {master}
    datnt11@juniper> file list /var/db/scripts/event/
    /var/db/scripts/event/:
    check-port-b2b-subscriber.slax

     



  • 4.  RE: Error when commit event script
    Best Answer

    Posted 09-23-2013 09:52

    On both re0 and re1? It looks like re1 has the file but re0 does not.



  • 5.  RE: Error when commit event script

    Posted 09-23-2013 10:01

    After i copy the script into re0. I commit without error.

    Thank you very  much!