mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
have PARA and SIMPARA like in the other files
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@75140 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
ef757d0d68
commit
9e4c41ce50
1 changed files with 50 additions and 26 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.21 $ -->
|
||||
<!-- $Revision: 1.22 $ -->
|
||||
<reference id="ref.snmp">
|
||||
<title>SNMP functions</title>
|
||||
<titleabbrev>SNMP</titleabbrev>
|
||||
|
@ -7,13 +7,15 @@
|
|||
<partintro>
|
||||
<simpara>
|
||||
In order to use the SNMP functions on Unix you need to install the <ulink url="&url.ucd-snmp;">UCD SNMP</ulink> package. On Windows these functions
|
||||
are only available on NT and not on Win95/98.</simpara>
|
||||
are only available on NT and not on Win95/98.
|
||||
</simpara>
|
||||
|
||||
<simpara>
|
||||
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. It should look like this afterwards:</simpara>
|
||||
#define line. It should look like this afterwards:
|
||||
</simpara>
|
||||
|
||||
<para>
|
||||
<programlisting role="c">
|
||||
|
@ -27,7 +29,8 @@
|
|||
If you see strange segmentation faults in combination with SNMP commands,
|
||||
you did not follow the above instructions. If you do not want to recompile
|
||||
UCD SNMP, you can compile PHP with the --enable-ucd-snmp-hack switch which
|
||||
will work around the misfeature.</simpara>
|
||||
will work around the misfeature.
|
||||
</simpara>
|
||||
|
||||
</partintro>
|
||||
|
||||
|
@ -48,14 +51,16 @@
|
|||
</methodsynopsis>
|
||||
|
||||
<para>
|
||||
Returns SNMP object value on success and &false; on error.</para>
|
||||
Returns SNMP object value on success and &false; on error.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The <function>snmpget</function> function is used to read the
|
||||
value of an SNMP object specified by the
|
||||
<parameter>object_id</parameter>. SNMP agent is specified by the
|
||||
<parameter>hostname</parameter> and the read community is
|
||||
specified by the <parameter>community</parameter> parameter.</para>
|
||||
specified by the <parameter>community</parameter> parameter.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<informalexample>
|
||||
|
@ -90,14 +95,16 @@ $syscontact = snmpget("127.0.0.1", "public", "system.SysContact.0");
|
|||
|
||||
<para>
|
||||
Sets the specified SNMP object value, returning &true; on success
|
||||
and &false; on error.</para>
|
||||
and &false; on error.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The <function>snmpset</function> function is used
|
||||
to set the value of an SNMP object specified by the
|
||||
<parameter>object_id</parameter>. SNMP agent is specified by the
|
||||
<parameter>hostname</parameter> and the read community is specified
|
||||
by the <parameter>community</parameter> parameter.</para>
|
||||
by the <parameter>community</parameter> parameter.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
@ -120,7 +127,8 @@ $syscontact = snmpget("127.0.0.1", "public", "system.SysContact.0");
|
|||
|
||||
<para>
|
||||
Returns an array of SNMP object values starting from the
|
||||
<function>object_id</function> as root and &false; on error.</para>
|
||||
<parameter>object_id</parameter> as root and &false; on error.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<function>snmpwalk</function> function is used to read all the
|
||||
|
@ -139,7 +147,8 @@ $syscontact = snmpget("127.0.0.1", "public", "system.SysContact.0");
|
|||
$a = snmpwalk("127.0.0.1", "public", "");
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample></para>
|
||||
</informalexample>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Above function call would return all the SNMP objects from the
|
||||
|
@ -154,7 +163,8 @@ for ($i=0; $i < count($a); $i++) {
|
|||
}
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample></para>
|
||||
</informalexample>
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
@ -180,18 +190,20 @@ for ($i=0; $i < count($a); $i++) {
|
|||
<para>
|
||||
Returns an associative array with object ids and their respective
|
||||
object value starting from the <parameter>object_id</parameter>
|
||||
as root and &false; on error.</para>
|
||||
as root and &false; on error.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<function>snmpwalkoid</function> function is used to read all
|
||||
object ids and their respective values from an SNMP agent
|
||||
specified by the hostname. Community specifies the read
|
||||
specified by the <parameter>hostname</parameter>. Community specifies the read
|
||||
<parameter>community</parameter> for that agent. A &null;
|
||||
<parameter>object_id</parameter> is taken as the root of the SNMP
|
||||
objects tree and all objects under that tree are returned as an
|
||||
array. If <parameter>object_id</parameter> is specified, all the
|
||||
SNMP objects below that <parameter>object_id</parameter> are
|
||||
returned.</para>
|
||||
returned.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The existence of <function>snmpwalkoid</function> and
|
||||
|
@ -204,7 +216,8 @@ for ($i=0; $i < count($a); $i++) {
|
|||
$a = snmpwalkoid("127.0.0.1", "public", "");
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample></para>
|
||||
</informalexample>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Above function call would return all the SNMP objects from the
|
||||
|
@ -219,7 +232,8 @@ for (reset($a); $i = key($a); next($a)) {
|
|||
}
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample></para>
|
||||
</informalexample>
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
@ -248,21 +262,25 @@ for (reset($a); $i = key($a); next($a)) {
|
|||
$quickprint = snmp_get_quick_print();
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample></para>
|
||||
</informalexample>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Above function call would return &false; if
|
||||
quick_print is off, and &true; if quick_print
|
||||
is on.</para>
|
||||
is on.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<function>snmp_get_quick_print</function> is only available when using
|
||||
the UCD SNMP library. This function is not available when using the
|
||||
Windows SNMP library.</para>
|
||||
Windows SNMP library.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
See: <function>snmp_set_quick_print</function> for a full description
|
||||
of what quick_print does.</para>
|
||||
of what quick_print does.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
@ -287,7 +305,8 @@ $quickprint = snmp_get_quick_print();
|
|||
enabled (default) the UCD SNMP library prints extra information
|
||||
including the type of the value (i.e. IpAddress or OID). Additionally,
|
||||
if quick_print is not enabled, the library prints additional hex values
|
||||
for all strings of three characters or less.</para>
|
||||
for all strings of three characters or less.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Setting quick_print is often used when using the information returned
|
||||
|
@ -304,24 +323,29 @@ $a = snmpget("127.0.0.1", "public", ".1.3.6.1.2.1.2.2.1.9.1");
|
|||
echo "$a<BR>\n";
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample></para>
|
||||
</informalexample>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The first value printed might be: 'Timeticks: (0) 0:00:00.00', whereas
|
||||
with quick_print enabled, just '0:00:00.00' would be printed.</para>
|
||||
with quick_print enabled, just '0:00:00.00' would be printed.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
By default the UCD SNMP library returns verbose values, quick_print is
|
||||
used to return only the value.</para>
|
||||
used to return only the value.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Currently strings are still returned with extra quotes, this will be
|
||||
corrected in a later release.</para>
|
||||
corrected in a later release.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<function>snmp_set_quick_print</function> is only available when using
|
||||
the UCD SNMP library. This function is not available when using
|
||||
the Windows SNMP library.</para>
|
||||
the Windows SNMP library.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
Loading…
Reference in a new issue