#!/bin/bash
netstat -lptnu|grep 22
if [ $? -eq 0 ]; then
echo “service is ok”
else
mail -s “srvice is error” yourmail@163.com
fi
shell 检测服务及邮件报警
最新推荐文章于 2023-06-19 13:08:51 发布
#!/bin/bash
netstat -lptnu|grep 22
if [ $? -eq 0 ]; then
echo “service is ok”
else
mail -s “srvice is error” yourmail@163.com
fi