EXOS: UPM Script - port number in log message
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎03-12-2018 07:04 PM
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 ?
#
# 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
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎03-15-2018 12:17 PM
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 !
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 !
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎03-13-2018 07:04 AM
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
* 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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎03-13-2018 07:04 AM
Thanks for that advice - not nice but it works!
Regards
Regards
