Luis Olavarrieta's picture

Hi to everyone:

 

Everytime i run a php command from the console i get this error message:

 

root@visum /opt/observium# php discovery.php -u

MIB search path: /opt/observium/mibs

Cannot find module (SNMPv2-MIB): At line 1 in (none)

Cannot find module (IF-MIB): At line 1 in (none)

Cannot find module (IP-MIB): At line 1 in (none)

Cannot find module (TCP-MIB): At line 1 in (none)

Cannot find module (UDP-MIB): At line 1 in (none)

Cannot find module (HOST-RESOURCES-MIB): At line 1 in (none)

Cannot find module (NOTIFICATION-LOG-MIB): At line 1 in (none)

Cannot find module (DISMAN-EVENT-MIB): At line 1 in (none)

Cannot find module (DISMAN-SCHEDULE-MIB): At line 1 in (none)

Cannot find module (HOST-RESOURCES-TYPES): At line 1 in (none)

Cannot find module (MTA-MIB): At line 1 in (none)

Cannot find module (NETWORK-SERVICES-MIB): At line 1 in (none)

Cannot find module (UCD-DISKIO-MIB): At line 1 in (none)

Cannot find module (UCD-DLMOD-MIB): At line 1 in (none)

Cannot find module (LM-SENSORS-MIB): At line 1 in (none)

Cannot find module (UCD-SNMP-MIB): At line 1 in (none)

Cannot find module (UCD-DEMO-MIB): At line 1 in (none)

Cannot find module (SNMP-TARGET-MIB): At line 1 in (none)

Cannot find module (NET-SNMP-AGENT-MIB): At line 1 in (none)

Cannot find module (SNMP-MPD-MIB): At line 1 in (none)

Cannot find module (SNMP-USER-BASED-SM-MIB): At line 1 in (none)

Cannot find module (SNMP-FRAMEWORK-MIB): At line 1 in (none)

Cannot find module (SNMP-VIEW-BASED-ACM-MIB): At line 1 in (none)

Cannot find module (SNMP-COMMUNITY-MIB): At line 1 in (none)

Cannot find module (IPV6-ICMP-MIB): At line 1 in (none)

Cannot find module (IPV6-MIB): At line 1 in (none)

Cannot find module (IPV6-TCP-MIB): At line 1 in (none)

Cannot find module (IPV6-UDP-MIB): At line 1 in (none)

Cannot find module (IP-FORWARD-MIB): At line 1 in (none)

Cannot find module (NET-SNMP-PASS-MIB): At line 1 in (none)

Cannot find module (NET-SNMP-EXTEND-MIB): At line 1 in (none)

Cannot find module (SNMP-NOTIFICATION-MIB): At line 1 in (none)

Cannot find module (SNMPv2-TM): At line 1 in (none)

Cannot find module (NET-SNMP-VACM-MIB): At line 1 in (none)

__________________

 

please advice

Forum: 
Tags: 
Jeremy Davis's picture

I was able to reporoduce this straight away, so thanks so much for reporting.

It actually took me ages to work out what the issue was. But it seems that there are a few MIBs pre-compiled into the snmp software. But our default config only uses the Observium provided MIBs. The conf file (/etc/snmp/snmp.conf) we ship be default looks like this:

mibdirs /opt/observium/mibs

The fix is to add the Observium provided MIBs to the default, rather than replace them. To do that, the conf file needs a '+' at the start of the path to add. I.e.:

mibdirs +/opt/observium/mibs

You can manually edit the conf file, or just run the sed command below (run as root):

sed -i "s|mibdirs /opt/observium/mibs|mibdirs +/opt/observium/mibs|" /etc/snmp/snmp.conf

After that:

root@observium /opt/observium# ./discovery.php -u

  ___   _                              _
 / _ \ | |__   ___   ___  _ __ __   __(_) _   _  _ __ ___
| | | || '_ \ / __| / _ \| '__|\ \ / /| || | | || '_ ` _ \
| |_| || |_) |\__ \|  __/| |    \ V / | || |_| || | | | | |
 \___/ |_.__/ |___/ \___||_|     \_/  |_| \__,_||_| |_| |_|
                     Observium Community Edition 19.8.10000
                                   http://www.observium.org

-- Database is up to date.

I've opened an issue and I'll apply the fix to the build code and rebuild soonish.

Please post back and confirm that my fix works for you too.

Luis Olavarrieta's picture

is working!!! thanks!!!

Jeremy Davis's picture

Awesome! :)

Luis Olavarrieta's picture

Jeremy, i just found this new error:

 

root@observium /opt/observium# php check-errors.php 

PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 16384 bytes) in /opt/observium/includes/db/mysqli.inc.php on line 397

 

line 397 is   

 

      $rows = mysqli_fetch_all($result, MYSQLI_ASSOC);

 

Please advice!

Jeremy Davis's picture

It looks like when your server was loading all results from it's database, it used too much RAM. As per the message, it tried to allocate another ~16MB but that exceeded the allowed memory usage (of ~530MB).

My assumption is that it hit the limit allowed in the php.ini file. Note that there are 2 files, one for Apache and one for CLI. In this case you'll want to edit the CLI file (because when you hit the error you were running from the commandline) but it may pay to double check the Apache limit too.

In a v16.x appliance, the 2 files should be:

/etc/php/7.3/apache2/php.ini
/etc/php/7.3/cli/php.ini

As per the file path, the one you want to edit is the second one and look for the 'memory_limit' line and bump it up higher. It sounds like it's ~500MB currently, but needs to be higher. I would suggest adding an extra 64MB and see how that goes.

Alternatively, if you just wish to temporarily remove the PHP RAM limit while you run the command you're trying to run, you should be able do it ad hoc like this:

php -d memory_limit=-1 /opt/observium/check-errors.php

Add new comment