I\'ve enabled the SNMP module was trying to the functions in the module. I have set the MIBDIRS environment variable to where I have my mibs but I\'m still getting these \"
On linux, I was able to fix these by adding this to my /etc/php5/apache2/conf.d/snmp.ini file.
mibdir=/usr/share/snmp/mibs
mibs=all
I've got the same problem in Ubuntu with php7.1 and the solution was installing snmp package
apt-get install snmp
Stumbled upon this migrating older Cacti to Ubuntu 16.
In Ubuntu/Debian package php-snmp
depends on php7.0-snmp
, neither of which come with MIBs or depend on snmp-mibs-downloader
, hence SNMP module ends up being defunct with no MIBs available.
What you should do is install snmp-mibs-downloader
(or equivalent) and let it download all available MIBs and see if that helps. If it doesn't, you might need to adjust mibdirs
in /etc/php/x.x/mods-available/snmp.ini
and/or manually load required MIBs (loading everything via mibs = ALL
would work, but I consider it bad practice).
If no downloader is available, follow @Robin's advice and get MIBs from Net-SNMP
Open your php.ini
and add some magical semicolon at line that look like:
extension=php_snmp.dll
It should look like:
;extension=php_snmp.dll
I just fixed it on my machine here by adding
mibdirs +/var/lib/mibs/iana:/var/lib/mibs/ietf
to /etc/snmp/snmp.conf
.
Faced a similar problem but in Ubuntu -
In /etc/snmp/snmp.conf -
# As the snmp packages come without MIB files due to license reasons, loading
# of MIBs is disabled by default. If you added the MIBs you can reenable
# loading them by commenting out the following line.
#mibs :
So , commenting out the mibs line in this file solved it .