1。下载netsnmp
官网http://www.net-snmp.org/
目前最新版本是5.4.1,交叉编译有问题。项目使用版本5.2.4。
2。编译安装
./configure --with-cc=mips-linux-gcc --host=mips-linux --with-ar=mips-linux-ar /
--disable-dlopen --target=mips-linux --disable-dlclose --disable-dlerror --enable-mini-agent /
--with-endianness=little --with-ld=mips-linux-ld /
--with-openssl=no --with-cflags="-O2 -static" /
--oldincludedir=/usr/local --prefix=/usr/local --exec-prefix=/usr/local /
--with-persistent-directory=/usr/local
make
make install //这一条命令要用root用户执行
文件太大,strip一下。mips-linux-strip snmpd
下面出自官方文档:
QUICK INSTRUCTIONS
==================
1) Run ./configure
(type "./configure --help" for a quick usage summary.)
(--prefix=PATH will change the default /usr/local installation path.)
(see "Compilers and Options" on changing the compiler to use)
2) Optionally edit include/net-snmp/net-snmp-config.h
(due to prompting done by the configure script, this is very rarely
necessary.)
3) make
4) Run the next command as root:
5) make install
6) configure the agent
(either using 'snmpconf' or by crafting an snmpd.conf file manually.
The file 'EXAMPLE.conf' may be a suitable starting point)
Note: By default, everything will be installed in /usr/local.
(see below for more instructions)
3。snmpd
将 EXAMPLE.conf文件复制,并重命名为 snmpd.conf
./snmpd -c snmpd.conf & //运行snmpd
CONFIGURATION FILES
snmpd checks for the existence of and parses the following files:
4.