Lines Matching refs:session
20 $session = new SNMP(SNMP::VERSION_2c, $hostname, $community, $timeout, $retries);
21 var_dump(@$session->get('.1.3.6.1.2.1.1.1.0'));
22 var_dump($session->getErrno() == SNMP::ERRNO_NOERROR);
23 var_dump($session->getError());
24 $session->close();
27 $session = new SNMP(SNMP::VERSION_2c, $hostname, 'timeout_community_432', $timeout, $retries);
28 $session->valueretrieval = SNMP_VALUE_LIBRARY;
29 var_dump(@$session->get('.1.3.6.1.2.1.1.1.0'));
30 var_dump($session->getErrno() == SNMP::ERRNO_TIMEOUT);
31 var_dump($session->getError());
32 $session->close();
35 $session = new SNMP(SNMP::VERSION_2c, $hostname, $community, $timeout, $retries);
36 var_dump(@$session->get('.1.3.6.1.2.1.1.1.110'));
37 var_dump($session->getErrno() == SNMP::ERRNO_ERROR_IN_REPLY);
38 var_dump($session->getError());
39 $session->close();
42 $session = new SNMP(SNMP::VERSION_3, $hostname, 'somebogususer', $timeout, $retries);
43 $session->setSecurity('authPriv', 'MD5', $auth_pass, 'AES', $priv_pass);
44 var_dump(@$session->get('.1.3.6.1.2.1.1.1.0'));
45 var_dump($session->getErrno() == SNMP::ERRNO_GENERIC);
46 var_dump($session->getError());
47 var_dump(@$session->get(array('.1.3.6.1.2.1.1.1.0')));
48 $session->close();
52 $session = new SNMP(SNMP::VERSION_2c, $hostname, $community, $timeout, $retries);
53 var_dump(@$session->get('.1.3.6.1.2..1.1.1.0'));
54 var_dump($session->getErrno() == SNMP::ERRNO_OID_PARSING_ERROR);
55 var_dump($session->getError());
56 $session->close();
58 $session = new SNMP(SNMP::VERSION_2c, $hostname, $community, $timeout, $retries);
59 var_dump(@$session->get(array('.1.3.6.1.2.1.1.1.0', '.1.3.6.1.2..1.1.1.0')));
60 var_dump($session->getErrno() == SNMP::ERRNO_OID_PARSING_ERROR);
61 var_dump($session->getError());
62 $session->close();
64 $session = new SNMP(SNMP::VERSION_2c, $hostname, $community, $timeout, $retries);
65 var_dump(@$session->walk('.1.3.6.1.2..1.1'));
66 var_dump($session->getErrno() == SNMP::ERRNO_OID_PARSING_ERROR);
67 var_dump($session->getError());
68 $session->close();
70 $session = new SNMP(SNMP::VERSION_3, $hostname, $rwuser, $timeout, $retries);
71 $session->setSecurity('authPriv', 'MD5', $auth_pass, 'AES', $priv_pass);
73 var_dump(@$session->set($oid1, 'q', 'blah'));
74 var_dump($session->getErrno() == SNMP::ERRNO_OID_PARSING_ERROR);
75 var_dump($session->getError());
80 $session = new SNMP(SNMP::VERSION_3, $hostname, $rwuser, $timeout, $retries);
81 $session->setSecurity('authPriv', 'MD5', $auth_pass, 'AES', $priv_pass);
82 $session->max_oids = 1;
83 $oldvalue1 = $session->get($oid1);
85 $oldvalue2 = $session->get($oid2);
87 $z = @$session->set(array($oid1, $oid2), array('s','s'), array($newvalue1, $newvalue2));
89 var_dump($session->getErrno() == SNMP::ERRNO_MULTIPLE_SET_QUERIES);
90 var_dump($session->getError());
91 var_dump(($session->get($oid1) === $newvalue1));
92 var_dump(($session->get($oid2) === $newvalue2));
93 $z = @$session->set(array($oid1, $oid2), array('s','s'), array($oldvalue1, $oldvalue2));
95 var_dump($session->getErrno() == SNMP::ERRNO_MULTIPLE_SET_QUERIES);
96 var_dump($session->getError());
97 var_dump(($session->get($oid1) === $oldvalue1));
98 var_dump(($session->get($oid2) === $oldvalue2));
99 var_dump($session->close());