###监控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\n";
if ($times >= 100 ){ send_mail('zhjian@zjcap.cn',"$ip establish 121.40.116.25:443
port's connections is $times\n");}
};
perl 监控每个ip的连接数
最新推荐文章于 2017-11-16 16:04:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)