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

# 2.13. nacos

## 1. 配置application.properties文件，暴露metrics数据

```plain theme={null}
management.endpoints.web.exposure.include=*
```

添加上述内容后，重启nacos服务

## 2. 访问\{ip}:8848/nacos/actuator/prometheus，看是否能访问到metrics数据

![2.13. nacos 操作截图 1](https://lwweb.oss-cn-shenzhen.aliyuncs.com/docs/images/yuque/nacos/image-01.png)

## 3. 采集服务器导入脚本，并赋权

```plain theme={null}
chmod +x /itops/zabbix/scripts/NacosGather.py
chown itops. /itops/zabbix/scripts/NacosGather.py
```

<img src="https://lwweb.oss-cn-shenzhen.aliyuncs.com/docs/images/yuque/nacos/image-02.png" alt="2.13. nacos 操作截图 2" /> 注意修改NacosGather.py脚本中的ServerIP为实际环境ServerIP

```plain theme={null}
chmod +x /itops/zabbix/share/zabbix/externalscripts/NacosDataAcquisition
chown itops. /itops/zabbix/share/zabbix/externalscripts/NacosDataAcquisition
```

![2.13. nacos 操作截图 3](https://lwweb.oss-cn-shenzhen.aliyuncs.com/docs/images/yuque/nacos/image-03.png)

## 4. 新建临时数据存放文件

```plain theme={null}
mkdir -p /itops/zabbix/logs/Nacos/
touch /itops/zabbix/logs/Nacos/Nacos__.txt
chown itops. -R /itops/zabbix/logs/Nacos
```

## 5. 平台导入模板后添加监控

<img src="https://lwweb.oss-cn-shenzhen.aliyuncs.com/docs/images/yuque/nacos/image-05.png" alt="2.13. nacos 操作截图 5" /> `此处填入nacos的IP、端口`
