Commit 5c37d9f1 authored by Luc Didry's avatar Luc Didry
Browse files

[Postfwd2] env.path not mandatory anymore

parent c9632afb
......@@ -17,7 +17,7 @@
[postfwd2]
user root
env.path /usr/local/sbin/postfwd2 # MANDATORY !
env.path /usr/local/sbin/postfwd2 # OPTIONAL : look for postfwd2 in /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, /usr/local/sbin
env.include .*ISBAD #OPTIONAL
env.exclude .*ISGOOD #OPTIONAL
......@@ -159,6 +159,12 @@ foreach my $policy (keys %policies) {
}
##### I have to parse the output BEFORE config, since policy matchs are dependant of the postfwd --dumpstats output
if (!defined($ENV{path})) {
foreach my $path (qw{/bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin}) {
$ENV{path} = $path.'/postfwd2' if (!defined($ENV{path}) && -x $path.'/postfwd2');
last if (defined($ENV{path}));
}
}
open(DATA, $ENV{path}.' --dumpstats |') or munin_exit_fail();
my $total_requests;
while(defined (my $data = <DATA>)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment