ocolin/netonix

Basic SNMP lib for querying Netonix switch

Installs: 4

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/ocolin/netonix

1.1 2025-10-10 12:48 UTC

This package is auto-updated.

Last update: 2025-10-10 12:48:28 UTC


README

Simple SNMP interface for Netonix switch.

Requirements

  • PHP 8.3 or higher

Usage

Instantiation

First we need to create an instance of the Netonix object. It required a hostname/ip and a community string. Only SNMP 2 is supported right now.

Example:

$netonix = new Ocolin\Netonix\Netonix(
    host: '129.168.1.100',
    community: 'my_community_string'
);

Function calls

Get System information

$output = $netonix->get_System();

print_r( $output );

Ocolin\Netonix\SystemObject Object
(
    [descr] => Netonix WS-12-250-DC
    [id] => .1.3.6.1.4.1.46242
    [uptime] => 111040191
    [contact] => noc.isp.net
    [name] => Netonix_Switch
    [location] => Sky Moon
    [lastchange] => 11
)

Get ingerfaces

$output = $netonix->get_Interfaces();

print_r( $output );

Array
(
    [0] => Ocolin\Netonix\InterfaceObject Object
        (
            [index] => 1
            [descr] => Port 1
            [type] => 6
            [mtu] => 1528
            [speed] => 0
            [adminstatus] => 1
            [operstatus] => 2
            [inoctets] => 260353251
            [inucastpkts] => 491651
            [innucastpkts] => 46
            [indiscards] => 0
            [inerrors] => 0
            [outoctets] => 3730538824
            [outucastpkts] => 1212974
            [outnucastpkts] => 43576018
            [outdiscards] => 0
            [outerrors] => 0
        )
    )

Get bridge table

$output = $netonix->get_Bridge_Table();

print_r( $output );

Array
(
    [0] => Ocolin\Netonix\BridgeObject Object
        (
            [index] => 1
            [address] => EC:13:B2:84:9F:56
            [port] => 0
            [status] => 4
        )

    [1] => Ocolin\Netonix\BridgeObject Object
        (
            [index] => 2
            [address] => 00:15:6D:B0:5B:DC
            [port] => 12
            [status] => 3
        )
    )

Get interface aliases

$output = self::$netonix->get_Aliases();

print_r( $output );

Array
(
    [0] => Port 1
    [1] => Uplink
    [2] => Tarana.Eest
    [3] => Port 4
    [4] => Port 5
    [5] => Port 6
    [6] => Port 7
    [7] => Port 8
    [8] => Port 9
    [9] => AP-East E
    [10] => AP-East SE
    [11] => AP-East E2
    [12] => Port 13
    [13] => Port 14
)

Get Netonix custom data

$output = self::$netonix->get_Netonix();

print_r( $output );

Ocolin\Netonix\NetonixObject Object
(
    [firmware] => 1.5.8
    [fans] => Array
        (
            [0] => Ocolin\Netonix\FanObject Object
                (
                    [index] => 1
                    [speed] => 2920
                )

        )

    [temps] => Array
        (
            [0] => Ocolin\Netonix\TempObject Object
                (
                    [index] => 1
                    [descr] => Board Temp
                    [temp] => 35
                )

            [1] => Ocolin\Netonix\TempObject Object
                (
                    [index] => 2
                    [descr] => CPU Temp
                    [temp] => 51
                )

            [2] => Ocolin\Netonix\TempObject Object
                (
                    [index] => 3
                    [descr] => PHY Temp
                    [temp] => 51
                )

            [3] => Ocolin\Netonix\TempObject Object
                (
                    [index] => 4
                    [descr] => DCDC Board Temp
                    [temp] => 34
                )

            [4] => Ocolin\Netonix\TempObject Object
                (
                    [index] => 5
                    [descr] => DCDC Heatsink #1 Temp
                    [temp] => 28
                )

            [5] => Ocolin\Netonix\TempObject Object
                (
                    [index] => 6
                    [descr] => DCDC Heatsink #2 Temp
                    [temp] => 13
                )

            [6] => Ocolin\Netonix\TempObject Object
                (
                    [index] => 7
                    [descr] => DCDC Controller Temp
                    [temp] => 53
                )

        )

    [voltage] => Array
        (
            [0] => Ocolin\Netonix\VoltageObject Object
                (
                    [index] => 1
                    [descr] => Board 48V
                    [voltage] => 4970
                )

            [1] => Ocolin\Netonix\VoltageObject Object
                (
                    [index] => 2
                    [descr] => Board 24V
                    [voltage] => 2450
                )

            [2] => Ocolin\Netonix\VoltageObject Object
                (
                    [index] => 3
                    [descr] => Board 3V
                    [voltage] => 330
                )

            [3] => Ocolin\Netonix\VoltageObject Object
                (
                    [index] => 4
                    [descr] => DCDC Input Voltage
                    [voltage] => 4960
                )

            [4] => Ocolin\Netonix\VoltageObject Object
                (
                    [index] => 5
                    [descr] => DCDC Output Voltage
                    [voltage] => 5110
                )

        )

    [poe] => Array
        (
            [0] => Off
            [1] => Off
            [2] => Off
            [3] => Off
            [4] => Off
            [5] => Off
            [6] => Off
            [7] => Off
            [8] => Off
            [9] => 24V
            [10] => 24V
            [11] => 24V
            [12] => Off
            [13] => Off
        )

    [powerConsumption] => 251
    [inputCurrent] => 5
    [efficiency] => 93
)