SNMP::getFetch an SNMP object Description
public mixed SNMP::get
( mixed
$object_id
[, bool $preserve_keys = false
] )
Fetch an SNMP object specified in
Parameters
If
Return Values
Returns SNMP objects requested as string or array
depending on Errors/Exceptions
This method does not throw any exceptions by default.
To enable throwing an SNMPException exception when some of library errors occur
the SNMP class parameter ExamplesExample #1 Single SNMP object Single SNMP object may be requested in two ways: as string resulting string return value or as single-element array with associative array as output.
<?php The above example will output something similar to: STRING: Test server Array ( [SNMPv2-MIB::sysDescr.0] => STRING: Test server ) Example #2 Multiple SNMP objects
$session = new SNMP(SNMP::VERSION_1, "127.0.0.1", "public"); The above example will output something similar to: Array ( [SNMPv2-MIB::sysDescr.0] => STRING: Test server [SNMPv2-MIB::sysName.0] => STRING: myhost.nodomain ) See Also
|