From de4e2c6585c887672897083693350620cb32d5bf Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Tue, 10 Sep 2013 10:28:37 +0200 Subject: [PATCH] Config Conversion: Treat notification option 'r' as StateFilterOK. --- tools/configconvert/Icinga2/Convert.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/configconvert/Icinga2/Convert.pm b/tools/configconvert/Icinga2/Convert.pm index 4d696a67e..521269b52 100644 --- a/tools/configconvert/Icinga2/Convert.pm +++ b/tools/configconvert/Icinga2/Convert.pm @@ -839,17 +839,23 @@ sub convert_notification_options_to_filter { # split the string my @options = Icinga2::Utils::str2arr_by_delim_without_excludes($notification_options, ',', 1); - # verify if there's 'n' (none) or 'a' (all) and ignore the rest then + # verify if there's 'n' (none) and ignore the rest then if (grep /n/, @options) { push @{$filter->{'state'}}, 0; push @{$filter->{'type'}}, 0; return $filter; } + # recovery requires state up + if (grep /r/, @options) { + push @{$filter->{'state'}}, 'StateFilterOK'; + } + # always add NotificationFilterProblem|Custom push @{$filter->{'type'}}, 'NotificationFilterProblem'; push @{$filter->{'type'}}, 'NotificationFilterCustom'; + # verify if there's 'a' (all) and add all filters if (grep /a/, @options) { foreach my $by (keys %{$filter_by}) { push @{$filter->{$filter_by->{$by}}}, $filter_names->{$by}; -- 2.40.0