Community discussions

MikroTik App
 
bobrovski
just joined
Topic Author
Posts: 7
Joined: Sun Feb 16, 2020 8:31 am

How could I send this commands from my php script via api?

Tue Jun 16, 2020 9:06 pm

Hi! I need to send these 2 commands from php script via api:
/ip dhcp-server lease make-static [/ip dhcp-server lease find address="1.1.1.1"]
/ip dhcp-server lease comment [/ip dhcp-server lease find address="1.1.1.1"] my_comment
How could I do it? I need to make certain dhcp lease static(I know only ip) and then add comment to it.
I tried this code, but it doesn't work:
<?php
require('mikrotik_api.php');
$API = new RouterosAPI();
$API->debug = false;
if ($API->connect('ip', 'login', 'pass')) {
$ARRAY = $API->comm('/ip/dhcp-server/lease/make-static/[/ip dhcp-server lease find address="1.1.1.1"]');}

Who is online

Users browsing this forum: welitonxd and 32 guests