note 76827 added to function.snmp-set-valueretrieval
| From: | MikhailD at osu1 dot php dot net | Date: | Wed, 01 Aug 2007 12:26:30 +0000 |
| Subject: | note 76827 added to function.snmp-set-valueretrieval | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-129098@lists.php.net to get a copy of this message | ||
Sample is swow Interface status.
(.iso.org.dod.internet.mgmt.mib-2.
interfaces.ifTable.ifEntry.ifAdminStatus)
Possible values for this request from MIB:
Enum(integer): up (1), down (2), testing (3)
<?php
//snmp_set_quick_print(0); // is default
$strIP = "10.1.1.1"; $strComm = "public";
$strOID = ".1.3.6.1.2.1.2.2.1.7.1";
echo "\n Default valueretrieval with snmp_set_quick_print(0)";
echo " snmp_get_valueretrieval = SNMP_VALUE_LIBRARY";
echo ", retrieved value " . snmpget($strIP, $strComm, $strOID);
snmp_set_valueretrieval(SNMP_VALUE_LIBRARY);
echo "\n SNMP_VALUE_LIBRARY " . snmp_get_valueretrieval();
echo ", retrieved value " . snmpget($strIP, $strComm, $strOID);
snmp_set_valueretrieval(SNMP_VALUE_PLAIN);
echo "\n SNMP_VALUE_PLAIN " . snmp_get_valueretrieval();
echo ", retrieved value " . snmpget($strIP, $strComm, $strOID);
snmp_set_quick_print(1);
echo "\n Default valueretrieval snmp_set_quick_print(0) " ;
snmp_set_valueretrieval(SNMP_VALUE_LIBRARY);
echo "\n SNMP_VALUE_LIBRARY " . snmp_get_valueretrieval();
echo ", retrieved value " . snmpget($strIP, $strComm, $strOID);
snmp_set_valueretrieval(SNMP_VALUE_PLAIN);
echo "\n SNMP_VALUE_PLAIN " . snmp_get_valueretrieval();
echo ", retrieved value " . snmpget($strIP, $strComm, $strOID);
?>
Results:
Default valueretrieval with snmp_set_quick_print(0)
snmp_get_valueretrieval = SNMP_VALUE_LIBRARY,
retrieved value up(1)
SNMP_VALUE_LIBRARY 0, retrieved value up(1)
SNMP_VALUE_PLAIN 1, retrieved value 1
Default valueretrieval snmp_set_quick_print(0)
SNMP_VALUE_LIBRARY 0, retrieved value up
SNMP_VALUE_PLAIN 1, retrieved value 1
----
Server IP: 195.54.192.44
Probable Submitter: 82.198.190.51
----
Manual Page -- http://www.php.net/manual/en/function.snmp-set-valueretrieval.php
Edit -- https://master.php.net/note/edit/76827
Del: integrated -- https://master.php.net/note/delete/76827/integrated
Del: useless -- https://master.php.net/note/delete/76827/useless
Del: bad code -- https://master.php.net/note/delete/76827/bad+code
Del: spam -- https://master.php.net/note/delete/76827/spam
Del: non-english -- https://master.php.net/note/delete/76827/non-english
Del: in docs -- https://master.php.net/note/delete/76827/in+docs
Del: other reasons-- https://master.php.net/note/delete/76827
Reject -- https://master.php.net/note/reject/76827
Search -- https://master.php.net/manage/user-notes.php