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) {