From a05ae1593bb655f206049eb43196c31b98e908a3 Mon Sep 17 00:00:00 2001 From: ramonn Date: Thu, 31 May 2012 11:29:33 +0000 Subject: [PATCH] 2012-05-31 Ramon Novoa * lib/PandoraFMS/WMIServer.pm: Merged from 4.0 branch. Hide wmic error messages and improved error checking. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6386 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 5 +++++ pandora_server/lib/PandoraFMS/WMIServer.pm | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 4a703b7c66..41e365a188 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2012-05-31 Ramon Novoa + + * lib/PandoraFMS/WMIServer.pm: Merged from 4.0 branch. Hide wmic error + messages and improved error checking. + 2012-05-30 Sancho Lerena * lib/PandoraFMS/Core.pm: Updated batch statistic queries to get diff --git a/pandora_server/lib/PandoraFMS/WMIServer.pm b/pandora_server/lib/PandoraFMS/WMIServer.pm index 95f9008c2c..dfedc19afa 100644 --- a/pandora_server/lib/PandoraFMS/WMIServer.pm +++ b/pandora_server/lib/PandoraFMS/WMIServer.pm @@ -154,8 +154,8 @@ sub data_consumer ($$) { logger ($pa_config, "Executing AM # $module_id WMI command '$wmi_command'", 9); # Execute command - my $module_data = `$wmi_command`; - if (! defined ($module_data)) { + my $module_data = `$wmi_command 2>/dev/null`; + if ($? ne 0 || ! defined ($module_data)) { pandora_update_module_on_error ($pa_config, $module, $dbh); return; }