cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
793
Views
5
Helpful
1
Replies

How to run Linux shell Script ?

mohisla2
Cisco Employee
Cisco Employee

Hello All, 

 

       I have create a "template-based" service from NSO and it's working fine.. I need to add run a linux Script ("./Action") from the linux machine that is hosting the NSO.. is there any way to this ?

Benefits of this scenario, after apply the Service Template from NSO then I'll be able to do some operations tasks that is already exist using linux shell script ..

 

Thanks,

Islam

1 Reply 1

rogaglia
Cisco Employee
Cisco Employee

You can define an YANG action to call your script.

 

Check the "man tailf_yang_extensions" man page example:

 

    tailf:action reboot {
      tailf:exec '/opt/sys/reboot.sh' {
        tailf:args '-c $(context) -p $(path)';
      }
      input {
        leaf when {
          type enumeration {
            enum now;
            enum 10secs;
            enum 1min;
          }
        }
      }
    }