use warnings;
use Net::Ping;
if ($#ARGV <0){
print "请输入一个参数\n";
exit(-1);
}
$host = $ARGV[0];
$p = Net::Ping->new("icmp");
print "$host is alive.\n" if $p->ping($host,5);
system("SMSsendx xxxxxxxx \"$host is lost\" x.x.x.x" ) unless $p->ping($host, 2);
$p->close();
#sleep(1);
Perl ping监控
最新推荐文章于 2017-11-16 20:10:00 发布