现在的位置: 首页 > 综合 > 正文

net-snmp for windows

2013年09月17日 ⁄ 综合 ⁄ 共 1443字 ⁄ 字号 评论关闭
 

net-snmp for windows

本来windows自己带的那个也很好用的,但是安装教程在“添加或删除程序”里添加的时候,拷贝文件总是出错,无法完成安装。在*nix很流行的net-snmp其实有Windows版本的,是系统自带的snmp一个不错的替代方案。其安装配置过程如下:

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.参考资料

抱歉!评论已关闭.