Anyone know how to get torch data from mikrotik router using API.
We are using PHP API mentioned below, but its giving me the response like "no such command prefix".
API Request :
==========
Code: Select all
require('routeros_api.class.php');
require('config.php');
$API = new RouterosAPI();
$API->debug = false;
$interface = $argv[1];
if ($API->connect(IP_ADDRESS, USERNAME, PASSWORD))
{
$API->write('/tool/torch');
$API->write("=interface=$interface");
$READ= $API->read(false);
$ARRAY = $API->parseResponse($READ);
print_r($ARRAY);
}
=======
Code: Select all
Array
(
[!trap] => Array
(
[0] => Array
(
[message] => no such command prefix
)
)
)
API Request
==========
Code: Select all
$API->write("/interface/$interface");
$READ = $API->read(false);
$ARRAY = $API->parseResponse($READ);
print_r($ARRAY);
============
Code: Select all
Array
(
[!trap] => Array
(
[0] => Array
(
[category] => 0
[message] => no such command or directory (Psychz)
)
[1] => Array
(
[message] => no such command
)
)
)