一、这个监控的设置和我上一篇监控TCP状态类似,下面直接写监控脚本。
# vim /usr/local/zabbix/scripts/ipvsadm_status
#!/bin/bash #shuidi #status about lvs forward function Act1 { /sbin/ipvsadm -Ln 2>/dev/null | grep ‘10.0.0.9:80‘ | sed ‘2d‘ | awk ‘{print $5}‘ } function Act2 { /sbin/ipvsadm -Ln 2>/dev/null | grep ‘10.0.0.10:80‘ | sed ‘2d‘ | awk ‘{print $5}‘ } function Act3 { /sbin/ipvsadm -Ln 2>/dev/null | grep ‘10.0.0.20:80‘ | sed ‘2d‘ | awk ‘{print $5}‘ } function InAct1 { /sbin/ipvsadm -Ln 2>/dev/null | grep ‘10.0.0.9:80‘ | sed ‘2d‘ | awk ‘{print $6}‘ } function InAct2 { /sbin/ipvsadm -Ln 2>/dev/null | grep ‘10.0.0.10:80‘ | sed ‘2d‘ | awk ‘{print $6}‘ } function InAct3 { /sbin/ipvsadm -Ln 2>/dev/null | grep ‘10.0.0.20:80‘ | sed ‘2d‘ | awk ‘{print $6}‘ } $1
二、配置Key
时间: 2024-10-13 00:39:19