N
N
nak-alexey2021-01-07 12:17:12
Mikrotik
nak-alexey, 2021-01-07 12:17:12

Variables in MikroTik?

Hello. In the DHCP ALert script, I create a global variable :global var1;and assign it the found MAC address :set var1 $"mac-address". Then I call the script that contains ( see below )

:global var1;
:global var2;
:set var2 ([/system ssh-exec address=адрес user=пользователь command="команда $var1" as-value]->"output");
.
The script has the following rights ( see below )
5ff6cea6d50d1157667022.png
In this case, the value of the variable var2remains empty. But if I create a global variable in the console :global var1, assign it a MAC address ( absolutely the same ), then the variable var2will contain the value returned by the SSH server.

In both cases, in ( see below )
5ff6cde8419b6385085936.png
, the variable var1contains the same value of the MAC address , and the same value of the variable is sent to the server.

Help to understand please.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question