> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lwops.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# SNMP写入RPING探测

> 实验目的为链路探测功能进一步优化，测试使用网络设备MIB，通过SNMP配置从网络设备发起remoteping探测，且调用激活以获取探测结果实验环境说明网络设备：华为交换机 MIB： DISMAN-PING-MIB大体实现思路设备配置可写团体字通过snmp命令创建远端PING任务获取PING结果...

# 实验目的

为链路探测功能进一步优化，测试使用网络设备MIB，通过SNMP配置从网络设备发起remoteping探测，且调用激活以获取探测结果

# 实验环境说明

网络设备：华为交换机 MIB： DISMAN-PING-MIB

# 大体实现思路

1. 设备配置可写团体字
2. 通过snmp命令创建远端PING任务
3. 获取PING结果
4. 手动激活探测及PING任务删除

# 实验过程记录

## 1. 网络设备配置可写团体字

思科锐捷设备`snmp-server community public rw` 华为华三设备`snmp-agent community write cipher public`

## 2.snmpset命令创建PING

华三华为

```plain theme={null}
snmpset  -v 2c -c public 192.168.1.98  .1.3.6.1.2.1.80.1.2.1.3.1.66.1.66 i 1 .1.3.6.1.2.1.80.1.2.1.4.1.66.1.66 s 192.168.3.173 .1.3.6.1.2.1.80.1.2.1.8.1.66.1.66 i 1 .1.3.6.1.2.1.80.1.2.1.16.1.66.1.66 o 1.3.6.1.2.1.80.3.1 .1.3.6.1.2.1.80.1.2.1.17.1.66.1.66 s test_to_173 .1.3.6.1.2.1.80.1.2.1.18.1.66.1.66 i 1 .1.3.6.1.2.1.80.1.2.1.19.1.66.1.66 s 192.168.1.98 .1.3.6.1.2.1.80.1.2.1.23.1.66.1.66 i 4
```

![SNMP写入RPING探测 操作截图 1](https://lwweb.oss-cn-shenzhen.aliyuncs.com/docs/images/yuque/snmp-rping/image-01.png) 思科

```plain theme={null}
```

锐捷

```plain theme={null}
```

## 3.snmp获取ping结果

```plain theme={null}
# 获取rping结果
snmpwalk -v 2c -c public 192.168.1.98 .1.3.6.1.2.1.80.1.3.1
# 获取rping配置
snmpwalk -v 2c -c public 192.168.1.98 .1.3.6.1.2.1.80.1.2.1
```

## 4.手动重新执行

```plain theme={null}
snmpset  -v 2c -c public 192.168.1.98 .1.3.6.1.2.1.80.1.2.1.8.1.98.1.98 i 1
```

# 小知识

## SNMP结果十六进制转时间

![SNMP写入RPING探测 操作截图 2](https://lwweb.oss-cn-shenzhen.aliyuncs.com/docs/images/yuque/snmp-rping/image-02.png)

```plain theme={null}
07 D0 06 03 05 2D 12 04
|  |  |  |   | |  |   |
20 00 -6 -3, 5:45:18. 4
```
