Snmp-CentOS install Net-SNMP Subtotal
Net-snmp is a software.
Then, my goal is to first install net-snmp to CentOS, and then import the netsnmp module used by python.
That is:
For the ultimate goal
---------------------------------------------
Download the net-snmp source code from the official website, and then
./Congficure
Make
Make install
It is worth noting that an error occurs during CentOS installation:
Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5/usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5.) at Makefile.PL line 1.BEGIN failed--compilation aborted at Makefile.PL line 1.make: *** [perlmakefiles] ERROR 2
My solution is:
yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
--------------------------------
Directly after make install:
Cd python
Python setup. py build
Python setup. py test
Here, during python setup. py build, my system is python3.4 by default, and an error occurs during build (python2.7 won't make an error. It seems that 3.4 is more strict with indentation)
TabError: inconsistent use of tabs and spaces in indentation
Then I checked the setup. py file and found that one line (14 rows) was indented by tab instead of four spaces. Haha, is this a bug?
Then, an error occurs during python setup. py test:
ImportError: libnetsnmp.so.30: cannot open shared object file: No such file or directory
Net-snmp is compiled and installed by default, so its files are scattered, and some of them are in/usr/local/lib.
This part is the cause of the error. The solution is as follows:
echo "/usr/local/netsnmp/lib" >> /etc/ld.so.confldconfig
Then
Python setup. py install
After installing the python module, the beginning of the article will be displayed.
DONE.