> ## 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.

# Netmap功能操作手册

> [!TIP]
>
> 视频教程：[NetMap视频教程](https://forum.lwops.cn/videos?video_id=59\&page=1)

## **1. 部署前提**

由于8.2.3版本升级到8.2.4版本，新增了NetMap功能，需要做如下配置才能正常使用NetMap功能。

### **1.1. 模板导入**

在【Perseus采集】-【模板管理】将以下模板文件导入至平台

点击链接下载模板文件：[netmap\&netpath模板文件](https://forum.lwops.cn/release/download/p/60fMOK9I2XapRt0e)

![SO Pnetmaptu1](https://mintcdn.com/lerwee/KXbMeEwx6SN8-1Q_/images/SOPnetmaptu1.png?fit=max\&auto=format\&n=KXbMeEwx6SN8-1Q_\&q=85\&s=5f76d68fea4325788a81ff621923aeed)

### **1.2. 模板迁移**

模板导入成功后会出现【NetPath路由网关模板】和【NetMap探测】2个模板，将其中的【NetPath路由网关模板】迁移为附件模板

![SO Pnetmaptu2](https://mintcdn.com/lerwee/KXbMeEwx6SN8-1Q_/images/SOPnetmaptu2.png?fit=max\&auto=format\&n=KXbMeEwx6SN8-1Q_\&q=85\&s=5bf21818e675e04b011a70ec33ff1049)

### **1.3. 上传脚本修改配置**

将netmap\_script.zip解压到采集服务器的外部检查目录下，并配置权限及修改相关配置（目录：/itops/perseusZ/share/perseusZ/externalscripts）

点击链接下载netmap\_script.zip脚本文件：[netmap\_script.zip](https://forum.lwops.cn/release/download/p/OexCDEPhxe14s6ng)

* 解压文件

```python theme={null}
unzip netmap_script.zip -d /itops/perseusZ/share/perseusZ/externalscripts/
```

* 授权

```python theme={null}
chmod +x /itops/perseusZ/share/perseusZ/externalscripts/netmap* /itops/perseusZ/share/perseusZ/externalscripts/fetch*
```

* 如果web和server不在同一服务器，或者是脚本解压在proxy下，需要修改fetch\_router\_[info.py](http://info.py)的WEB\_URL参数

```python theme={null}
vi /itops/perseusZ/share/perseusZ/externalscripts/fetch_router_info.py

# 编辑WEB_URL参数
WEB_URL='http://<WEBIP>/backend_api/'
```

* 追加sudo权限，因netmap需要发起网络连接等操作，需要超管权限执行部分操作

```python theme={null}
visudo
# 追加如下行
itops ALL=(root) NOPASSWD:/itops/perseusZ/share/perseusZ/externalscripts/netmap.py
```

## **2. 操作步骤**

### **2.1. 新建路径**

进入【网络管理】-【NetMap】模块的路径列表页，点击【新建路径】

![SO Pnetmaptu3](https://mintcdn.com/lerwee/KXbMeEwx6SN8-1Q_/images/SOPnetmaptu3.png?fit=max\&auto=format\&n=KXbMeEwx6SN8-1Q_\&q=85\&s=c053aeaa361b679f5e40a421a1db90f2)

按提示填写路径信息并完成告警设置，采集频率默认10分钟。

![SO Pnetmaptu4](https://mintcdn.com/lerwee/KXbMeEwx6SN8-1Q_/images/SOPnetmaptu4.png?fit=max\&auto=format\&n=KXbMeEwx6SN8-1Q_\&q=85\&s=b1b73335dcaf8b38931b5aaad576227f)

### **2.2. 关联模板**

需关联 NetMap 路径上的设备端口信息时执行本步骤，**否则跳过**。

1、完成设备监控后，在主机管理中搜索该主机并进入主机详情。

![SO Pnetmaptu5](https://mintcdn.com/lerwee/KXbMeEwx6SN8-1Q_/images/SOPnetmaptu5.png?fit=max\&auto=format\&n=KXbMeEwx6SN8-1Q_\&q=85\&s=0419768f7cd5f2d0f633ce738538eeeb)

2、进入主机详情，点击【添加】套用模板《NetPath路由网关模板\[非监控]\[脚本]》

![SO Pnetmaptu6](https://mintcdn.com/lerwee/KXbMeEwx6SN8-1Q_/images/SOPnetmaptu6.png?fit=max\&auto=format\&n=KXbMeEwx6SN8-1Q_\&q=85\&s=972e238b54285a636136a88ab6284b69)

### **2.3. 查看网络路径**

点击路径名称下钻，查看路径详情与告警信息。

![SO Pnetmaptu7](https://mintcdn.com/lerwee/KXbMeEwx6SN8-1Q_/images/SOPnetmaptu7.png?fit=max\&auto=format\&n=KXbMeEwx6SN8-1Q_\&q=85\&s=96be3faccef0026dea127a9cd235b42b)

![SO Pnetmaptu8](https://mintcdn.com/lerwee/KXbMeEwx6SN8-1Q_/images/SOPnetmaptu8.png?fit=max\&auto=format\&n=KXbMeEwx6SN8-1Q_\&q=85\&s=c1b7b0165584c224ff541df29cc5ceea)

点击节点查看该节点延时与丢包。

![SO Pnetmaptu9](https://mintcdn.com/lerwee/KXbMeEwx6SN8-1Q_/images/SOPnetmaptu9.png?fit=max\&auto=format\&n=KXbMeEwx6SN8-1Q_\&q=85\&s=e77db5522442e2fe662577b180f5e3f1)

若 NetMap 路径上的设备已纳管且关联《NetPath路由网关模板\[非监控]\[脚本]》，可查看端口延时、丢包及入出流量。

![SO Pnetmaptu10](https://mintcdn.com/lerwee/KXbMeEwx6SN8-1Q_/images/SOPnetmaptu10.png?fit=max\&auto=format\&n=KXbMeEwx6SN8-1Q_\&q=85\&s=8cb4c101bf44b7a7660fa652184347f4)

支持按可达性筛选路径，查看逐跳设备指标明细并定位画布位置。

![SO Pnetmaptu11](https://mintcdn.com/lerwee/KXbMeEwx6SN8-1Q_/images/SOPnetmaptu11.png?fit=max\&auto=format\&n=KXbMeEwx6SN8-1Q_\&q=85\&s=c378d858a6d543a1c6132bc1315c2dbd)

支持按时间范围筛选查看路径历史。

![SO Pnetmaptu12](https://mintcdn.com/lerwee/KXbMeEwx6SN8-1Q_/images/SOPnetmaptu12.png?fit=max\&auto=format\&n=KXbMeEwx6SN8-1Q_\&q=85\&s=505b1ec220d6c44c36bb9f4f4f7b4564)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.