SNMP
class SNMP (View source)
Represents SNMP session.
Constants
VERSION_1 |
|
VERSION_2c |
|
VERSION_2C |
|
VERSION_3 |
|
ERRNO_NOERROR |
|
ERRNO_ANY |
|
ERRNO_GENERIC |
|
ERRNO_TIMEOUT |
|
ERRNO_ERROR_IN_REPLY |
|
ERRNO_OID_NOT_INCREASING |
|
ERRNO_OID_PARSING_ERROR |
|
ERRNO_MULTIPLE_SET_QUERIES |
|
Properties
int | $max_oids | ||
int | $valueretrieval | ||
bool | $quick_print | ||
bool | $enum_print | ||
int | $oid_output_format | ||
bool | $oid_increasing_check | ||
int | $exceptions_enabled | ||
array | $info |
Methods
__construct(int $version, string $hostname, string $community, int $timeout = 1000000, int $retries = 5)
Creates SNMP instance representing session to remote SNMP agent
bool
close()
Close SNMP session
bool
setSecurity(string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, string $contextName, string $contextEngineID)
Configures security-related SNMPv3 session parameters
mixed
get(mixed $object_id, bool $preserve_keys = false)
Fetch an SNMP object
mixed
getnext(mixed $object_id)
Fetch an SNMP object which follows the given object id
array|false
walk(string $object_id, bool $suffix_as_keys = false, int $max_repetitions, int $non_repeaters)
Fetch SNMP object subtree
bool
set(string $object_id, mixed $type, mixed $value)
Set the value of an SNMP object
int
getErrno()
Get last error code
string
getError()
Get last error message
Details
__construct(int $version, string $hostname, string $community, int $timeout = 1000000, int $retries = 5)
Since: 5.4
Creates SNMP instance representing session to remote SNMP agent
bool
close()
Since: 5.4
Close SNMP session
bool
setSecurity(string $sec_level, string $auth_protocol, string $auth_passphrase, string $priv_protocol, string $priv_passphrase, string $contextName, string $contextEngineID)
Since: 5.4
Configures security-related SNMPv3 session parameters
mixed
get(mixed $object_id, bool $preserve_keys = false)
Since: 5.4
Fetch an SNMP object
mixed
getnext(mixed $object_id)
Since: 5.4
Fetch an SNMP object which follows the given object id
array|false
walk(string $object_id, bool $suffix_as_keys = false, int $max_repetitions, int $non_repeaters)
Since: 5.4
Fetch SNMP object subtree
bool
set(string $object_id, mixed $type, mixed $value)
Since: 5.4 <p>When count of OIDs in object_id array is greater than
max_oids object property set method will have to use multiple queries
to perform requested value updates. In this case type and value checks
are made per-chunk so second or subsequent requests may fail due to
wrong type or value for OID requested. To mark this a warning is
raised when count of OIDs in object_id array is greater than max_oids.
When count of OIDs in object_id array is greater than max_oids object property set method will have to use multiple queries to perform requested value updates. In this case type and value checks are made per-chunk so second or subsequent requests may fail due to wrong type or value for OID requested. To mark this a warning is raised when count of OIDs in object_id array is greater than max_oids.</p>
Set the value of an SNMP object
int
getErrno()
Since: 5.4
Get last error code
string
getError()
Since: 5.4
Get last error message