mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
Discovery. Added App.VMw
Former-commit-id: 18a9300f37163048bd99109c08c1228231426a59
This commit is contained in:
parent
08c6d782a4
commit
6a43536b33
@ -234,7 +234,13 @@ sub exec_recon_script ($$$) {
|
|||||||
# \r and \n should be escaped for decode_json().
|
# \r and \n should be escaped for decode_json().
|
||||||
$macros =~ s/\n/\\n/g;
|
$macros =~ s/\n/\\n/g;
|
||||||
$macros =~ s/\r/\\r/g;
|
$macros =~ s/\r/\\r/g;
|
||||||
my $decoded_macros = decode_json (encode_utf8($macros));
|
my $decoded_macros;
|
||||||
|
|
||||||
|
if ($macros) {
|
||||||
|
eval {
|
||||||
|
$decoded_macros = decode_json(encode_utf8($macros));
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
my $macros_parameters = '';
|
my $macros_parameters = '';
|
||||||
|
|
||||||
@ -254,15 +260,12 @@ sub exec_recon_script ($$$) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
my $args = "$task->{'id_rt'} $task->{'id_group'} $task->{'create_incident'} $macros_parameters";
|
my $ent_script = 0;
|
||||||
|
my $args = enterprise_hook('discovery_custom_recon_scripts',[$pa_config, $dbh, $task, $script]);
|
||||||
# Depending of the recon_script type (name) should be invoked
|
if (!$args) {
|
||||||
# in different ways:
|
$args = "$task->{'id_rt'} $task->{'id_group'} $task->{'create_incident'} $macros_parameters";
|
||||||
if ($script->{'name'} =~ /Discovery.App/i) {
|
} else {
|
||||||
# Discovery Application recon script. Imported from heavy server plugins.
|
$ent_script = 1;
|
||||||
# Instantiate configuration file.
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (-x $command) {
|
if (-x $command) {
|
||||||
@ -273,6 +276,10 @@ sub exec_recon_script ($$$) {
|
|||||||
|
|
||||||
# Only update the timestamp in case something went wrong. The script should set the status.
|
# Only update the timestamp in case something went wrong. The script should set the status.
|
||||||
db_do ($dbh, 'UPDATE trecon_task SET utimestamp = ? WHERE id_rt = ?', time (), $task->{'id_rt'});
|
db_do ($dbh, 'UPDATE trecon_task SET utimestamp = ? WHERE id_rt = ?', time (), $task->{'id_rt'});
|
||||||
|
|
||||||
|
if ($ent_script == 1) {
|
||||||
|
enterprise_hook('discovery_clean_custom_recon',[$pa_config, $dbh, $task, $script]);
|
||||||
|
}
|
||||||
|
|
||||||
logger($pa_config, 'Done executing recon script ' . safe_output($script->{'name'}), 10);
|
logger($pa_config, 'Done executing recon script ' . safe_output($script->{'name'}), 10);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user