php-doc-en/reference/snmp/functions/snmp-set-enum-print.xml
2011-03-02 23:25:52 +00:00

94 lines
2.3 KiB
XML

<?xml version='1.0' encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.snmp-set-enum-print" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>snmp_set_enum_print</refname>
<refpurpose>
Return all values that are enums with their enum value instead of the raw integer
</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>snmp_set_enum_print</methodname>
<methodparam><type>int</type><parameter>enum_print</parameter></methodparam>
</methodsynopsis>
<para>
This function toggles if snmpwalk/snmpget etc. should automatically lookup enum values
in the MIB and return them together with their human readable string.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>enum_print</parameter></term>
<listitem>
<para>
As the value is interpreted as boolean by the Net-SNMP library, it can only be "0" or "1".
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Using <function>snmp_set_enum_print</function></title>
<programlisting role="php">
<![CDATA[
<?php
snmp_set_enum_print(0);
echo snmpget('localhost', 'public', 'IF-MIB::ifOperStatus.3') . "\n";
snmp_set_enum_print(1);
echo snmpget('localhost', 'public', 'IF-MIB::ifOperStatus.3') . "\n";
?>
]]>
</programlisting>
</example>
</para>
<para>
The above would return
<![CDATA[
INTEGER: up(1)
INTEGER: 1
]]>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
<function>snmp_set_enum_print</function> is only available when using
the UCD SNMP library. This function is not available when using the
Windows SNMP library.
</para>
</note>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->