Skip to content

TNOC/routeros_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RouterOS API

About

Installation

###Composer

Incorperate the following to your composer.json file

"repositories": [
    {
        "type": "git",
        "name": "tnoc/routeros",
        "url": "http://github.com/TNOC/routeros_api"
    }
],
"require": {
    "tnoc/routeros": "dev-master"
}

Then update your dependencies: php composer.phar update

Usage

Example index.php

<?php

require_once "vendor/autoload.php";

use \RouterOS;

$api = new RouterOS\Core();

if ($api->connect('111.111.111.111', 'LOGIN', 'PASSWORD')) {

   $api->write('/interface/getall');

   $READ = $api->read(false);
   $ARRAY = $api->parse_response($READ);

   print_r($ARRAY);

   $api->disconnect();

}

Executables

###./bin/routeros-test.php

RouterOS Test is a script to test that a Mikrotik is accessable through API

Usage:

  • php ./bin/routeros-test.php --help
  • php ./bin/routeros-test.php -h 111.111.111.111 -u username

Examples

Examples are from http://wiki.mikrotik.com/wiki/API_PHP_class

About

A composer package for Mikrotik / Router OS API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages