cancel
Showing results for 
Search instead for 
Did you mean: 

EXOS: UPM Script - port number in log message

EXOS: UPM Script - port number in log message

M_Nees
Contributor III
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

.
#Here is the log output if the script runs successfully:
03/12/2018 18:35:43.95 Finishing_Script_clear-nodealias
03/12/2018 18:35:43.94 Starting_Script_clear-nodealias
03/12/2018 18:35:43.85 Launched profile clear-nodealias for the event log-message
03/12/2018 18:35:43.85 Port 19 link downI want enhance the log message "Starting_Script_clear-nodealias" by the Port Number which part of nodealias table will be cleared.

So i try this:
create log message Starting_Script_clear-nodealias on port $EVENT.LOG_PARAM_0But then UPM Scripts runs successful but this line was not written down to log file.

How can i achieve my goal ?
3 REPLIES 3

Stephane_Grosj1
Extreme Employee
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 the port is 1:1 !

OscarK
Extreme Employee
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 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 Slot-1: test_port_1:1

M_Nees
Contributor III
Thanks for that advice - not nice but it works!

Regards
GTM-P2G8KFN