1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
$protocolsdir = "./var/tmp";
$seekfilesdir = "./var/tmp";
@searches = (
{
tag => "door",
logfile => "./var/adm/messages",
criticalpatterns => ["door open", "window open"],
warningpatterns => ["door unlocked", "window unlocked"],
okpatterns => ["door closed", "window closed"],
options => "supersmartscript",
script => sub {
my $pattern = $CHECK_LOGFILES_PRIVATESTATE->{matchingpattern};
printf "my pattern was (%s)
", $pattern;
$pattern =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
printf STDERR "encoded pattern is %s
", $pattern;
$pattern =~ s/%([A-Fa-f0-9]{2})/pack('C', hex($1))/seg;
printf STDERR "decoded pattern is %s
", $pattern;
return 2;
}
}
);
|