Perl ping监控

use warnings;  
use Net::Ping;  
if ($#ARGV <0){  
   print "请输入一个参数
";  
  exit(-1);  
}  
$host = $ARGV[0];  
$p = Net::Ping->new("icmp");  
 print "$host is alive.
" if $p->ping($host,5);  
 system("SMSsendx  xxxxxxxx "$host is lost" x.x.x.x" ) unless $p->ping($host, 2);  
 $p->close();  
 #sleep(1); 

原文地址:https://www.cnblogs.com/hzcya1995/p/13351945.html