From aa443baf7dcc921b915c44927a4653ce67f2290c Mon Sep 17 00:00:00 2001 From: qgarnier Date: Mon, 16 Jan 2023 14:50:47 +0000 Subject: [PATCH] (plugin) notification::microsoft::office365::teams - fix uninitialized value (#4146) --- .../notification/microsoft/office365/teams/mode/alert.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/centreon-plugins/notification/microsoft/office365/teams/mode/alert.pm b/centreon-plugins/notification/microsoft/office365/teams/mode/alert.pm index 0c362f2cb..aaaac3950 100644 --- a/centreon-plugins/notification/microsoft/office365/teams/mode/alert.pm +++ b/centreon-plugins/notification/microsoft/office365/teams/mode/alert.pm @@ -140,7 +140,11 @@ sub build_resource_status_filters { "name" => "search", "object_type" => undef, "type" => "text", - "value"=> "s.description:$self->{option_results}->{service_name} h.name:$self->{option_results}->{host_name}" + "value" => sprintf( + 's.description:%s h.name:%s', + defined($self->{option_results}->{service_name}) ? $self->{option_results}->{service_name} : '', + defined($self->{option_results}->{host_name}) ? $self->{option_results}->{host_name} : '' + ) }, { "name" => "sort",