zhaoming 发表于 2013-5-17 08:57:43

linux下使用mail发送邮件检测存活主机

1.mail配置# uname -n
s127_66
# cat /etc/mail/access
# Check the /usr/share/doc/sendmail/README.cf file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
# package.
#
# by default we allow relaying from localhost...
Connect:localhost.localdomain      RELAY
Connect:localhost                  RELAY
Connect:127.0.0.1                  RELAY
Connect:s127_66                      RELAY# service sendmail restart2.检查脚本# cat ping.sh
#!/bin/bash
for ip in 192.168.{100..200}
do
count=`ping -c 1$ip |grep 'received' |awk -F',' '{print $2}'|awk '{print $1}'`
if [ $count -eq 0 ]
then
echo "$ip is down(ping failue)" >/root/host
/bin/mail -s "ping" 563619936@qq.com < /root/host
fi
done

wolong 发表于 2013-5-19 21:18:58

昨天,系花对我笑了一下,乐得我晚上直数羊,一只羊,两只羊,三只羊……

sofh7777 发表于 2013-5-22 15:43:41

我真想亲口管你爷爷叫声:爹!

trzxycx 发表于 2013-5-27 03:46:06

沙发!沙发!

tyxiayu 发表于 2013-6-1 15:19:52

爱——不是想出来的,爱——是做出来的!!

寂寞大萝卜 发表于 2013-6-4 16:21:23

走自己的路,让别人打车去吧。

1397535668 发表于 2013-6-5 05:57:19

只有假货是真的,别的都是假的!
页: [1]
查看完整版本: linux下使用mail发送邮件检测存活主机