A class for performing SNMP V2 queries on generic devices

copyright Copyright (c) 2012, Open Source Solutions Limited, Dublin, Ireland
author Barry O'Donovan

 Methods

Get an array of device interface aliases (e.g. as set by the interface description / port-name parameter)

aliases() : array

E.g. the followig SNMP output yields the shown array:

.1.3.6.1.2.1.2.2.1.2.18.10128 = STRING: Connection to switch2 .1.3.6.1.2.1.2.2.1.2.18.10129 = STRING: Connection to switch3 ...

 [10128] => "Connection to switch2"
 [10129] => "Connection to switch3"

Returns

arrayAn array of interface aliases

Returns an associate array of STP port IDs (key) to interface IDs (value)

bridgeBasePortIfIndexes() : array

e.g. [22] => 10122

Returns

arrayAssociate array of STP port IDs (key) to interface IDs (value)

Get an array of device interface descriptions

descriptions() : array

E.g. the following SNMP output yields the shown array:

.1.3.6.1.2.1.31.1.1.1.1.10128 = STRING: GigabitEthernet1/0/28 .1.3.6.1.2.1.31.1.1.1.1.10129 = STRING: GigabitEthernet1/0/29 ...

 [10128] => "GigabitEthernet1/0/28"
 [10129] => "GigabitEthernet1/0/29"

Returns

arrayAn array of interface descriptions

Get an array of device interface names

names() : array

E.g. the following SNMP output yields the shown array:

.1.3.6.1.2.1.31.1.1.1.1.10128 = STRING: Gi1/0/28 .1.3.6.1.2.1.31.1.1.1.1.10129 = STRING: Gi1/0/29 ...

 [10128] => "Gi1/0/28"
 [10129] => "Gi1/0/29"

Returns

arrayAn array of interface names

Get an array of device interface operating status (up / down)

operationStates(boolean $translate) : array

E.g. the follow SNMP output yields the shown array:

.1.3.6.1.2.1.2.2.1.8.10128 = INTEGER: up(1) .1.3.6.1.2.1.2.2.1.8.10129 = INTEGER: down(2) ...

 [10128] => 1
 [10129] => 2

see \IF_OPER_STATES

Parameters

$translate

boolean

If true, return the string representation

Returns

arrayAn array of interface states

Get an array of device interface (operating) speeds

speeds() : array

E.g. the following SNMP output yields the shown array:

.1.3.6.1.2.1.2.2.1.5.10128 = Gauge32: 1000000000 .1.3.6.1.2.1.2.2.1.5.10129 = Gauge32: 100000000 ...

 [10128] => 1000000000
 [10129] => 100000000

NB: operating speed as opposed to maximum speed

Returns

arrayAn array of interface operating speeds

 Properties

 

$IF_OPER_STATES

$IF_OPER_STATES 

 Constants

 

IF_OPER_STATUS_DORMANT

IF_OPER_STATUS_DORMANT 

 

IF_OPER_STATUS_DOWN

IF_OPER_STATUS_DOWN 

 

IF_OPER_STATUS_LOWER_LAYER_DOWN

IF_OPER_STATUS_LOWER_LAYER_DOWN 

 

IF_OPER_STATUS_NOT_PRESENT

IF_OPER_STATUS_NOT_PRESENT 

 

IF_OPER_STATUS_TESTING

IF_OPER_STATUS_TESTING 

 

IF_OPER_STATUS_UNKNOWN

IF_OPER_STATUS_UNKNOWN 

 

IF_OPER_STATUS_UP

IF_OPER_STATUS_UP 

 

OID_IF_ALIAS

OID_IF_ALIAS 

 

OID_IF_DESCRIPTION

OID_IF_DESCRIPTION 

 

OID_IF_NAME

OID_IF_NAME 

 

OID_IF_OPER_STATUS

OID_IF_OPER_STATUS 

 

OID_IF_SPEED

OID_IF_SPEED