You are here
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
Thanks for reporting... I could reproduce.
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:
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.:
You can manually edit the conf file, or just run the sed command below (run as root):
After that:
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.
you are such a wizard Harry!!!!
is working!!! thanks!!!
Thanks for confirming! :)
Awesome! :)
Please post the contents of /etc/snmp/snmp.conf
Hi Marco, I edited your post before publishing (fixed the mis-spelling of my name, plus posted your output from your pastebin link).
Could you please give me the outout of your SNMP config file. I.e.:
Also, it shouldn't matter, but perhaps you need to restart Apache to pick up the changes? (I note that I didn't state that you need to do that, so I suspect that you don't, but it can't hurt).
Jeremy, i just found this new
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!
It looks like PHP has run out of RAM.
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:
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:
Did you restart Apache?
Any changes in PHP config require restart (and as in our default config PHP runs as an Apache module, that means restarting Apache).
That should do the trick...
Hmmm, right you are...
I've had a quick look and I can recreate the issue (again) - even on the latest release. Here's what I did to fix it. Hopefully it works for you.
Enable the 'non-free' repo:
Update package lists and install 'snmp-mibs-downloader':
That patches some of the mibs files on install and that seemed to resolve the issue for me?!:
But I also downloaded mibs too:
And all still seems well:
I hope that helps.
PS it turns out that restarting Apache isn't/wasn't required anyway... I guess PHP only calls SNMP as a separate process?!
TBH, I'm not sure?
I'm not sure why their default install works and ours didn't? We do a pretty default install. As for the mibs changes, the snmp-mibs-downloader package page says:
I know that Observium includes a whole heap of mibs (in /opt/observium/mibs/) but AFAIK it also relies on system mibs too.
Anyway, glad that's got you going. Please report back if you have any further issues or questions.
Add new comment