Zabbix Custom Port Monitoring
#!/ 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