diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 6ed4755cd6..824abcc3d7 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,10 @@ +2012-02-01 Ramon Novoa + + * conf/pandora_server.conf, + lib/PandoraFMS/Config.pm, + lib/PandoraFMS/PluginServer.pm: Use timeout by default instead of + pandora_exec. + 2012-01-30 Ramon Novoa * lib/PandoraFMS/Config.pm: Updated version string. diff --git a/pandora_server/conf/pandora_server.conf b/pandora_server/conf/pandora_server.conf index cee2547ad5..565196ac81 100755 --- a/pandora_server/conf/pandora_server.conf +++ b/pandora_server/conf/pandora_server.conf @@ -98,7 +98,7 @@ pluginserver 0 # Pandora FMS Plugin exec tool filepath (by default at /usr/bin) -plugin_exec /usr/bin/pandora_exec +plugin_exec /usr/bin/timeout # predictionserver : 1 or 0. Set to 1 to activate prediction server with this setup # DISABLED BY DEFAULT diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index b16a26d6e4..5cfdab3742 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -204,7 +204,7 @@ sub pandora_load_config { $pa_config->{"tcp_timeout"} = 20; # Introduced on 1.3.1 $pa_config->{"snmp_proc_deadresponse"} = 1; # Introduced on 1.3.1 10 Feb08 $pa_config->{"plugin_threads"} = 2; # Introduced on 2.0 - $pa_config->{"plugin_exec"} = '/usr/bin/pandora_exec'; # 3.0 + $pa_config->{"plugin_exec"} = '/usr/bin/timeout'; # 3.0 $pa_config->{"recon_threads"} = 2; # Introduced on 2.0 $pa_config->{"prediction_threads"} = 1; # Introduced on 2.0 $pa_config->{"plugin_timeout"} = 5; # Introduced on 2.0 diff --git a/pandora_server/lib/PandoraFMS/PluginServer.pm b/pandora_server/lib/PandoraFMS/PluginServer.pm index ca3ae808a8..a3da151e9d 100644 --- a/pandora_server/lib/PandoraFMS/PluginServer.pm +++ b/pandora_server/lib/PandoraFMS/PluginServer.pm @@ -52,10 +52,10 @@ sub new ($$;$) { return undef unless $config->{'pluginserver'} == 1; - # Check for pandora_exec - if (system($config->{'plugin_exec'} . ' > /dev/null 2>&1') != 256) { - logger ($config, " [E] pandora_exec not found. Plugin Server not started.", 1); - print_message ($config, " [E] pandora_exec not found. Plugin Server not started.", 1); + # Check for plugin_exec + if (! -x $config->{'plugin_exec'}) { + logger ($config, ' [E] ' . $config->{'plugin_exec'} . ' not found. Plugin Server not started.', 1); + print_message ($config, ' [E] ' . $config->{'plugin_exec'} . ' not found. Plugin Server not started.', 1); return undef; } @@ -168,7 +168,7 @@ sub data_consumer ($$) { logger ($pa_config, "Executing AM # $module_id plugin command '$command'", 9); # Execute command - $command = $pa_config->{'plugin_exec'} . ' ' . $timeout . ' ' . quotemeta ($command); + $command = $pa_config->{'plugin_exec'} . ' ' . $timeout . ' ' . $command; my $module_data; eval {