PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

snmpget> <snmp_set_quick_print
Last updated: Fri, 22 Aug 2008

view this page in

snmp_set_valueretrieval

(PHP 4 >= 4.3.3, PHP 5)

snmp_set_valueretrieval Specify the method how the SNMP values will be returned

Description

void snmp_set_valueretrieval ( int $method )
Warning

This function is currently not documented; only its argument list is available.



add a note add a note User Contributed Notes
snmp_set_valueretrieval
Mikhail D
01-Aug-2007 03:26
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
david at eder dot us
24-Jun-2004 10:16
It appears that the possible method constants for this function are:

SNMP_VALUE_LIBRARY
SNMP_VALUE_PLAIN
SNMP_VALUE_OBJECT

If you are harvesting data you probably want SNMP_VALUE_PLAIN.

snmpget> <snmp_set_quick_print
Last updated: Fri, 22 Aug 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites