Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observium - Not finding MIBs modules. "Cannot find module (SNMPv2-MIB): At line 1 in (none) [etc]" #1510

Closed
JedMeister opened this issue Sep 15, 2020 · 2 comments · Fixed by turnkeylinux-apps/observium#16
Milestone

Comments

@JedMeister
Copy link
Member

JedMeister commented Sep 15, 2020

As reported in the forums when running Observium,

root@observium /opt/observium# ./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)

So something is clearly not right...

After a ton of researching, reading and trial and error, I think I've worked it out. At least I've worked out how to stop the error messages (without removing php-snmp modules as some people suggested on Stack Overflow - sure it stops the error, but then Observium won't work at all...).

It turns out that the default snmp.conf that we ship with has a missing +. This sed line will fix it:

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

It's actually not necessary to have /opt/observium/mibs in there at all, we always call the mib directories directly, and there's nothing usable in that directory without specifying subdirectories. /etc/snmp.conf should probably be left as default.

The difference between the + and not is that without the plus it was overwriting the hardcoded directory, with the plus it doesn't.

The error is just because an snmp command is being called without arguments, and it's compiled to expect the default snmp mibs in a certain place. so long as these are installed, it's fine.

You /could/ put :

mibdirs /opt/observium/mibs/rfc:/opt/observium/mibs/net-snmp

Those would be our versions of the RFC and Net-SNMP "standard" mibs, which may or may not be newer than the ones in the distro, but since there's no real difference and it's an unnecessary change, probably better to just ship with the distro's default snmp.conf.

@JedMeister
Copy link
Member Author

@adamathefrog - Thanks so much for your input here (and apologies for my slow response...)! We'll follow your suggest for the next release! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants