Setup guide
Monitor action with do argument can also be called directly from scripts. It will not print anything
then, just execute the given script.
Names of properties that can be accessed by get are the same as shown by print action, plus names
of item flags (like the disabled in the example below). You can use [tab] key completions to see
what properties any particular get action can return.
Example
In the example below monitor action will execute given script each time it prints stats on the
screen, and it will assign all printed values to local variables with the same name:
[admin@Wandy] interface> monitor-traffic ether2 once do={:environment print}
received-packets-per-second: 0
received-bits-per-second: 0bps
sent-packets-per-second: 0
sent-bits-per-second: 0bps
Global Variables
i=1
Local Variables
sent-bits-per-second=0
received-packets-per-second=0
received-bits-per-second=0
sent-packets-per-second=0
[admin@Wandy] interface>
Additional Features
Description
It is possible to include comments in console scripts. If script line starts with '#', all characters until
newline are ignored.
It is possible to put multiple commands on a single line, separating them by ';'. Console treats ';' as
end of line when separating script text into commands.
If you want to use any of {}[]"'\$ characters in a string, you have to prefix them with '\' character.
Console takes any character following '\' literally, without assigning any special meaning to it,
except for such cases:
\a bell (alarm), character code 7
\b backspace, character code 8
\f form feed, character code 12
\n newline, character code 10
\r carriage return, character code 13
\t tabulation, character code 9
\v vertical tabulation, character code 11
\_ space, character code 32
Note that '\', followed by any amount of whitespace characters (spaces, newlines, carriage returns,
tabulations), followed by newline is treated as a single whitespace, except inside quotes, where it is
treated as nothing. This is used by console to break up long lines in scripts generated by export
commands.
Scripts