X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=contrib%2Fexec-nagios.px;h=938721fc55624977fa89d5ea3a1d289531573b6d;hp=3a8472413c53da140aad6d0c749628b23ad57d29;hb=3d4623c1bc42e948b0e2de709afddba323c17a5f;hpb=3469385f04ffcfa2f4ef06d34ed4b24acb378b34 diff --git a/contrib/exec-nagios.px b/contrib/exec-nagios.px index 3a847241..938721fc 100755 --- a/contrib/exec-nagios.px +++ b/contrib/exec-nagios.px @@ -88,6 +88,8 @@ with the C). =back +=back + =cut sub handle_config_addtype @@ -123,8 +125,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 @@ -281,7 +295,7 @@ sub execute_script if ($perfdata) { - push (@serviceperfdata, split (' ', $perfdata)); + push (@serviceperfdata, split (' ', $perfdata)); } $state = 1; @@ -296,8 +310,8 @@ sub execute_script if ($perfdata) { - push (@serviceperfdata, split (' ', $perfdata)); - $state = 2; + push (@serviceperfdata, split (' ', $perfdata)); + $state = 2; } } else # ($state == 2) @@ -335,7 +349,7 @@ sub execute_script for (@serviceperfdata) { handle_performance_data ($host, 'nagios', $pinst, $script->{'type'}, - $time, $_); + $time, $_); } } } # execute_script