Executing SLX-OS commands from the Linux shell

  1. To execute an SLX-OS command, enter the Linux cli_run -c command.
    [admUser@SLX]# cli_run -c "show ip interface brief" | grep Port-channel > /tmp/interface
    In the previous example, the output of show ip interface brief is redirected to the /tmp/interface file.
  2. Display the contents of the file to verify the redirection.
    [admUser@SLX]# cat /tmp/interface
    Port-channel 1         unassigned         administratively down     down
    Port-channel 2         unassigned         administratively down     down
  3. To execute a file containing multiple SLX-OS commands, enter the Linux cli_run -f command.
    [admUser@SLX]# cli_run -f /tmp/slxcli_cmd_file > /tmp/newfile
    In this example, slxcli_cmd_file contains the following commands:
    [admUser@SLX]# cat /tmp/slxcli_cmd_file
    show ssh server status
    conf t
    router bgp
    local-as 23
    capability as4-enable
    
    Note

    Note

    Make sure that each command is on a new line.
  4. Display the contents of the target file to verify that it contains the redirected output.
    [admUser@SLX]# cat /tmp/newfile
    Welcome to the Extreme SLX-OS Software
    admin connected from 127.0.0.1 using console on SLX
    SLX# show ssh server status | nomore
    VRF-Name: mgmt-vrf      Status: Enabled
    VRF-Name: default-vrf   Status: Enabled
    device# conf t
    Entering configuration mode terminal
    Current configuration users:
    admin console (cli from 10.70.4.183) on since 2017-01-31 05:49:59 terminal mode
    device(config)# router bgp
    device(config-bgp-router)# local-as 23
    device(config-bgp-router)# capability as4-enable
    device(config-bgp-router)#