X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=contrib%2Fexec-munin.px;h=3e62ce009ae71ef16bcfe2d4ee118628e65ef26f;hb=71d8519096a413dec86660da706865e82b202036;hp=b57601a3054aa9c99c8022c384d869f595828882;hpb=dfa9f1043e287606c7c7c8e6444c79ecaad5422d;p=collectd.git 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: $!";