From c73bc7e18d3dd6aa1edf56bab0da1b38c78e8952 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Mon, 18 Feb 2013 10:57:14 +0000 Subject: [PATCH] 2013-02-18 Sergio Martin * lib/PandoraFMS/PluginServer.pm: Clean the blank spaces from the start and end of the return of the plugin to make easier the configuration of numeric modules and not confuse with snapshot mode git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7666 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 7 +++++++ pandora_server/lib/PandoraFMS/PluginServer.pm | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index ceffb5a453..fa1fd13211 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,10 @@ +2013-02-18 Sergio Martin + + * lib/PandoraFMS/PluginServer.pm: Clean the blank spaces + from the start and end of the return of the plugin to make + easier the configuration of numeric modules and not confuse + with snapshot mode + 2013-02-15 Sergio Martin * lib/PandoraFMS/Core.pm diff --git a/pandora_server/lib/PandoraFMS/PluginServer.pm b/pandora_server/lib/PandoraFMS/PluginServer.pm index f540bcec83..7a8827999f 100644 --- a/pandora_server/lib/PandoraFMS/PluginServer.pm +++ b/pandora_server/lib/PandoraFMS/PluginServer.pm @@ -189,6 +189,11 @@ sub data_consumer ($$) { eval { $module_data = `$command`; }; + + # Clean blank spaces and carriage return from start and end of the data + $module_data =~ s/^[\s|\n|\r]*//; + $module_data =~ s/[\s|\n|\r]*$//; + my $ReturnCode = ($? >> 8) & 0xff; if ($plugin->{'plugin_type'} == 1) {