<pre name="code" class="sql">#!/usr/bin/perl
$dir = '/home/websphere/WebSphere/AppServer/profiles/AppSrv01/logs/server1';
$file = '1.log';
$mon_file = "$dir/$file";
print "\$mon_file is $mon_file\n";
@warn_arr = qw/连接已关闭 NullPointException IndexOutOfBound exception/;
foreach $a (@warn_arr) {
undef @err_info;
open( C, "<", "$a.tmp" );
while (<C>) {
$count = $_;
}
print "$a is $count";
open( A, "<", "$mon_file" ) || die "$!\n";
$i = 0;
$num = 0;
while (<A>) {
$num++;
if ( $_ =~ /$a/i ) { $i++; $b = $num }
}
print "\$b is $b\n";
if ( $i != 0 && $i != $count && defined($count) ) {
open( B, "<", "$mon_file" ) || die "$!\n";
Perl 调用短信
最新推荐文章于 2021-03-12 10:09:36 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)