zabbix自定义端口监控
#!/bin/bashIP=172.22.1.1
PORT=3306
myfile='/etc/zabbix/data/index.html'
rm -f ${myfile}
cd /etc/zabbix/data &&
wget${IP}:${PORT} >/dev/null 2>&1
if [ -f "${myfile}" ]; then
#删除文件
rm -f ${myfile}
#1 表示端口能通
echo 1
else
#0 表示端口不通
echo 0
fi
页:
[1]