SNMP::getFetch an SNMP object Description
public mixed SNMP::get(arraystring
$objectId , bool $preserveKeys = 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.
The above example will output something similar to: STRING: Test server Array ( [SNMPv2-MIB::sysDescr.0] => STRING: Test server ) Example #2 Multiple SNMP objects
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
|