mib2c complains with:"/usr/lib/libnetsnmp.so.5: undefined symbol: RAND_bytes" - Solution

"jeff magder" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Before last night I had been experiencing problems getting NetSNMP's mib2c
software to launch.  I searched the web and newsgroups with google, and even
though the question has been posted many times, I didn't  find a good
solution to the problem at first.

Since I did eventually figure it out however, I thought I'd post to this
mailing list to help out others who may experience  this problem in the
future!

The Problem: When running mib2c, you get the following error:

   /usr/lib/libnetsnmp.so.5: undefined symbol: RAND_bytes

Before the solution, let us discuss what this error means!

The error is basically the dynamic linker telling you that the shared object
libnetsnmp.so is referencing a function named RAND_bytes, that cannot be
found.  RAND_bytes belongs to the OpenSSL package.  So first off, make sure
you have the OpenSSL package.  There is a 99% chance you already have the
package, but NetSNMP just can't find it.

So the solution is to:

1) Make sure you have OpenSSL
2) Tell NetSNMP the location of OpenSSL through NetSNMPs configuration
script.
3) Also, Tell NetSNMP to include perl modules.  Mib2c won't run without
them.

Assuming OpenSSL is installed on your system, you can do the above with the
following in the NetSNMP Distribution source directory.

   ./configure --with-openssl=/usr/lib --with-perl-modules

Replace /usr/lib/ with whatever folder contains the libssl.so shared object
library files.  Then run make, make install, and all should be right in the
world again!   You may also want to run "make test" to make sure everythign
else is alright, in case you have other problems that I did not.

I hope this helps others in the future.  Cheers!

- Jeffrey Magder
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.