Acid Amygdala has asked for the wisdom of the Perl Monks concerning the following question:
use warnings; use File::Tail; use Win32::GUI(); use Win32::Sound; @alert = ['a'..'z']; $i=0; $p=1; my $line; my $filename = "log3.txt"; my $file=File::Tail->new(name=>$filename); while (defined($line=$file->read)) { if($line=~ /(\s+)(\d{1,4})(\.\d{1,4}){3}(\s+)/) { &Build_Window; ++$i; ++$p; #1 } } #2 sub Build_Window { if($i==50){ $p=1; $i=0;} $datetime = localtime(); $alert[$i] = new Win32::GUI::Window(-name => "Alert", -width = +> 500, -height => 150, -pos => [$p*10, $p*10]); $font = Win32::GUI::Font -> new(-name => "Arial", size => 46, +-bold => 1); $alert[$i] -> AddLabel(-text => $datetime, -font => $font); $alert[$i] -> AddLabel(-text => "SNORT ALERT: MALICIOUS BEHAVI +OR DETECTED!", -font => $font, -top => 50); $alert[$i] -> AddLabel(-text => $line, -font => $font, -top => + 75); my $t1 = $alert[$i] -> AddTimer('T1', 1000); #Win32::Sound::Play("SystemExclamation"); $alert[$i] -> Show(); #3 sub T1_Timer { return -1; } sub Alert_Terminate { return 1; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File::Tail with GUI
by Acid Amygdala (Novice) on Feb 28, 2009 at 23:21 UTC | |
by stinkingpig (Sexton) on Mar 03, 2009 at 05:56 UTC | |
by Acid Amygdala (Novice) on Mar 04, 2009 at 22:09 UTC | |
by Acid Amygdala (Novice) on Mar 11, 2009 at 00:38 UTC | |
by Acid Amygdala (Novice) on Mar 02, 2009 at 04:51 UTC |