zabbix自定义端口监控
更新:HHH   时间:2023-1-7


#!/bin/bash 

IP=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


返回建站服务器教程...