diff --git a/lib/Thruk/Controller/cmd.pm b/lib/Thruk/Controller/cmd.pm index 6e1b9e00b..c18c58eba 100644 --- a/lib/Thruk/Controller/cmd.pm +++ b/lib/Thruk/Controller/cmd.pm @@ -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}) { diff --git a/lib/Thruk/Utils/CLI/Downtimetask.pm b/lib/Thruk/Utils/CLI/Downtimetask.pm index fc81756c6..830939596 100644 --- a/lib/Thruk/Utils/CLI/Downtimetask.pm +++ b/lib/Thruk/Utils/CLI/Downtimetask.pm @@ -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); @@ -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 {