diff options
| author | 2016-01-21 16:46:34 -0700 | |
|---|---|---|
| committer | 2016-01-21 16:46:34 -0700 | |
| commit | a73ccb8276861dab3fcba34c2783122655947844 (patch) | |
| tree | 1823287054c36c65de0f43963a180788d082570c /lib/ASM/Inspect.pm | |
| parent | 939891b050a6c0c5f44acf6ef43a30ee76719a16 (diff) | |
Have the Inspect/opalert routines print a backlog to an incident-specific logfile, rather than a single file, and include a shortlink to this logfile when generating alerts
Diffstat (limited to 'lib/ASM/Inspect.pm')
| -rw-r--r-- | lib/ASM/Inspect.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ASM/Inspect.pm b/lib/ASM/Inspect.pm index 3d44729..e18572d 100644 --- a/lib/ASM/Inspect.pm +++ b/lib/ASM/Inspect.pm @@ -6,6 +6,8 @@ use strict; use Data::Dumper; use String::Interpolate qw(interpolate); use HTTP::Request; +use ASM::Shortener; + no if $] >= 5.017011, warnings => 'experimental::smartmatch'; %::ignored = (); @@ -128,6 +130,8 @@ sub inspect { "\x02$event->{nick}\x02 - ${nicereason}; ping "; $txtz = $txtz . ASM::Util->commaAndify(ASM::Util->getAlert(lc $chan, $dct{$id}{risk}, 'hilights')) if (ASM::Util->getAlert(lc $chan, $dct{$id}{risk}, 'hilights')); $txtz = $txtz . ' !att-' . $chan . '-' . $dct{$id}{risk}; + my $uuid = $::log->incident($chan, "$chan: $dct{$id}{risk} risk: $event->{nick} - $nicereason\n"); + $txtz = $txtz . ' ' . ASM::Shortener->shorturl($::settings->{web}->{detectdir} . $uuid . '.txt'); if ($id eq 'last_measure_regex') { #TODO: Note that this is another example of things that shouldn't be hardcoded, but are. } @@ -140,7 +144,6 @@ sub inspect { $conn->schedule(45, sub { delete($::ignored{$chan}) if $::ignored{$chan} == $::RISKS{$dct{$id}{risk}} }); $::ignored{$chan} = $::RISKS{$dct{$id}{risk}}; } - $::log->incident($chan, "$chan: $dct{$id}{risk} risk: $event->{nick} - $nicereason\n"); } } } |
