2008-08-25 Ramon Novoa <rnovoa@artica.es>

* bin/pandora_wmi: Check for wmic execution errors.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1030 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
ramonn 2008-08-25 08:38:52 +00:00
parent 2574c60623
commit 6a7a1818a2
2 changed files with 16 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2008-08-25 Ramon Novoa <rnovoa@artica.es>
* bin/pandora_wmi: Check for wmic execution errors.
2008-08-24 Sancho Lerena <slerena@gmail.com>
* pandora_package_installer: New script for install binary

View File

@ -331,7 +331,7 @@ sub exec_wmi_module {
# Initialize another global sub variables.
my $agent_name = dame_agente_nombre ($pa_config, $agent_module->{'id_agente'}, $dbh);
my $module_result = 1; # Fail by default
my $module_data = 0; # 0 data for default
my $module_data = '';
my $module_interval = 0;
# Build execution command to plugin
@ -352,7 +352,17 @@ sub exec_wmi_module {
logger ($pa_config, "Executing AM # $id_am WMI command '$wmi_command'", 9);
$module_data = `$wmi_command`;
if (! defined($module_data)) {
#logger ($pa_config, "[ERROR] Unexpected response from $wmi_client\n");
return;
}
my @data = split("\n", $module_data);
if ($#data < 2) {
#logger ($pa_config, "[ERROR] Unexpected response from $wmi_client\n");
return;
}
my @data2 = split(/\|/, $data[2]); # get third line (containing data)
# Take a specific field number from returned data. It uses tcp_port