Hi all,
Is it possible to get the runtime information via script?
For example, get the remote ipv6 address of the pppoe client interface:

Thanks.
Hello! Yes, it is possible with the next script, as an example I used the local address:
:local text1 "IP: $[put [([interface pppoe-client monitor DIGI once as-value]->"local-address")]]"
You can change the “local-address” with any other value, example: “mtu”, “uptime”, etc. Also, change “DIGI” with your pppoe client interface name, mine is named DIGI, yours could be pppoe-out1 if you didn’t changed it.
If you want to execute this via SSH, you need to replace the $[put with :put, for example:
:put [([interface pppoe-client monitor DIGI once as-value]->"local-address")]]
The result will be:
[admin@MikroTik] > :put [([interface pppoe-client monitor DIGI once as-value]->"local-address")]]
79.119.XXX.XXX -> my public IP address
[admin@MikroTik] >
Also, you can use the text in another command withtin the same script via “$text1”, for example, you can get the IP address and use it in a DDNS service that has ip update via url with the fetch tool.
This is exactly what i want, thank you so much.
I found that the execution in the script can be simplified to:
:local text1 "IP: $[([interface pppoe-client monitor DIGI once as-value]->"local-address")]"
or
:local text1 [([interface pppoe-client monitor DIGI once as-value]->"local-address")]