Added module_timeout to module_plugin in Unix agent
This commit is contained in:
parent
52f75733be
commit
e9285eac98
|
@ -1914,7 +1914,15 @@ sub module_plugin ($) {
|
||||||
return () if ($command eq '');
|
return () if ($command eq '');
|
||||||
|
|
||||||
# Execute the plugin
|
# Execute the plugin
|
||||||
my $output = `$command 2>$DevNull`;
|
|
||||||
|
my $output = "";
|
||||||
|
if ($plugin->{'timeout'} == 0) {
|
||||||
|
$output = `$command 2>$DevNull`;
|
||||||
|
log_message ('debug', "Executing plugin: " . $command) if ($Conf{'debug'} eq '1');
|
||||||
|
} else {
|
||||||
|
$output = `$Conf{'pandora_exec'} $plugin->{'timeout'} $command 2> $DevNull`;
|
||||||
|
log_message ('debug', "Executing plugin: (" . $command . ") with timeout: " . $plugin->{'timeout'} . "s") if ($Conf{'debug'} eq '1');
|
||||||
|
}
|
||||||
|
|
||||||
# Do not save the output if there was an error
|
# Do not save the output if there was an error
|
||||||
if ($? != 0) {
|
if ($? != 0) {
|
||||||
|
|
Loading…
Reference in New Issue