Get the App
SLTechnology News&Howtos  ›  Servers  › 

Zabbix Custom Port Monitoring

Shulou Source: shulou.com Published: 2022-06-03 02:15:54 10月03日 Update

#!/ 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

#Delete files

rm -f ${myfile}

#1 means the port is open.

echo 1

else

#0 means the port is blocked

echo 0

fi

Tags: Port file monitorin Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn OPPO Reno Shulou Information macOS Linux