ExtremeSwitching (EXOS)

Expand all | Collapse all

EXOS: UPM Script - port number in log message

  • 1.  EXOS: UPM Script - port number in log message

    Posted 03-12-2018 19:04
    Today i play around with a UPM Script which refresh nodealias table after a port link down.
    #
    # Module upm configuration.
    #
    create upm profile clear-nodealias
    create log message Starting_Script_clear-nodealias
    clear nodealias port $EVENT.LOG_PARAM_0
    create log message Finishing_Script_clear-nodealias

    .
    #[/code]Here is the log output if the script runs successfully:
    03/12/2018 18:35:43.95 [i] Finishing_Script_clear-nodealias
    03/12/2018 18:35:43.94 [i] Starting_Script_clear-nodealias
    03/12/2018 18:35:43.85


  • 2.  RE: EXOS: UPM Script - port number in log message

    Posted 03-13-2018 07:04
    The spaces in your log message makes the command wrong.
    * Slot-1 SWTCORE1.2 # create log message test 123
    ^
    %% Invalid input detected at '^' marker.
    * Slot-1 SWTCORE1.3 # create log message "test 123"
    * Slot-1 SWTCORE1.4 #

    However, using a variable inside "" does not seem to work.

    Slot-1 SWTCORE1.5 # set var port "1:1"
    * Slot-1 SWTCORE1.6 # show var port
    1:1
    * Slot-1 SWTCORE1.7 # create log message "test port $port"
    * Slot-1 SWTCORE1.8 # sh log
    03/13/2018 10:07:40.37 [i] Slot-1: test port $port

    Using _ instead of spaces and not use quotes makes it possible to use variables but is a bit ugly.
    * Slot-1 SWTCORE1.14 # create log message test_port_$port
    * Slot-1 SWTCORE1.15 # sh log
    03/13/2018 10:10:35.50 [i] Slot-1: test_port_1:1



  • 3.  RE: EXOS: UPM Script - port number in log message

    Posted 03-15-2018 12:17
    you have to end your log message with a normal character to have it to work, for example:

    EXOS-VM.6 # create log message "the port is $ports !"
    EXOS-VM.7 # sh log
    03/15/2018 15:16:34.18 [i] the port is 1:1 !



  • 4.  RE: EXOS: UPM Script - port number in log message

    Posted 03-13-2018 07:04
    Thanks for that advice - not nice but it works!

    Regards