Community discussions

MikroTik App
 
User avatar
Arxondas
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 72
Joined: Sun Aug 02, 2015 12:23 pm
Location: Greece
Contact:

Mikrotik API delete hosts

Sat Jun 23, 2018 11:31 am

Hello all,

I need some help with api command.
I want to delete specific host from /ip hotspot hosts from a php page.
I only know the mac address for the host.

I can connect with api to my mikrotik but need help with the command for the delete
or anything else i can do.

Any help please..


thanks
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: Mikrotik API delete hosts

Sat Jun 23, 2018 2:29 pm

With the client from my signature:
$util = new RouterOS\Util($client = new RouterOS\Client('192.168.88.1', 'admin', 'password'));

$util->setMenu('/ip hotspot host')->remove(RouterOS\Query::where('mac-address', '12:34:56:78:90:12'));
 
User avatar
Arxondas
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 72
Joined: Sun Aug 02, 2015 12:23 pm
Location: Greece
Contact:

Re: Mikrotik API delete hosts

Sat Jun 23, 2018 2:40 pm

Thank you very much..!!

I'll try it asap
 
amardeep704
just joined
Posts: 12
Joined: Thu Sep 20, 2018 1:09 pm

Re: Mikrotik API delete hosts

Mon Sep 16, 2019 1:06 pm

Hi,

I am trying to add/authenticate a device(mac address) using the PEAR2_Net_RouterOS API. Can you please share the details of the arguments that need to be passed or an example?

I have tried the following :

$client->setMenu('/ip hotspot active login')->add(
array(
'user' => 'user1',
'ip' => $_SERVER['REMOTE_ADDR'],
'password' => 'password1',
)
);

Also,

$client->setMenu('/ip hotspot host')->add(
array(
'user' => 'user1',
'ip' => $_SERVER['REMOTE_ADDR'],
'password' => 'password1',
)
);

But I am getting 'no such command' error. Please suggest!

Thanks,
Amardeep
 
amardeep704
just joined
Posts: 12
Joined: Thu Sep 20, 2018 1:09 pm

Re: Mikrotik API delete hosts

Thu Sep 19, 2019 1:46 pm

Any suggestions, please?
 
User avatar
Arxondas
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 72
Joined: Sun Aug 02, 2015 12:23 pm
Location: Greece
Contact:

Re: Mikrotik API delete hosts

Thu Sep 19, 2019 2:51 pm

Hi,
I didn't continue with the project and I don't have the knowledge to help you .
sorry:)

Who is online

Users browsing this forum: codi639 and 63 guests