diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 1ce30b9c90..e753901ad4 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,7 @@ +2008-07-29 Ramon Novoa + + * bin/pandora_wmi: Small fixes. + 2008-07-25 Sancho Lerena * pandora_network: Added a defined() check for tcp_send string. diff --git a/pandora_server/bin/pandora_wmi b/pandora_server/bin/pandora_wmi index f7abcee643..4b86e67fcc 100755 --- a/pandora_server/bin/pandora_wmi +++ b/pandora_server/bin/pandora_wmi @@ -27,6 +27,7 @@ use Date::Manip; # Needed to manipulate DateTime formats of input, output use Time::Local; # DateTime basic manipulation use threads; use threads::shared; +use HTML::Entities; # Pandora Modules use PandoraFMS::Config; @@ -338,13 +339,12 @@ sub exec_wmi_module { # Name|State # Eventlog|Running - my $wmi_query = $agent_module->{'snmp_oid'}; - $wmi_query =~ s/"/\"/g; - $wmi_query =~ s/\"/\\\"/g; + my $wmi_query = decode_entities($agent_module->{'snmp_oid'}); + $wmi_query =~ s/\"/\'/g; - $wmi_command = $wmi_command . " -U ". $agent_module->{'plugin_user'} ."%". $agent_module->{'plugin_pass'}; - $wmi_command = $wmi_command . " //". $agent_module->{'ip_target'}; - $wmi_command = $wmi_command . " \"". $wmi_query . "\""; + $wmi_command .= " -U \"". $agent_module->{'plugin_user'} ."\"%\"". $agent_module->{'plugin_pass'} . "\""; + $wmi_command .= " //". $agent_module->{'ip_target'}; + $wmi_command .= " \"". $wmi_query . "\""; logger ($pa_config, "Executing AM # $id_am WMI command '$wmi_command'", 9); eval {