Hello. I want to get pptp connection status information (connected, disconnected, terminating…). I send the command “Interface / pptp-client / monitor”, and in response I get “no such command prefix”. After the command “/ interface / print” I can’t find the information I need. Can you please tell me which command will give me this information?
I’m not quite sure what information you’re after. If your MikroTik is running as a PPTP server then try the command:
/interface pptp-server print
Otherwise, if your MikroTik is running as a PPTP client, try:
/interface pptp-client print
I hope this gives you the information you’re after.
the command “/ interface / pptp-client / print” shows this. but there is no connection status information.

!re=
=.id=*D
=name=pptp-out_HMN
=max-mtu=1450
=max-mru=1450
=mrru=disabled
=connect-to=198.50.183.??
=user=89258560952???
=password=37??
=profile=default-encryption
=keepalive-timeout=60
=use-peer-dns=no
=add-default-route=true
=default-route-distance=10
=dial-on-demand=false
=allow=pap,chap,mschap1,mschap2
=running=true
=disabled=false
=comment=HMN
in the terminal the command “/ interface pptp-client monitor 0” gives me the information I need. How to redo for api request?
I just did a quick search and this link might help. The relevant part appears to be:
/interface pptp-client print detail
NB: The detail after the print.
Unfortunately, I don’t have a running system to test it on at the moment.
Which ROS version are you using ?
From the message I assume you are running this from a script ?
There should also be a number to indicate which entry you want to monitor.
E.g. “/interface pptp-client monitor 0”, that will show a constant monitoring for that entry.
Use “/interface pptp-client monitor 0 once” to have it monitor, well… once. For scripting purposes.
If you have multiple entries, you need to use find to get the right one.
Surely there will be other and more elegant solutions then my crude suggestions.
ROS v6.49
I’m trying to use this instruction “https://wiki.mikrotik.com/wiki/Manual:API”
I don’t understand how the command syntax “/ interface pptp-client monitor 0” will be correct
In terminal it will work.
For scripting you need to add “once” since the script will not be able to handle the continuous info coming back.
That’s why it only has to run ONCE.
/interface pptp-client monitor 0 once
API is another thing …
(never done any API programming but have programmed in quite some languages in the past, so I can understand most of what I see
)
Terminal / scripting / API are 3 (related but different) things.
For API only /interface/pptp-client/print will work, as in : give you the required info.
Check this:
https://github.com/nunenuh/mikrotik-api/blob/master/src/MikrotikAPI/Commands/Interfaces/PPTPClient.php
This piece of code should point you in the right direction, I think
/**
* This method used for detail interface pptp-client
* @param type $id string
* @return type array
*/
public function detail($id) {
$sentence = new SentenceUtil();
$sentence->fromCommand("/interface/pptp-client/print");
$sentence->where(".id", "=", $id);
$this->talker->send($sentence);
$rs = $this->talker->getResult();
$i = 0;
if ($i < $rs->size()) {
return $rs->getResultArray();
} else {
return "No Interface PPTP Client With This id = " . $id;
}
}
still it doesn’t work
>>> /interface/pptp-client/monitor
>>> =.id=pptp-out1
>>> =once=
<<< !re
<<< =status=disconnected
<<<
<<< !done
<<<
>>> /quit
<<< !fatal
<<< session terminated on request
<<<
Thanks a lot!!! May God grant you even more health!