Windwos和Linux探测SNMP方法

当SNMP管理平台添加设备失败时,可以借助Windows下的MIBBrowser或Linux下的snmpwalk工具进行故障排查。在Linux中,通过`yum install net-snmp net-snmp-utils -y`安装snmpwalk,然后使用`snmpwalk -v2c -c public 192.168.100.131`命令检查设备是否响应SNMP请求。如果主机未响应,表示可能存在SNMP配置或网络问题;如果响应,则问题可能在于管理平台。

        在运维过程中,SNMP管理平台添加SNMP设备时长碰到添加异常情况,此时可以通过自己PC工具来测试是SNMP管理平台问题还是被管理设备问题。

方法一:

        Windows下SNMP工具种类杂多,比较常见工具非MIB Browser莫属,具体使用不做多介绍,请自行搜索。

方法二:

        Linux下可以使用snmpwalk工具(一下操作方法基于CentOS7):

安装snmpwalk:

yum install net-snmp net-snmp-utils -y

探测192.168.100.131是否开启snmp:

snmpwalk -v 2c -c public 192.168.100.131

如下表示主机未响应SNMP请求:

如下表示主机响应SNMP请求:

关于snmpwalk,还能在末尾添加添加oid等参数,具体后续再做更新。。。

linux环境下的snmp测试脚本, Installing SNMPv2C Agent Conformance Test Package 2008/04/08 IPv6 Promotion Council Terminology =========== Tester Node (TN) A tester node for the conformance tests. Node Under Test (NUT) A testee node for the conformance tests. Network Under Test The network where the conformance tests are executed. Tester Interface The network interface of TN hooked up to the Network Under Test. Interface Under Test The network interface of NUT hooked up to the Network Under Test. Prerequisites ============= Prerequisites for TN: - The package supports FreeBSD 6.0-RELEASE or higher version. - The package can also coexist with FreeBSD version of KAME. Installing the package onto TN ============================== 0. Before Starting (A) You need to install following softwares. - Perl (Required version : 5.8.7 or higher) - Net-SNMP (Required version : 5.3.1 or higher) *** You can download it from the following URL: http://net-snmp.sourceforge.net/ - v6eval (Required version : 3.0.11 or higher) Please refer to 00README.v6eval in "v6eval" for more information. *** You can download it from the following URL: http://www.tahi.org/release/ - koi (Required version : 1.1.1 or higher) Please refer to README file in "koi" package for more information. *** You can download it from the following URL: http://www.tahi.org/release/ 1. Extracting ct package % tar zxvf ct-snmpv2c-ag-X.X.tar.gz 2. Copying ct package Copy ct directory to any directory you like. % cp -pR $ORGDIR/ct-snmpv2c-ag-X.X $SOMEWHERE/ct-snmpv2c-ag-X.X % chmod -R +w $SOMEWHERE/ct-snmpv2c-ag-X.X 4. Setup ct environment % (enable TN's ipv6 capibility) % cd $SOMEWHERE/ct-snmpv2c-ag-X.X % edit config.txt % make test [End of INSTALL]
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值