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

# 2.9.1使用说明

keepalived运行服务器需要安装agent

# 2.9.2 使用配置

## 2.9.2.1 解压脚本

（1）keepalived.py解压至proxy或server外部脚本文件夹

```text theme={null}
# 目录已实际为准
cp keepalived.py /itops/zabbix/share/zabbix/externalscripts/keepalived.py
chmod +x /itops/zabbix/share/zabbix/externalscripts/keepalived.py
chown itops.itops /itops/zabbix/share/zabbix/externalscripts/keepalived.py
```

（2）keepalived-lvs.py解压至中间件**keepalived**所在服务器

```text theme={null}
# 修改agent配置
vim /itops/zabbix/etc/zabbix_agentd.conf
# 脚本路径已实际为准
UserParameter=script.lvs[*],python /itops/zabbix/scripts/keepalived-lvs.py $1 $2 $3
```

## 2.9.2.2 模板导入

<img src="https://lwweb.oss-cn-shenzhen.aliyuncs.com/docs/images/yuque/keepalived/image-01.png" alt="enter image description here" /> <img src="https://lwweb.oss-cn-shenzhen.aliyuncs.com/docs/images/yuque/keepalived/image-02.png" alt="enter image description here" /> <img src="https://lwweb.oss-cn-shenzhen.aliyuncs.com/docs/images/yuque/keepalived/image-03.png" alt="enter image description here" />

## 2.9.2.3 添加监控对象

![enter image description here](https://lwweb.oss-cn-shenzhen.aliyuncs.com/docs/images/yuque/keepalived/image-04.png)
