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

Returns the system contact of the device

contact() : string

Returns

stringThe system contact of the device

Returns the system description of the device

description() : string

Returns

stringThe system description of the device

Gets all system values as an associate array

getAll() : array
The keys of the array are contact, description, location, name, services, uptime

Returns

arrayAll system values as an associate array

Get the SNMP instance

getSNMP() : \OSS_SNMP\SNMP

Returns

\OSS_SNMP\SNMPInstance of the SNMP object

Returns the system location of the device

location() : string

Returns

stringThe system location of the device

Returns the system name of the device

name() : string

Returns

stringThe system name of the device

Returns the system services of the device

services() : string
"A value which indicates the set of services that this entity primarily offers. The value is a sum. This sum initially takes the value zero, Then, for each layer, L, in the range 1 through 7, that this node performs transactions for, 2 raised to (L - 1) is added to the sum. For example, a node which performs primarily routing functions would have a value of 4 (2^(3-1)). In contrast, a node which is a host offering application services would have a value of 72 (2^(4-1) + 2^(7-1)). Note that in the context of the Internet suite of protocols, values should be calculated accordingly: layer functionality 1 physical (e.g., repeaters) 2 datalink/subnetwork (e.g., bridges) 3 internet (e.g., IP gateways) 4 end-to-end (e.g., IP hosts) 7 applications (e.g., mail relays) For systems including OSI protocols, layers 5 and 6 may also be counted."

Returns

stringThe system services of the device

Set the SNMP instance

setSNMP(\OSS_SNMP\SNMP $snmp) : \OSS_SNMP\MIB

Parameters

$snmp

\OSS_SNMP\SNMP

the SNMP instance

Returns

\OSS_SNMP\MIBAn instance of this class for fluent interfaces

Returns the system object ID

systemObjectID() : string
"The vendor's authoritative identification of the network management subsystem contained in the entity. This value is allocated within the SMI enterprises subtree (1.3.6.1.4.1) and provides an easy and unambiguous means for determining `what kind of box' is being managed. For example, if vendor `Flintstones, Inc.' was assigned the subtree 1.3.6.1.4.1.4242, it could assign the identifier 1.3.6.1.4.1.4242.1.1 to its `Fred Router'."

Returns

stringThe system object ID

Returns the system uptime of the device

uptime() : int
"The time (in hundredths of a second) since the network management portion of the system was last re-initialized."

Returns

intThe system uptime of the device (in timeticks)

 Properties

 

Instance for the SNMP object

$_snmp 

Default

null

 Constants

 

OID_SYSTEM_CONTACT

OID_SYSTEM_CONTACT = '.1.3.6.1.2.1.1.4.0' 
 

OID_SYSTEM_DESCRIPTION

OID_SYSTEM_DESCRIPTION = '.1.3.6.1.2.1.1.1.0' 
 

OID_SYSTEM_LOCATION

OID_SYSTEM_LOCATION = '.1.3.6.1.2.1.1.6.0' 
 

OID_SYSTEM_NAME

OID_SYSTEM_NAME = '.1.3.6.1.2.1.1.5.0' 
 

OID_SYSTEM_OBJECT_ID

OID_SYSTEM_OBJECT_ID = '.1.3.6.1.2.1.1.2.0' 
 

OID_SYSTEM_SERVICES

OID_SYSTEM_SERVICES = '.1.3.6.1.2.1.1.7.0' 
 

OID_SYSTEM_UPTIME

OID_SYSTEM_UPTIME = '.1.3.6.1.2.1.1.3.0'