You are here: Home // SNMP functions
snmp_set_quick_print
(PHP3 >= 3.0.8, PHP4 >= 4.0b2)
snmp_set_quick_print – Set the value of quick_print within the UCD SNMP library.
Description
void snmp_set_quick_print (boolean quick_print)
Sets the value of quick_print within the UCD SNMP library. When this is set (1), the SNMP library will return ‘quick printed’ values. This means that just the value will be printed.
snmp_get_quick_print
(PHP3 >= 3.0.8, PHP4 >= 4.0b2)
snmp_get_quick_print – Fetch the current value of the UCD library’s quick_print setting
Description
boolean snmp_get_quick_print (void )
Returns the current value stored in the UCD Library for quick_print. quick_print is off by default.
$quickprint = snmp_get_quick_print();
Above function call would return false if quick_print
snmpwalkoid
(PHP3 >= 3.0.8, PHP4 >= 4.0b2)
snmpwalkoid – Query for a tree of information about a network entity
Description
array snmpwalkoid (string hostname, string community, string object_id [, int timeout [, int retries]])
Returns an associative array with object ids and their respective object value starting from the object_id as root and false on error.
snmpwalkoid() function is
snmpwalk
(PHP3 , PHP4 )
snmpwalk – Fetch all the SNMP objects from an agent
Description
array snmpwalk (string hostname, string community, string object_id [, int timeout [, int retries]])
Returns an array of SNMP object values starting from the object_id() as root and false on error.
snmpwalk() function is used to read all the values from an SNMP agent specified by the hostname. Community
snmpset
(PHP3 >= 3.0.12, PHP4 >= 4.0b2)
snmpset – Set an SNMP object
Description
bool snmpset (string hostname, string community, string object_id, string type, mixed value [, int timeout [, int retries]])
Sets the specified SNMP object value, returning true on success and false on error.
The snmpset() function is used to set the value of an SNMP object specified by the object_id.
snmpget
(PHP3 , PHP4 )
snmpget – Fetch an SNMP object
Description
string snmpget (string hostname, string community, string object_id [, int timeout [, int retries]])
Returns SNMP object value on success and false on error.
The snmpget() function is used to read the value of an SNMP object specified by the object_id. SNMP agent is specified by the hostname and the read community is
SNMP functions
In order to use the SNMP functions on Unix you need to install the UCD SNMP package. On Windows these functions are only available on NT and not on Win95/98.
Important: In order to use the UCD SNMP package, you need to define NO_ZEROLENGTH_COMMUNITY to 1 before compiling it. After configuring UCD SNMP, edit config.h and search for NO_ZEROLENGTH_COMMUNITY. Uncomment the #define line.















































