A
A
angel_on2017-01-26 13:05:40
Mikrotik
angel_on, 2017-01-26 13:05:40

How to know the status?

Good day everyone!
Started writing scripts. I would very much like to write a script so that it writes the status of the VPN connection of the interface to a variable. For example, if you enter "/interface ovpn-server monitor ovpn1" in the command line, then a table with parameters and their readings will be displayed in the terminal. I'm interested in one of the "status" parameters, it has two values ​​"connected" and "disabled". Actually, the question is, is it possible to request only this parameter?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Romanov, 2017-01-27
@angel_on

/interface l2tp-client monitor l2tp-out1 once do={:global STATUS $"status"}

It if without declaration of a variable. If you first declare, then the design changes slightly:
:global STATUS
/interface l2tp-client monitor l2tp-out1 once do={:set STATUS $"status"}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question