linux net snmp 安装
2009-04-14 22:45
337 查看
LINUX AS 4
MASTER AGENT安装
http://www.net-snmp.com/download.html
下载最新版本
$./configure --with-mib-modules="agentx"
$make
可能遇到问题
1.找不到libbeecrypt.la
下载beecrypt-4.1.2.tar.gz
http://sourceforge.net/projects/beecrypt
./configure -prefix=/usr
默认是安装在/usr/local的偶们要装在/usr下
$make
$make install
2./usr/bin/ld: cannot find -lelf
$ln -s libelf.so.1 /usr/lib/libelf.so
3.echo /usr/local/lib >/etc/ld.so.conf.d/libnetsnmp.conf
$/sbin/ldconfig -v
$make install
配置文件创建
$snmpconf -g basic_setup
Installing the Perl/SNMP Module
$cd perl
$perl Makefile.PL
$make
$make test
$make install (as root)
$添加/var/agentx目录
启动SNMPD
$snmpd -f -Le -d
$ps -ef
root 30993 1 0 Mar01 ? 00:00:14 snmpd -f -Le -d
//得到物理地址
$snmpget -v2c -c public localhost ifPhysAddress.2
安装成功
SUB AGENT 安装
编写MIB模块定义文件 XXX-MIB.txt
复制文件到/usr/local/share/snmp/mibs
$echo "mibs + XXX-MIB" >> /usr/local/share/snmp/snmp.conf
激活MIB文件
利用mib2c转化MIB文件为C文件
在Net-Snmp帮助文件中mib2c有以下几种配置文件:
mib2c.scalar.conf 标量适用,常用的配置
mib2c.int_watch.conf 标量适用,绑定整数变量到整数
mib2c.mfd.conf 表适用,常用的配置
mib2c.iterate.conf 表适用,表数据在Agent外部
mib2c.create-dataset.conf 表适用,表数据在Agent里,set操作时不需额外工作
mib2c.array-user.conf 表适用 表数据在Agent里,set操作需额外工作
mib2c.column_defines.conf 表适用,只有表头定义
mib2c.column_enums.conf 表适用,只有表头定义
mib2c –c mib2c.iterate.conf XXXMIB
在当前路径下会生成 XXXMIB.c 和 XXXMIB.h
复制XXXMIB.c 和 XXXMIB.h 到 net-snmp 源码目录 agent/mibgroup下
net-snmp-config --compile-subagent XXXMIB XXXMIB.c -I./
生成XXXMIB可执行文件
重新启动SNMPD
snmpd -f -Le –d &
启动代理
./XXXMIB -f -Le –d &
用SNMPGET命令可以得到接点
完
MASTER AGENT安装
http://www.net-snmp.com/download.html
下载最新版本
$./configure --with-mib-modules="agentx"
$make
可能遇到问题
1.找不到libbeecrypt.la
下载beecrypt-4.1.2.tar.gz
http://sourceforge.net/projects/beecrypt
./configure -prefix=/usr
默认是安装在/usr/local的偶们要装在/usr下
$make
$make install
2./usr/bin/ld: cannot find -lelf
$ln -s libelf.so.1 /usr/lib/libelf.so
3.echo /usr/local/lib >/etc/ld.so.conf.d/libnetsnmp.conf
$/sbin/ldconfig -v
$make install
配置文件创建
$snmpconf -g basic_setup
Installing the Perl/SNMP Module
$cd perl
$perl Makefile.PL
$make
$make test
$make install (as root)
$添加/var/agentx目录
启动SNMPD
$snmpd -f -Le -d
$ps -ef
root 30993 1 0 Mar01 ? 00:00:14 snmpd -f -Le -d
//得到物理地址
$snmpget -v2c -c public localhost ifPhysAddress.2
安装成功
SUB AGENT 安装
编写MIB模块定义文件 XXX-MIB.txt
复制文件到/usr/local/share/snmp/mibs
$echo "mibs + XXX-MIB" >> /usr/local/share/snmp/snmp.conf
激活MIB文件
利用mib2c转化MIB文件为C文件
在Net-Snmp帮助文件中mib2c有以下几种配置文件:
mib2c.scalar.conf 标量适用,常用的配置
mib2c.int_watch.conf 标量适用,绑定整数变量到整数
mib2c.mfd.conf 表适用,常用的配置
mib2c.iterate.conf 表适用,表数据在Agent外部
mib2c.create-dataset.conf 表适用,表数据在Agent里,set操作时不需额外工作
mib2c.array-user.conf 表适用 表数据在Agent里,set操作需额外工作
mib2c.column_defines.conf 表适用,只有表头定义
mib2c.column_enums.conf 表适用,只有表头定义
mib2c –c mib2c.iterate.conf XXXMIB
在当前路径下会生成 XXXMIB.c 和 XXXMIB.h
复制XXXMIB.c 和 XXXMIB.h 到 net-snmp 源码目录 agent/mibgroup下
net-snmp-config --compile-subagent XXXMIB XXXMIB.c -I./
生成XXXMIB可执行文件
重新启动SNMPD
snmpd -f -Le –d &
启动代理
./XXXMIB -f -Le –d &
用SNMPGET命令可以得到接点
完
相关文章推荐
- 在linux下安装配置Net-Snmp
- net-snmp在Linux下的安装过程【转】
- linux下net-snmp 已经安装,为什么没有 snmpwalk和snmpget
- Linux net-snmp-5.7.2安装配置
- Linux下RPM方式安装net-snmp
- linux下安装配置net-snmp
- [转]Linux下NET-SNMP安装配置记录
- linux下安装配置net-snmp
- [转]linux系统下安装配置net-snmp
- Linux下NET-SNMP安装配置记录
- 在linux4.7上安装net-snmp编译遇到的问题
- Linux下RPM方式安装net-snmp
- Linux下安装和配置net-snmp
- net-snmp在linux下的安装及snmp开发
- net-snmp在Linux下的安装过程
- Linux下安装和配置net-snmp
- net-snmp在Linux下的安装过程【转】
- linux下安装net-snmp以及遇到的问题
- Linux---net-snmp安装遇到的错误