9.11. Netsnmp Tools e moduli python

9.11.1. Install From Sources

Install tools

apt-get install gcc
apt-get install make
apt-get install libperl-dev

Download:

cd /usr/local/src
wget http://downloads.sourceforge.net/project/net-snmp/net-snmp/5.7.2/net-snmp-5.7.2.tar.gz
tar -xzvf net-snmp-5.7.2.tar.gz
cd net-snmp-5.7.2

Compile:

./configure --prefix=/usr/local/net-snmp-5.7.2
make

Install and configure:

make install

cd /usr/local/
ln -s net-snmp-5.7.2 net-snmp
cd bin
ln -s ../net-snmp/bin/* .
cd ../lib/
ln -s ../net-snmp/lib/* .
cd ../sbin/
ln -s ../net-snmp/sbin/* .
cd ../include/
ln -s ../net-snmp/include/* .
cd ../share/man
for i in 1 3 5 8; do mkdir -p man$i; cd man$i; ln -s ../../../net-snmp/share/man/man$i/* .; cd -; done

Then execute ldconfig to update your dynamic linker configuration.

Install python modules:

cd /usr/local/src/net-snmp-5.7.2/python

python setup.py build

python setup.py install

To test module installation exit from current directory and try:

# python
Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import netsnmp
>>> CTRL+D

You must exit from building directory because there is a netsnmp directory in it.

If you get and error try to install from the python directory in the source tree with:

# python setup.py install  --install-platlib /path/to/your/lib/python2.x/site-packages/