EasyManua.ls Logo

MikroTik RouterOS v2.9 - Special Commands

MikroTik RouterOS v2.9
709 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
00:00:00.006
[admin@MikroTik] >
while - executes given console commands repeatedly while the logical conditions is true ( yes | no )
- condition, which is evaluated each time before the execution of enclosed statements ( text ) -
console commands that should be executed repeatedly
[admin@MikroTik] > :set i 0; :while ($i < 10) do={:put $i; :set i ($i + 1)};
0
1
2
3
4
5
6
7
8
9
[admin@MikroTik] >
Special Commands
Description
Monitor
It is possible to access values that are shown by most monitor actions from scripts. A monitor
command that has a do parameter can be supplied either script name (see /system scripts), or
console commands to execute.
Get
Most print commands produce values that are accessible from scripts. Such print commands have
a corresponding get command on the same menu level. The get command accepts one parameter
when working with regular values or two parameters when working with lists.
Notes
Monitor command with do argument can also be called directly from scripts. It will not print
anything then, just execute the given script.
The names of the properties that can be accessed by get are the same as shown by print command,
plus names of item flags (like the disabled in the example below). You can use [T ab] 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@MikroTik] interface> monitor-traffic ether2 once do={:environment print}
received-packets-per-second: 0
received-bits-per-second: 0bps
sent-packets-per-second: 0
Page 644 of 695
Copyright 1999-2007, MikroTik. All rights reserved. Mikrotik, RouterOS and RouterBOARD are trademarks of Mikrotikls SIA.
Other trademarks and registred trademarks mentioned herein are properties of their respective owners.

Table of Contents