###监控CPU idle 和交换分区
§ion("TCP INFO");
my @array=`netstat -na | grep ^tcp | grep 443`;
foreach my $i (@array) {
my $ip;
chomp $i;
$var=(split(/s+/,"$i"))[4];
$ip =(split(/:/,"$var"))[0];
$log{$ip}++;
};
while(my($ip, $times) = each %log) {
print "$ip establish 11.4.16.5:443 port's connections is $times
";
if ($times >= 100 ){ send_mail('zhjian@zjcap.cn',"$ip establish 121.40.116.25:443
port's connections is $times
");}
};