windows下配置net-snmp

来源:互联网 发布:统计博士知乎 编辑:程序博客网 时间:2024/05/10 17:32

转自http://www.zzzforever.com/post/433

自己找了很久,终于找到比较完整的了。

1. 安装

从这里下载,我们将要把net-snmp安装到I:/usr,安装过程只要修改一下安装路径就行,其他地方一路回车。

2. 配置

在I:/usr/etc/snmp目录下新建一个文件snmpd.conf,其内容如下
com2sec notConfigUser default public
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
access notConfigGroup “” any noauth exact all none none
view all included .1 80
view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc
view all included .1
注意:这个目录下有一个snmp.conf,不要搞混了

3.配置windows服务

启动一个命令窗口,将工作目录改到I:/usr下,执行一下
I:/usr>bin/snmpd -v
NET-SNMP version:  5.5
Web:               http://www.net-snmp.org/
Email:             net-snmp-coders@lists.sourceforge.net
主文件正常,下一步将它安装为windows服务,执行
I:/usr>registeragent.bat
Registering snmpd as a service using the following additional options:
.
-Lf “I:/usr/log/snmpd.log”
.
.
For information on running snmpd.exe and snmptrapd.exe as a Windows
service, see ‘How to Register the Net-SNMP Agent and Trap Daemon as
Windows services’ in README.win32.
.
请按任意键继续. . .
I:/usr>
服务注册成功,下面启动net-snmp
I:/usr>net start “net-snmp agent”
Net-SNMP Agent 服务已经启动成功。
I:/usr>
我们可以在windows的任务管理器中看到snmpd.exe这个进程。

4.测试

检查一下我们的成果,在命令行窗口执行
snmpwalk -v 1 -c public -m ALL 127.0.0.1
其中public相当连接密钥了,要和snmd.conf中的
com2sec notConfigUser default public
一致。如果一切顺利,你将会看到很多数据在滚。下一步就可以cacti这样的监控程序去抓数据画图了。

5.参考资料

http://blog.chinaunix.net/u/249/showart_1415021.html
http://blog.csdn.net/podded/archive/2007/12/19/1953929.aspx
原创粉丝点击