A fluent interface to the MikroTik RouterOS API.
Example Usage | Testing | Changelog | Links
http://myhomelab.blogspot.co.za/2013/05/installing-mikrotik-routeros-under-VirtualBox.html
<?php
require_once __DIR__ . '/../../vendor/autoload.php'; // Autoload files using Composer autoload
use Monitor\Monitor;
use Routeros\Routeros;
$router = new Routeros(); // Create new API instance
//$router->debug(); // Turn on debugging
$monitor = new Monitor(); // Initialise monitoring
$monitor->start();
echo $router->version() . "\n"; // Get router version information (/system/resource/print)
$monitor->show(); // Display the amount of time it took to get this info
echo $router->uptime() . "\n"; // Get router uptime information. Uses a saved variable
$monitor->show(); // Show how much quicker this happened
echo $router->resource('cpu-load') . "\n"; // An alternative way to get the CPU load
$queues = $router->queue()->simple()->pr(); // Get the result of /queue/simple/print
// print_r ($queues);
echo $router->credentials() . "\n"; // Return current credentials in use for the API in JSON format
echo $router->ping($router->ip_address); // Ping current IP address of API router
The command below will link to a public router and run this API command /interface/getall
php tests/main.php
- Fixed API for PhpStorm to avoid warnings
During the construction of this library various links were followed.