From c18f7cbb2645e67765f9aa7e15f59a556735706c Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 5 Jul 2010 09:40:55 +0200 Subject: [PATCH] contrib/exec-munin.px: Use the environment variables for defaults. --- contrib/exec-munin.px | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/exec-munin.px b/contrib/exec-munin.px index b57601a3..3e62ce00 100755 --- a/contrib/exec-munin.px +++ b/contrib/exec-munin.px @@ -46,7 +46,8 @@ use Regexp::Common ('number'); our $ConfigFile = '/etc/exec-munin.conf'; our $TypeMap = {}; our $Scripts = []; -our $Interval = 300; +our $Interval = defined ($ENV{'COLLECTD_INTERVAL'}) ? (0 + $ENV{'COLLECTD_INTERVAL'}) : 300; +our $Hostname = defined ($ENV{'COLLECTD_HOSTNAME'}) ? $ENV{'COLLECTD_HOSTNAME'} : ''; main (); exit (0); @@ -189,7 +190,7 @@ sub execute_script my $pinst; my $time = time (); my $script = shift; - my $host = hostname () || 'localhost'; + my $host = $Hostname || hostname () || 'localhost'; if (!open ($fh, '-|', $script)) { print STDERR "Cannot execute $script: $!"; -- 2.11.0