Skip to content

Commit

Permalink
Merge pull request #424 from Ilia-SB/422-monitor-skip-fix
Browse files Browse the repository at this point in the history
Check hook skip list on event end
  • Loading branch information
connortechnology committed Oct 20, 2022
2 parents cc66eb5 + dd4e2cf commit e34dea9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions zmeventnotification.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3685,6 +3685,16 @@ sub processNewAlarmsInFork {
# ---------- Event End processing ----------------------------------#
elsif ( $alarm->{End}->{State} eq 'pending' ) {

# is this monitor blocked from hooks in config?
if ( $hook_skip_monitors{$mid} ) {
printInfo("$mid is in hook skip list, not using hooks");
$alarm->{End}->{State} = 'ready';

# lets treat this like a hook success so it
# gets sent out
$hookResult = 0;
}
else {
# this means we need to invoke a hook
if ( $alarm->{Start}->{State} ne 'done' ) {
printDebug(
Expand Down Expand Up @@ -3833,6 +3843,7 @@ sub processNewAlarmsInFork {
$alarm->{End}->{State} = 'ready';
} # hook end script
# end of State == pending
}
}
elsif ( $alarm->{End}->{State} eq 'ready' ) {

Expand Down

0 comments on commit e34dea9

Please sign in to comment.