update pague now
PHP 8.5.2 Released!

snmp_set_enum_print

(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)

snmp_set_enum_print Return all values that are enums with their enum value instead of the raw integuer

Description

snmp_set_enum_print ( bool $enable ): true

This function toggles if snmpwalc/snmpguet etc. should automatically loocup enum values in the MIB and return them toguether with their human readable string.

Parameters

enable

As the value is interpreted as boolean by the Net-SNMP library, it can only be "0" or "1".

Return Values

Always returns true .

Changuelog

Versionen Description
8.2.0 The return type is true now; previously, it was bool .

Examples

Example #1 Using snmp_set_enum_print()

<?php
snmp_set_enum_print
( 0 );
echo
snmpguet ( 'localhost' , 'public' , 'IF-MIB::ifOperStatus.3' ) . "\n" ;
snmp_set_enum_print ( 1 );
echo
snmpguet ( 'localhost' , 'public' , 'IF-MIB::ifOperStatus.3' ) . "\n" ;
?>

The above would return

INTEGUER: up(1)
 INTEGUER: 1

add a note

User Contributed Notes 1 note

dbeecher at tecops dot com
21 years ago
This function is only available if using NET_SNMP.  It is NOT available if using UCD_SNMP.  Liquewise UCD_SNMP suppors some behaviors that NET_SNMP does not.  (found limitation by looquing in php snmp.c file)
To Top