PHPackages                             ocolin/hyconext - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ocolin/hyconext

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ocolin/hyconext
===============

SNMP and SSH client for Hyconext switches

v3.1.0(3w ago)032MITPHPPHP ^8.4

Since Jul 8Pushed 3w agoCompare

[ Source](https://github.com/ocolin/hyconext)[ Packagist](https://packagist.org/packages/ocolin/hyconext)[ Docs](https://github.com/ocolin/hyconext)[ RSS](/packages/ocolin-hyconext/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (16)Versions (28)Used By (0)

[![PHP Version](https://camo.githubusercontent.com/b37db47746bb49d291c47c3cc8fabd15219dc271ef4a998933fcd59e950d22b3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e342d626c7565)](https://php.net)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](LICENSE)[![Latest Version](https://camo.githubusercontent.com/dd286d693a3271afae6c9c03d587042ebf6049b3d348268225201de5d5aed368/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f636f6c696e2f6879636f6e657874)](https://packagist.org/packages/ocolin/hyconext)[![Downloads](https://camo.githubusercontent.com/74caf745f78bfefa44b9ba66dc98fcb5e8a38a5664375197ba8e8232b477fc04/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f636f6c696e2f6879636f6e657874)](https://packagist.org/packages/ocolin/hyconext)

ocolin/hyconext
===============

[](#ocolinhyconext)

A PHP client for monitoring and managing **Hyconext** network switches via SNMP and SSH. Provides structured access to interface data, system information, POE port statistics, and MAC address tables.

Built on top of [ocolin/EasySNMP](https://github.com/ocolin/EasySNMP) for SNMP and [phpseclib](https://phpseclib.com) for SSH.

---

Table of Contents
-----------------

[](#table-of-contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
    - [SNMP Configuration](#snmp-configuration)
    - [SSH Configuration](#ssh-configuration)
- [Usage](#usage)
    - [SNMP Client](#snmp-client)
    - [SSH Client](#ssh-client)
- [Available Methods](#available-methods)
    - [HyconextSNMP](#hyconextsnmp)
    - [HyconextSSH](#hyconextssh)
- [Data Objects](#data-objects)
    - [Port](#port)
    - [Poe](#poe)
    - [System](#system)
    - [MacTable](#mactable)
- [Notes](#notes)
- [Contributing &amp; Roadmap](#contributing--roadmap)

---

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

[](#requirements)

- PHP 8.4 or higher
- `ext-openssl`
- `ext-gmp`

---

Installation
------------

[](#installation)

```
composer require ocolin/hyconext
```

---

Configuration
-------------

[](#configuration)

Configuration can be provided in three ways:

**1. Environment variables with the default prefix** — the simplest approach. Set `HYCONEXT_*` variables in your environment and instantiate with no arguments:

```
$snmp = new HyconextSNMP();
$ssh  = new HyconextSSH();
```

**2. Environment variables with a custom prefix** — useful when managing multiple devices with different credentials, or if you prefer a different naming convention:

```
$config = new Config( prefix: 'SWITCH_FLOOR2' );
$snmp   = new HyconextSNMP( $config );
```

With `SWITCH_FLOOR2_SNMP_HOST`, `SWITCH_FLOOR2_SNMP_COMMUNITY` etc. as your ENV vars.

**3. Direct constructor arguments** — pass values explicitly, bypassing ENV vars entirely:

```
$config = new Config( host: '192.168.1.1', community: 'public' );
$snmp   = new HyconextSNMP( $config );
```

Constructor arguments always take priority over environment variables. The tables below list all available parameters, their ENV suffix, and defaults. The full ENV var name is `{PREFIX}{SUFFIX}` where the prefix defaults to `HYCONEXT` — for example `HYCONEXT_SNMP_HOST`.

### SNMP Configuration

[](#snmp-configuration)

ArgumentENV SuffixTypeDefaultDescription`host``_SNMP_HOST`string—Hostname or IP of device`community``_SNMP_COMMUNITY`string`public`SNMP community string (v2c)`port``_SNMP_PORT`int`161`SNMP UDP port`version``_SNMP_VERSION`int`2`SNMP version (1, 2, or 3)`timeout_connect``_SNMP_TIMEOUT_CONNECT`int`3`Connection timeout in seconds`timeout_read``_SNMP_TIMEOUT_READ`int`10`Read timeout in seconds`user``_SNMP_USER`string—SNMPv3 username`use_auth``_SNMP_USE_AUTH`bool`true`SNMPv3 enable authentication`auth_pwd``_SNMP_AUTH_PWD`string—SNMPv3 authentication password`auth_mech``_SNMP_AUTH_MECH`string`SHA`SNMPv3 authentication mechanism`use_priv``_SNMP_USE_PRIV`bool`true`SNMPv3 enable privacy/encryption`priv_mech``_SNMP_PRIV_MECH`string`AES`SNMPv3 privacy mechanism`priv_pwd``_SNMP_PRIV_PWD`string—SNMPv3 privacy password`engine_id``_SNMP_ENGINE_ID`string—SNMPv3 engine ID (usually auto-discovered)`context_name``_SNMP_CONTEXT_NAME`string—SNMPv3 context name### SSH Configuration

[](#ssh-configuration)

ArgumentENV SuffixTypeDefaultDescription`host``_SSH_HOST`string—Hostname or IP of device`username``_SSH_USERNAME`string`admin`SSH username`password``_SSH_PASSWORD`string—SSH password`port``_SSH_PORT`int`22`SSH port`timeout``_SSH_TIMEOUT`int`10`SSH timeout in seconds---

Usage
-----

[](#usage)

### SNMP Client

[](#snmp-client)

```
use Ocolin\Hyconext\HyconextSNMP;
use Ocolin\EasySNMP\Config;

// Using environment variables
$snmp = new HyconextSNMP();

// Using a config object directly
$config = new Config(
    host: '192.168.1.1',
    community: 'public',
    prefix: 'HYCONEXT'
);
$snmp = new HyconextSNMP( $config );

// Get system information
$system = $snmp->getSystem();
echo $system->sysName;      // 877Cedar.POESW
echo $system->sysUpTime;    // Raw TimeTicks value
echo $system->sysLocation;  // 877Cedar

// Get interfaces (default columns)
$interfaces = $snmp->getInterfaces();
foreach( $interfaces as $port ) {
    echo $port->name . ' - ' . $port->alias . ' - ' . $port->operStatus;
}

// Get interfaces (specific columns only)
$interfaces = $snmp->getInterfaces(['name', 'alias', 'operStatus', 'highSpeed']);

// Get POE data (all columns)
$poe = $snmp->getPoe();
foreach( $poe as $port ) {
    echo $port->label . ': ' . $port->currentPower . 'mW';
}

// Get POE data (specific columns only)
$poe = $snmp->getPoe(['adminEnable', 'detection', 'currentPower', 'label']);
```

### SSH Client

[](#ssh-client)

The SSH client is used to retrieve the MAC address table, which is not available via SNMP on Hyconext switches.

```
use Ocolin\Hyconext\HyconextSSH;
use Ocolin\Hyconext\SshConfig;

// Using environment variables
$ssh = new HyconextSSH();

// Using a config object directly
$config = new SshConfig(
    host: '192.168.1.1',
    password: 'yourpassword'
);
$ssh = new HyconextSSH( $config );

// Get MAC address table
$macTable = $ssh->getMacTable();

echo $macTable->macStats->total;    // Total MAC addresses
echo $macTable->macStats->dynamic;  // Dynamic entries
echo $macTable->macStats->static;   // Static entries

foreach( $macTable->macTable as $entry ) {
    echo $entry->mac . ' on ' . $entry->interface . ' (VLAN ' . $entry->vlan . ')';
}
```

---

Available Methods
-----------------

[](#available-methods)

### HyconextSNMP

[](#hyconextsnmp)

MethodReturnsDescription`getSystem()``System`Device system information`getInterfaces( array $columns )``Port[]`Interface/port data`getPoe( array $columns )``Poe[]`POE port data#### getInterfaces() Columns

[](#getinterfaces-columns)

ColumnTypeDescription`name`stringInterface name (e.g. `2.5GigaEthernet1/0/1`)`alias`stringAdministrator-assigned description`description`stringInterface description`speed`intSpeed in bps`highSpeed`intSpeed in Mbps`adminStatus`intAdministrative status (1=up, 2=down, 3=testing)`operStatus`intOperational status (1=up, 2=down, 3=testing, 4=unknown, 5=dormant, 6=notPresent, 7=lowerLayerDown)`mtu`intMaximum transmission unit in bytes`macAddress`stringInterface MAC address`type`intInterface type (see IANA ifType registry)`lastChange`intLast status change in TimeTicks`inOctets`int32-bit input byte counter (wraps at ~4GB)`outOctets`int32-bit output byte counter (wraps at ~4GB)`inHcOctets`int64-bit input byte counter`outHcOctets`int64-bit output byte counter`inErrors`intInput error counter`outErrors`intOutput error counterDefault columns: `name`, `alias`, `description`, `speed`, `operStatus`, `adminStatus`

#### getPoe() Columns

[](#getpoe-columns)

ColumnTypeDescription`adminEnable`intPOE enabled (1=enabled, 2=disabled)`availability`intPower pairs control ability (TruthValue)`configPair`intConfigured pair mode (1=2pair-low, 2=4pair-low, 3=2pair, 4=4pair, 5=auto)`detection`intDetection status (1=disabled, 2=searching, 3=deliveringPower, 4=fault, 5=test, 6=otherFault)`priority`intPort power priority (1-16)`mpsAbsent`intPower dropout counter`type`stringPort type string`classification`intPOE device class (0-4)`invalidSignature`intInvalid signature counter`overloadCounter`intOverload event counter`shortCounter`intShort circuit counter`modeState`intPort mode state (0=auto, 2=force)`maxPower`intConfigured max power in milliwatts`peakPower`intPeak power consumption in milliwatts`currentPower`intCurrent power consumption in milliwatts`currentMa`intCurrent draw in milliamps`voltage`intPort voltage in volts`label`stringAdministrator-assigned POE label`operPairs`intOperating pair mode (1=2pair-low, 2=4pair-low, 3=2pair, 4=4pair, 8=auto-bt, 9=auto)`pairs`intActive pair countDefault: All columns

### HyconextSSH

[](#hyconextssh)

MethodReturnsDescription`getMacTable()``MacTable`MAC address table`getPorts()``Port`List of interface ports---

Data Objects
------------

[](#data-objects)

### Port

[](#port)

Returned by `getPorts()`.

```
$port->interface;   // Name of the interface port.
$port->adminStatus; // Administrative status.
$port->operStatus;  // Operational status.
$port->mode;        // Interface mode.
$port->description; // Description of port
```

### Poe

[](#poe)

Returned by `getPoe()`. All properties except `index` are nullable depending on requested columns.

```
$poe->index;          // int     - Interface index (matches Port index)
$poe->adminEnable;    // ?int    - 1=enabled, 2=disabled
$poe->detection;      // ?int    - 1=disabled, 2=searching, 3=deliveringPower, 4=fault
$poe->currentPower;   // ?int    - Current consumption in milliwatts
$poe->peakPower;      // ?int    - Peak consumption in milliwatts
$poe->maxPower;       // ?int    - Configured power limit in milliwatts
$poe->voltage;        // ?int    - Port voltage in volts
$poe->currentMa;      // ?int    - Current draw in milliamps
$poe->label;          // ?string - POE port label
```

### System

[](#system)

Returned by `getSystem()`.

```
$system->sysName;        // ?string - Device hostname
$system->sysDescr;       // ?string - Hardware/firmware description
$system->sysLocation;    // ?string - Physical location
$system->sysContact;     // ?string - Contact information
$system->sysUpTime;      // ?int    - Uptime in TimeTicks (hundredths of a second)
```

### MacTable

[](#mactable)

Returned by `getMacTable()`.

```
$macTable->macStats->total;    // int - Total MAC entries
$macTable->macStats->dynamic;  // int - Dynamic entries
$macTable->macStats->static;   // int - Static entries
$macTable->macStats->valid;    // int - Valid entries

foreach( $macTable->macTable as $entry ) {
    $entry->mac;        // string  - MAC address (xx:xx:xx:xx:xx:xx)
    $entry->interface;  // string  - Interface name
    $entry->vlan;       // ?int    - VLAN ID
    $entry->operType;   // string  - Operation type (forward, discard, etc.)
    $entry->type;       // string  - Entry type (dynamic, static, etc.)
    $entry->vsi;        // ?string - Virtual Switch Instance (null if not used)
    $entry->bd;         // ?string - Bridge Domain (null if not used)
}
```

---

Notes
-----

[](#notes)

- **MAC table via SNMP**: Hyconext switches do not expose the MAC address table via SNMP despite having a documented OID for it. The SSH client is provided as a workaround.
- **POE data**: The POE trait uses Hyconext's proprietary SNMP MIB (`1.3.6.1.4.1.60609.1.1622`). Some columns were determined empirically due to incomplete MIB documentation. These are noted in the source code.
- **SSH compatibility**: The SSH client has been tested against `dropbear_USP_SSH` as used by Hyconext switches. Standard phpseclib password authentication is used.
- **Column 43 timeout**: SNMP column `.43` of the proprietary POE table causes the device to timeout and is intentionally skipped.
- **Interface name format**: SNMP returns full interface names (`2.5GigaEthernet1/0/1`) while SSH returns abbreviated names (`2.5ge1/0/1`). Keep this in mind when correlating data between the two clients.
- **Raw values**: All SNMP integer values are returned as-is without string conversion. This keeps the library lightweight and lets consumers format values as needed for their use case.t\*\*: SNMP returns full interface names (`2.5GigaEthernet1/0/1`) while SSH returns abbreviated names (`2.5ge1/0/1`). Keep this in mind when correlating data between the two clients.

---

Contributing &amp; Roadmap
--------------------------

[](#contributing--roadmap)

This package is under active development. The current release covers the most commonly needed functionality — interfaces, system information, POE, and MAC address tables — but Hyconext switches support much more than what is documented here.

Planned additions include more SNMP traits for things like routing tables, ARP tables, and VLAN information. If there is a specific feature you need that isn't yet implemented, feel free to open an issue on [GitHub](https://github.com/ocolin/hyconext/issues) and it will be considered for a future release. Pull requests are also welcome.

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance95

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity64

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 ~13 days

Total

26

Last Release

23d ago

Major Versions

1.10 → v2.0.02026-04-23

v2.0.0 → v3.0.02026-05-08

PHP version history (2 changes)1.6PHP ^8.2

v3.0.0PHP ^8.4

### 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 (4 commits)")

---

Tags

phpsshnetworkswitchsnmpnetwork monitoringpoemac-tablehyconext

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[phpseclib/phpseclib2_compat

phpseclib 2.0 polyfill built with phpseclib 3.0

132.1M17](/packages/phpseclib-phpseclib2-compat)[fab2s/nodalflow

A PHP Nodal WorkFlow

16373.7k1](/packages/fab2s-nodalflow)[shopware/app-php-sdk

Shopware App SDK for PHP

15109.8k3](/packages/shopware-app-php-sdk)

PHPackages © 2026

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