(PHP 5 >= 5.4.0)
SNMP::__construct — Creates SNMP instance representing session to remote SNMP agent
The function description goes here.
SNMP protocol version
The SNMP agent.
The purpuse of community is SNMP version specific:
SNMP::VERSION_1 | SNMP community |
SNMP::VERSION_2C | SNMP community |
SNMP::VERSION_3 | SNMPv3 securityName |
The number of microseconds until the first timeout.
The number of retries in case timeout occurs.
Returns SNMP object representing remote SNMP agent.
SNMP::__construct() throws an exception when parameters count or types are wrong or unknown SNMP protocol version specified.
Example #1 Fetching sysLocation
<?php
$session = new SNMP(SNMP::VERSION_1, "127.0.0.1", "public");
$sysdescr = $session->get("sysDescr.0");
echo "$sysdescr\n";
?>
The above example will output something similar to:
STRING: Test server