2013-03-07 Miguel de Dios <miguel.dedios@artica.es>

* lib/PandoraFMS/WMIServer.pm: fixed when the wmi query have not a
	password.
	
	Fixes: #3563221




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7805 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-03-07 10:12:42 +00:00
parent c8188b514c
commit 0e9889c49a
2 changed files with 17 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2013-03-07 Miguel de Dios <miguel.dedios@artica.es>
* lib/PandoraFMS/WMIServer.pm: fixed when the wmi query have not a
password.
Fixes: #3563221
2013-03-06 Sergio Martin <sergio.martin@artica.es>
* lib/PandoraFMS/Core.pm: Fixed alert fired counts when

View File

@ -132,13 +132,19 @@ sub data_producer ($) {
sub data_consumer ($$) {
my ($self, $module_id) = @_;
my ($pa_config, $dbh) = ($self->getConfig (), $self->getDBH ());
my $module = get_db_single_row ($dbh, 'SELECT * FROM tagente_modulo WHERE id_agente_modulo = ?', $module_id);
return unless defined $module;
# Build command to execute
my $wmi_command = $pa_config->{'wmi_client'} . ' -U "' . $module->{'plugin_user'} . '"%"' . $module->{'plugin_pass'} . '"';
my $wmi_command = '';
if ($module->{'plugin_user'}) {
$wmi_command = $pa_config->{'wmi_client'} . ' -U "' . $module->{'plugin_user'} . '"%"' . $module->{'plugin_pass'} . '"';
}
else {
$wmi_command = $pa_config->{'wmi_client'} . ' -U "' . $module->{'plugin_user'} . '"';
}
# Use a custom namespace
my $namespace = $module->{'tcp_send'};
if ($namespace ne '') {