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 admin status (up / down)

adminStates(boolean $translate) : array

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

.1.3.6.1.2.1.2.2.1.7.10128 = INTEGER: up(1) .1.3.6.1.2.1.2.2.1.7.10129 = INTEGER: down(2) ...

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

see \IF_ADMIN_STATES

Parameters

$translate

boolean

If true, return the string representation

Returns

arrayAn array of interface admin states

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 inbound discarded packets

inDiscards() : \arrary

"The number of inbound packets which were chosen to be discarded even though no errors had been detected to prevent their being deliverable to a higher-layer protocol. One possible reason for discarding such a packet could be to free up buffer space."

Returns

\arraryThe total number of discarded inbound packets received on interfaces

Get an array of device interface inbound error packets

inErrors() : array

"The number of inbound packets that contained errors preventing them from being deliverable to a higher-layer protocol."

Returns

arrayThe total number of error inbound packets received on interfaces

Get an array of device interface non-unicast packets in

inNonUnicastPackets() : array

"The number of non-unicast (i.e., subnetwork- broadcast or subnetwork-multicast) packets delivered to a higher-layer protocol."

Returns

arrayThe total number of non-unicast packets received on interfaces

Get an array of device interface in octets

inOctets() : array

"The total number of octets received on the interface, including framing characters."

Returns

arrayThe total number of octets received on interfaces

Get an array of device interface unicast packets in

inUnicastPackets() : array

"The number of subnetwork-unicast packets delivered to a higher-layer protocol."

Returns

arrayThe total number of unicast packets received on interfaces

Get an array of packets received on an interface of unknown protocol

inUnknownProtocols() : array

"The number of packets received via the interface which were discarded because of an unknown or unsupported protocol."

Returns

arrayThe number of packets received on an interface of unknown protocol

Get an array of device interface last change times

lastChanges() : array

Value returned is timeticks (one hundreds of a second)

"The value of sysUpTime at the time the interface entered its current operational state. If the current state was entered prior to the last re- initialization of the local network management subsystem, then this object contains a zero value."

see \OSS\SNMP\MIBS\System::uptime()

Returns

arrayTimeticks (or zero) since last change of the interfaces

Get an array of device MTUs

mtus() : array

Returns

arrayAn array of device MTUs

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 the number of network interfaces (regardless of their current state) present on this system.

numberOfInterfaces() : int

Returns

intThe number of network interfaces on the system

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 outbound discarded packets

outDiscards() : \arrary

"The number of outbound packets which were chosen to be discarded even though no errors had been detected to prevent their being transmitted. One possible reason for discarding such a packet could be to free up buffer space."

Returns

\arraryThe total number of discarded outbound packets

Get an array of device interface outbound error packets

outErrors() : array

"The number of outbound packets that could not be transmitted because of errors."

Returns

arrayThe total number of error outbound packets received on interfaces

Get an array of device interface non-unicast packets out

outNonUnicastPackets() : array

"The total number of packets that higher-level protocols requested be transmitted to a non- unicast (i.e., a subnetwork-broadcast or subnetwork-multicast) address, including those that were discarded or not sent."

Returns

arrayThe total number of non-unicast packets requested sent interfaces

Get an array of device interface out octets

outOctets() : array

"The total number of octets transmitted out of the interface, including framing characters."

Returns

arrayThe total number of octets transmitted on interfaces

Get an array of interface outbound queue lengths

outQueueLength() : array

"The length of the output packet queue (in packets)"

Returns

arrayThe total number of packets in the outbound queues

Get an array of device interface unicast packets out

outUnicastPackets() : array

"The total number of packets that higher-level protocols requested be transmitted to a subnetwork-unicast address, including those that were discarded or not sent."

Returns

arrayThe total number of unicast packets transmitted on interfaces

Get an array of the interfaces' physical addresses

physAddresses() : array

"The interface's address at the protocol layer immediately `below' the network layer in the protocol stack. For interfaces which do not have such an address (e.g., a serial line), this object should contain an octet string of zero length."

Returns

arrayAn array of device physical addresses

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

Get an array of device interface types

types(boolean $translate) : array

see \$IF_TYPES

Parameters

$translate

boolean

If true, return the string representation

Returns

arrayAn array of interface types

 Properties

 

$IF_ADMIN_STATES

$IF_ADMIN_STATES 

 

$IF_OPER_STATES

$IF_OPER_STATES 

 

$IF_TYPES

$IF_TYPES 

 Constants

 

IF_ADMIN_STATUS_DOWN

IF_ADMIN_STATUS_DOWN 

 

IF_ADMIN_STATUS_TESTING

IF_ADMIN_STATUS_TESTING 

 

IF_ADMIN_STATUS_UP

IF_ADMIN_STATUS_UP 

 

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 

 

IF_TYPE_BASIC_ISDN

IF_TYPE_BASIC_ISDN 

 

IF_TYPE_DDN_X25

IF_TYPE_DDN_X25 

 

IF_TYPE_DS3

IF_TYPE_DS3 

 

IF_TYPE_DSL

IF_TYPE_DSL 

 

IF_TYPE_E1

IF_TYPE_E1 

 

IF_TYPE_EON

IF_TYPE_EON 

 

IF_TYPE_ETHERNET_3MBIT

IF_TYPE_ETHERNET_3MBIT 

 

IF_TYPE_ETHERNET_CSMACD

IF_TYPE_ETHERNET_CSMACD 

 

IF_TYPE_FDDI

IF_TYPE_FDDI 

 

IF_TYPE_FRAME_RELAY

IF_TYPE_FRAME_RELAY 

 

IF_TYPE_HDH_1822

IF_TYPE_HDH_1822 

 

IF_TYPE_HYPERCHANNEL

IF_TYPE_HYPERCHANNEL 

 

IF_TYPE_ISO88023_CSMACD

IF_TYPE_ISO88023_CSMACD 

 

IF_TYPE_ISO88024_TOKEN_BUS

IF_TYPE_ISO88024_TOKEN_BUS 

 

IF_TYPE_ISO88025_TOKEN_RING

IF_TYPE_ISO88025_TOKEN_RING 

 

IF_TYPE_ISO88026_MAN

IF_TYPE_ISO88026_MAN 

 

IF_TYPE_LAPB

IF_TYPE_LAPB 

 

IF_TYPE_NSIP

IF_TYPE_NSIP 

 

IF_TYPE_OTHER

IF_TYPE_OTHER 

 

IF_TYPE_PPP

IF_TYPE_PPP 

 

IF_TYPE_PRIMARY_ISDN

IF_TYPE_PRIMARY_ISDN 

 

IF_TYPE_PROP_POINT_TO_POINT_SERIAL

IF_TYPE_PROP_POINT_TO_POINT_SERIAL 

 

IF_TYPE_PROTEON_10MBIT

IF_TYPE_PROTEON_10MBIT 

 

IF_TYPE_PROTEON_80MBIT

IF_TYPE_PROTEON_80MBIT 

 

IF_TYPE_REGULAR_1822

IF_TYPE_REGULAR_1822 

 

IF_TYPE_RFC877_X25

IF_TYPE_RFC877_X25 

 

IF_TYPE_SDLC

IF_TYPE_SDLC 

 

IF_TYPE_SIP

IF_TYPE_SIP 

 

IF_TYPE_SLIP

IF_TYPE_SLIP 

 

IF_TYPE_SOFTWARE_LOOPBACK

IF_TYPE_SOFTWARE_LOOPBACK 

 

IF_TYPE_STAR_LAN

IF_TYPE_STAR_LAN 

 

IF_TYPE_ULTRA

IF_TYPE_ULTRA 

 

OID_IF_ADMIN_STATUS

OID_IF_ADMIN_STATUS 

 

OID_IF_ALIAS

OID_IF_ALIAS 

 

OID_IF_DESCRIPTION

OID_IF_DESCRIPTION 

 

OID_IF_IN_DISCARDS

OID_IF_IN_DISCARDS 

 

OID_IF_IN_ERRORS

OID_IF_IN_ERRORS 

 

OID_IF_IN_NON_UNICAST_PACKETS

OID_IF_IN_NON_UNICAST_PACKETS 

 

OID_IF_IN_OCTETS

OID_IF_IN_OCTETS 

 

OID_IF_IN_UNICAST_PACKETS

OID_IF_IN_UNICAST_PACKETS 

 

OID_IF_IN_UNKNOWN_PROTOCOLS

OID_IF_IN_UNKNOWN_PROTOCOLS 

 

OID_IF_LAST_CHANGE

OID_IF_LAST_CHANGE 

 

OID_IF_MTU

OID_IF_MTU 

 

OID_IF_NAME

OID_IF_NAME 

 

OID_IF_NUMBER

OID_IF_NUMBER 

 

OID_IF_OPER_STATUS

OID_IF_OPER_STATUS 

 

OID_IF_OUT_DISCARDS

OID_IF_OUT_DISCARDS 

 

OID_IF_OUT_ERRORS

OID_IF_OUT_ERRORS 

 

OID_IF_OUT_NON_UNICAST_PACKETS

OID_IF_OUT_NON_UNICAST_PACKETS 

 

OID_IF_OUT_OCTETS

OID_IF_OUT_OCTETS 

 

OID_IF_OUT_QUEUE_LENGTH

OID_IF_OUT_QUEUE_LENGTH 

 

OID_IF_OUT_UNICAST_PACKETS

OID_IF_OUT_UNICAST_PACKETS 

 

OID_IF_PHYS_ADDRESS

OID_IF_PHYS_ADDRESS 

 

OID_IF_SPEED

OID_IF_SPEED 

 

OID_IF_TYPE

OID_IF_TYPE