超越PHP PHP动态 | 经典文章 | CLASS | 相关下载 | 常见问题 | FORUM | WIKI | 在线手册
Site search:    
<swf_viewportsnmp_get_quick_print>
Last updated: Fri, 22 Jun 2007

CIX. SNMP 函数库

需求

为了在 Unix 中使用 SNMP 函数库,您需要安装 UCD SNMPNET-SNMP 包。在 Windows 中,这些函数只能用于 NT,而不能用于 Win95/98。

安装

重点:为了使用 UCD SNMP 包,您需要在编译之前将 NO_ZEROLENGTH_COMMUNITY 定义为 1。 在 configuring UCD SNMP 之后,编辑 config.h,查找 NO_ZEROLENGTH_COMMUNITY,将 #define 所在行的注释去掉。修改后应该类似这样:
#define NO_ZEROLENGTH_COMMUNITY 1
然后使用 --with-snmp[=DIR] 选项编译 PHP。

如果您在联合 SNMP 命令时看到奇怪的分段错误,则不要继续上述的指令。如果您不想重新编译 UCD SNMP,可以使用 --enable-ucd-snmp-hack 开关编译 PHP,此开关将避开上述错误。

Windows 版本在目录 mibs 中包含了支持 SNMP 的文件。此目录应该移到 DRIVE:\usr\mibs,其中 DRIVE 是安装 PHP 所在的驱动器名,例如:c:\usr\mibs

运行时配置

该扩展模块未定义任何设置指令。

预定义常量

该扩展模块未定义任何常量。

目录
snmp_get_quick_print --  返回 UCD 库中 quick_print 设置的当前值
snmp_get_valueretrieval --  Return the method how the SNMP values will be returned
snmp_read_mib --  Reads and parses a MIB file into the active MIB tree
snmp_set_enum_print --  Return all values that are enums with their enum value instead of the raw integer
snmp_set_oid_numeric_print --  Return all objects including their respective object id within the specified one
snmp_set_quick_print --  设置 UCD SNMP 库中 quick_print 的值
snmp_set_valueretrieval --  Specify the method how the SNMP values will be returned
snmpget -- 获取一个 SNMP 对象
snmpgetnext --  Fetch a SNMP object
snmprealwalk --  返回指定的所有对象,包括它们各自的对象 ID
snmpset -- 设置一个 SNMP 对象
snmpwalk -- 从代理返回所有的 SNMP 对象
snmpwalkoid -- 查询关于网络实体的信息树



add a note add a note User Contributed Notes
SNMP 函数库
thug at wolf359 dot cjb dot net
23-Apr-2002 03:06
Just a quick note on PHP SNMP instalation on Windows machines (IIS 5.x / Win2k SP2 etc...)
I had installed PHP into C:\PHP.. (standard stuff eh?)

Whilst I had followed the instructions for the installation of SNMP (put php_snmp.dll in extension_dir, uncomment entry in php.ini and all mib files located on the same drive where php was installed  (in this case c:\usr\mibs right?) I still ran into trouble like "Cannot find module (IP-MIB): At line 0 in (none)..." appearing on the bottom of every php that page I was viewing which existed on a drive other than C:\ drive...

It seams that the mibs dir (and content thereof) have to be located on every volume where a php file will be executed from.

For example :-
If you have a php file as "C:\INETPUB\WWWROOT\snmp1.php" then the coresponding "C:\USR\MIBS\*.*" has to be present (as mentioned in the install.txt).

Now here comes the catch...

If you have a "D:\INETPUB\PHPROOT\snmp1.php" file, then a copy of the mib files have to be in "D:\USR\MIBS\*.*" as well (the same mib files that are on the C:\ drive and same basic location <drive>:\USR\MIBS).

(Or in short : Copy the C:\USR dir (inc mibs dir) to *every* drive you intend to have .php files accessed from. Done!)

Hope this helps other PHParians.

Keep up the *Great* work!!!

<swf_viewportsnmp_get_quick_print>
 Last updated: Fri, 22 Jun 2007
view source | feedback | send page | sitemap | aboutus   
Copyright ® 2002-2003 PHPE.NET. All rights reserved
Last updated:2002-11-22