我已启用SNMP模块尝试模块中的功能.我已将MIBDIRS环境变量设置为我拥有mibs的位置,但我仍然收到这些"无法找到模块"警告:
Cannot find module (IP-MIB): At line 0 in (none) Cannot find module (IF-MIB): At line 0 in (none) Cannot find module (TCP-MIB): At line 0 in (none) Cannot find module (UDP-MIB): At line 0 in (none) Cannot find module (HOST-RESOURCES-MIB): At line 0 in (none) Cannot find module (SNMPv2-MIB): At line 0 in (none) Cannot find module (SNMPv2-SMI): At line 0 in (none) Cannot find module (NOTIFICATION-LOG-MIB): At line 0 in (none) Cannot find module (UCD-SNMP-MIB): At line 0 in (none) Cannot find module (UCD-DEMO-MIB): At line 0 in (none) Cannot find module (SNMP-TARGET-MIB): At line 0 in (none) Cannot find module (NET-SNMP-AGENT-MIB): At line 0 in (none) Cannot find module (DISMAN-EVENT-MIB): At line 0 in (none) Cannot find module (SNMP-VIEW-BASED-ACM-MIB): At line 0 in (none) Cannot find module (SNMP-COMMUNITY-MIB): At line 0 in (none) Cannot find module (UCD-DLMOD-MIB): At line 0 in (none) Cannot find module (SNMP-FRAMEWORK-MIB): At line 0 in (none) Cannot find module (SNMP-MPD-MIB): At line 0 in (none) Cannot find module (SNMP-USER-BASED-SM-MIB): At line 0 in (none) Cannot find module (SNMP-NOTIFICATION-MIB): At line 0 in (none) Cannot find module (SNMPv2-TM): At line 0 in (none)
我知道我已经修好了一次,但我似乎无法再修复它......我还能尝试什么?
我在Windows上.
我在使用php7.1的Ubuntu中遇到了同样的问题,解决方法是安装snmp包
apt-get install snmp
显然,您可以设置2个环境变量.一个是MIBDIRS
所有MIB文件所在的位置.另一个是MIBS
,我相信你要加载哪些SNMP模块.通过设置MIBS
到ALL
,我能摆脱错误的.
打开您的php.ini
并在行中添加一些神奇的分号,如下所示:
extension=php_snmp.dll
它应该看起来像:
;extension=php_snmp.dll
在Linux上,我可以通过将其添加到我的/etc/php5/apache2/conf.d/snmp.ini文件中来解决这些问题。
mibdir = / usr / share / snmp / mibs
mibs =全部