From 0a5310ddaae74d0ac98ff30b28d55871fadc8fcb Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 5 Jul 2010 09:45:46 +0200 Subject: [PATCH] contrib/exec-nagios.px: Use the environment variables for defaults. --- contrib/exec-nagios.px | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/exec-nagios.px b/contrib/exec-nagios.px index b26981fb..4b112f95 100755 --- a/contrib/exec-nagios.px +++ b/contrib/exec-nagios.px @@ -24,7 +24,8 @@ use Regexp::Common ('number'); our $ConfigFile = '/etc/exec-nagios.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); @@ -263,7 +264,7 @@ sub execute_script my $time = time (); my $script = shift; my @args = (); - my $host = hostname () || 'localhost'; + my $host = $Hostname || hostname () || 'localhost'; my $state = 0; my $serviceoutput; -- 2.30.2