Skip to content

Commit

Permalink
fix recurring downtimes
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Dec 11, 2023
1 parent ca9acfd commit 86eb827
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Thruk/Controller/cmd.pm
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ sub _check_for_commands {
return $c->detach('/error/index/12');
}
if($cmd_mod == 2 && ref $c->req->parameters->{'host'} || ref $c->req->parameters->{'service'}) {
if($cmd_mod == 2 && (ref $c->req->parameters->{'host'} || ref $c->req->parameters->{'service'})) {
my $hsts = Thruk::Base::list($c->req->parameters->{'host'});
my $svcs = Thruk::Base::list($c->req->parameters->{'service'});
for my $hst (@{$hsts}) {
Expand Down
3 changes: 3 additions & 0 deletions lib/Thruk/Utils/CLI/Downtimetask.pm
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ sub _handle_file {
for my $hst (@{$hosts}) {
next if $done->{'hosts'}->{$hst};
$downtime->{'host'} = $hst;
$downtime->{'service'} = undef;
my $rc;
eval {
$rc = set_downtime($c, $downtime, $cmd_typ, $backends, $start, $end, $hours, $minutes);
Expand Down Expand Up @@ -200,6 +201,8 @@ sub _handle_file {
my $grps = $downtime->{$downtime->{'target'}};
for my $grp (@{$grps}) {
next if $done->{'groups'}->{$grp};
$downtime->{'host'} = undef;
$downtime->{'service'} = undef;
$downtime->{$downtime->{'target'}} = $grp;
my $rc;
eval {
Expand Down

0 comments on commit 86eb827

Please sign in to comment.