PHPackages                             ocolin/easymt - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. ocolin/easymt

ActiveLibrary[HTTP &amp; Networking](/categories/http)

ocolin/easymt
=============

Simple wrapper for evil freelancers RouterOS API client

v3.0.0(3mo ago)1181MITPHPPHP &gt;=8.3

Since May 25Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/ocolin/EasyMT)[ Packagist](https://packagist.org/packages/ocolin/easymt)[ RSS](/packages/ocolin-easymt/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (10)Versions (10)Used By (0)

About
=====

[](#about)

This library provides a simple and basic interface to useing evilfreelancer's RouterOS API as well as SNMP calls for Mikrotik devices.

> This library is going away and being replaced by ocolin/routeros

Requirements
------------

[](#requirements)

PHP 8.3+

Adding a composer module:
-------------------------

[](#adding-a-composer-module)

In your composer.json

```
"repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/ocolin/EasySNMP"
        }
    ],

```

Then run

```
composer require ocolin/eastmt

```

API
===

[](#api)

Most of the funcionality comes from:

This wrapper simply allows you to use environment variables in advance.

Settings
--------

[](#settings)

### Arguments

[](#arguments)

Any host related arguments such as IP will take precedent the config file or environment variables

### Environment Variables

[](#environment-variables)

Environment variables will override any settings from the default config file. A prefix is required so that multiple entries can be stored. The prefix will be appended to the beginning of the environment variable used. Here are the defaults:

With prefix 'EXAMPLE1':

```
$_ENV['EXAMPLE1_MT_IP'];
$_ENV['EXAMPLE1_MT_USER'];
$_ENV['EXAMPLE1_MT_PASS'];

```

### Default config file

[](#default-config-file)

You can also edit **src/config.json** if you don't want to use arguments or environment variables. This will however only allow for a single device to be used.

Examples
--------

[](#examples)

### Example 1: Using settings in config.json

[](#example-1-using-settings-in-configjson)

```
use Ocolin\EasyMT\API;

$output = API::query( '/ip/arp/print' )->read();
```

### Example 2: Using parameters:

[](#example-2-using-parameters)

```
use Ocolin\EasyMT\API;

$output = API::query(
        endpoint: '/ip/arp/print',
        where: [
            ['address', '127.0.0.1'],
            ['address', '127.0.0.2']
        ],
        operations: '|'
)->read();
```

### Example 3: Using environment variables

[](#example-3-using-environment-variables)

```
use Ocolin\EasyMT\API;

$_ENV['EXAMPLE_MT_IP']   = '127.0.0.1';
$_ENV['EXAMPLE_MT_USER'] = 'admin';
$_ENV['EXAMPLE_MT_PASS'] = 'pass';

$output = API::query(
    endpoint: '/ip/arp/print',
      prefix: 'EXAMPLE'
)->read();
```

### Example 4: Using argument ip and local environment variables

[](#example-4-using-argument-ip-and-local-environment-variables)

```
use Ocolin\EasyMT\API;

$output = API::query(
    endpoint: '/ip/arp/print',
      prefix: 'EXAMPLE',
       local: true
)->read();
```

SNMP
====

[](#snmp)

Calls
-----

[](#calls)

FunctionDescriptionport\_Alias( int )Get name of alias for a portports()Get list of port informationethernet()Get list of ethernet interface dataport\_Name( int )Get name of a portsystem()Get system informationiPs()List of IP address informationroutes()List of IP routesmedia()List of Media informationforward()List of forwarding entriesARP()List ARP tableuptime()Uptime infromationstorage()List of storage informationprocessor()Processor informationorganization()List of orgnaization informationdot1dTpFdbEntry()List of bridge forwarding informationpower()List of power related informationhealth()Device health informationlicense()License informationos()Information about OSneighbors()List of neighbor informationifStats()List of interface statistic informationpartitions()List of partition informationoptical()List of optical interface informationleaseCount()Get number of DHCP leasesExample
-------

[](#example)

### Example 1: Using environment variable

[](#example-1-using-environment-variable)

```
use Ocolin\EasyMT\SNMP;

$_ENV['EXAMPLE1_SNMP_COMMUNITY'] = public;
$_ENV['EXAMPLE1_SNMP_VERSION'] = 2;
$_ENV['EXAMPLE1_MT_IP'] = '127.0.0.1';

$snmp = new \Ocolin\EasyMT\SNMP(
    prefix: 'EXAMPLE1'
);

$output = $snmp->health();
```

### Example 2: Using argument variables

[](#example-2-using-argument-variables)

```
use Ocolin\EasyMT\SNMP;

$snmp = new \Ocolin\EasyMT\SNMP(
           ip: '127.0.0.1',
    community: 'public',
      version: 2
);

$output = $snmp->health();
```

### Example 3: Using default SNMP settings

[](#example-3-using-default-snmp-settings)

```
use Ocolin\EasyMT\SNMP;

$snmp = new \Ocolin\EasyMT\SNMP(
    ip: '127.0.0.1'
);
$output = $snmp->health();
```

### Example Output:

[](#example-output)

```
stdClass Object
(
    [temperature] => stdClass Object
        (
            [Value] => 27
            [Unit] => 1
            [UnitName] => celsius
        )

    [cpu-temperature] => stdClass Object
        (
            [Value] => 48
            [Unit] => 1
            [UnitName] => celsius
        )

    [fan1-speed] => stdClass Object
        (
            [Value] => 4200
            [Unit] => 2
            [UnitName] => rpm
        )

    [fan2-speed] => stdClass Object
        (
            [Value] => 3990
            [Unit] => 2
            [UnitName] => rpm
        )

    [psu1-state] => stdClass Object
        (
            [Value] => 0
            [Unit] => 6
            [UnitName] => status
        )

    [psu2-state] => stdClass Object
        (
            [Value] => 1
            [Unit] => 6
            [UnitName] => status
        )
)
```

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance78

Regular maintenance activity

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~99 days

Recently: every ~89 days

Total

8

Last Release

116d ago

Major Versions

1.3 → 2.02025-06-25

2.2 → v3.0.02026-04-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/e97ac0aa452b872ddc3f7f4c56c83852574a27bb74622f8c054d11ca20008fc9?d=identicon)[Ocolin](/maintainers/Ocolin)

---

Top Contributors

[![ocolin](https://avatars.githubusercontent.com/u/8870196?v=4)](https://github.com/ocolin "ocolin (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ocolin-easymt/health.svg)

```
[![Health](https://phpackages.com/badges/ocolin-easymt/health.svg)](https://phpackages.com/packages/ocolin-easymt)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25026.8M85](/packages/php-http-cache-plugin)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

85997.3k131](/packages/httpsoft-http-message)[thesis/nats

Async (fiber based) client for Nats.

758.3k](/packages/thesis-nats)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
