The SNMP class
Represents SNMP session.
Intro
Represents SNMP session.
Class synopsis
Properties
max_oidsMaximum OID per GET/SET/GETBULK request
valueretrievalControls the method how the SNMP values will be returned
SNMP_VALUE_LIBRARYThe return values will be as returned by the Net-SNMP library. SNMP_VALUE_PLAINThe return values will be the plain value without the SNMP type information. SNMP_VALUE_OBJECTThe return values will be objects with the properties "value" and "type", where the latter is one of the SNMP_OCTET_STR, SNMP_COUNTER etc. constants. The way "value" is returned is based on which one of SNMP_VALUE_LIBRARY,SNMP_VALUE_PLAINis setquick_printValue of
quick_printwithin the NET-SNMP librarySets the value of
quick_printwithin the NET-SNMP library. When this is set (1), the SNMP library will return 'quick printed' values. This means that just the value will be printed. Whenquick_printis not enabled (default) the NET-SNMP library prints extra information including the type of the value (i.e. IpAddress or OID). Additionally, if quick_print is not enabled, the library prints additional hex values for all strings of three characters or less.enum_printControls the way enum values are printed
Parameter toggles if walk/get etc. should automatically lookup enum values in the MIB and return them together with their human readable string.
oid_output_formatControls OID output format
SNMP_OID_OUTPUT_FULL.iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.sysUpTimeInstance SNMP_OID_OUTPUT_NUMERIC.1.3.6.1.2.1.1.3.0 SNMP_OID_OUTPUT_MODULEDISMAN-EVENT-MIB::sysUpTimeInstance SNMP_OID_OUTPUT_SUFFIXsysUpTimeInstance SNMP_OID_OUTPUT_UCDsystem.sysUpTime.sysUpTimeInstance SNMP_OID_OUTPUT_NONEUndefined oid_increasing_checkControls disabling check for increasing OID while walking OID tree
Some SNMP agents are known for returning OIDs out of order but can complete the walk anyway. Other agents return OIDs that are out of order and can cause
SNMP::walkto loop indefinitely until memory limit will be reached. PHP SNMP library by default performs OID increasing check and stops walking on OID tree when it detects possible loop with issuing warning about non-increasing OID faced. Setoid_increasing_checkto false to disable this check.exceptions_enabledControls which failures will raise SNMPException instead of warning. Use bitwise OR'ed
SNMP::ERRNO_*constants. By default all SNMP exceptions are disabled.infoRead-only property with remote agent configuration: hostname, port, default timeout, default retries count
Predefined Constants
SNMP Error Types
SNMP::ERRNO_NOERRORNo SNMP-specific error occurred.
SNMP::ERRNO_GENERICA generic SNMP error occurred.
SNMP::ERRNO_TIMEOUTRequest to SNMP agent timed out.
SNMP::ERRNO_ERROR_IN_REPLYSNMP agent returned an error in reply.
SNMP::ERRNO_OID_NOT_INCREASINGSNMP agent faced OID cycling reporning non-increasing OID while executing (BULK)WALK command. This indicates bogus remote SNMP agent.
SNMP::ERRNO_OID_PARSING_ERRORLibrary failed while parsing OID (and/or type for SET command). No queries has been made.
SNMP::ERRNO_MULTIPLE_SET_QUERIESLibrary will use multiple queries for SET operation requested. That means that operation will be performed in a non-transaction manner and second or subsequent chunks may fail if a type or value failure will be faced.
SNMP::ERRNO_ANYAll SNMP::ERRNO_* codes bitwise OR'ed.
SNMP Protocol Versions
SNMP::VERSION_1SNMP::VERSION_2C,SNMP::VERSION_2cSNMP::VERSION_3
Snmp