脚本内容如下:
#!/usr/bin/perl
my $f_in = "/var/log/quagga/ospfd.log";
open(FH,"<",$f_in) or die "$!\n";
while(1)
{
my $strings = ;
print $strings;
if($strings =~ m/deleted|InterfaceUp/)
{
`/bin/ospfd_alert.py -m \"$strings\" -r misc -R -s \"ospf\"`;
}
}
close FH;
阅读(1017) | 评论(0) | 转发(0) |