From: Tom Throckmorton Date: Fri, 6 Mar 2009 18:28:26 +0000 (+0100) Subject: contrib/exec-nagios.px: Make it possible to run the same script multiple times. X-Git-Tag: collectd-4.6.2~5^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a025295971e7f8d88764c7d54fb29379b9f29b8d;p=collectd.git contrib/exec-nagios.px: Make it possible to run the same script multiple times. --- diff --git a/contrib/exec-nagios.px b/contrib/exec-nagios.px index 3a847241..a9f46633 100755 --- a/contrib/exec-nagios.px +++ b/contrib/exec-nagios.px @@ -123,8 +123,20 @@ sub handle_config_script } else { - $opts->{'script'} = $script; - push (@$Scripts, $opts); + if (ref ($opts) eq 'ARRAY') + { + for (@$opts) + { + my $opt = $_; + $opt->{'script'} = $script; + push (@$Scripts, $opt); + } + } + else + { + $opts->{'script'} = $script; + push (@$Scripts, $opts); + } } } # for (keys %$scripts) } # handle_config_script