From d3dc3044aab61e4958827ecce3799b1a1d68125c Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 20 Apr 2021 13:22:13 +0200 Subject: [PATCH 1/2] Allow sending file_path with symbols --- pandora_server/lib/PandoraFMS/PluginTools.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index f7d7961f31..7f0155f40b 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -867,11 +867,11 @@ sub transfer_xml { my $r = -1; #Send using tentacle if ($^O =~ /win/i) { - $msg = `$conf->{tentacle_client} -v -a $conf->{tentacle_ip} -p $conf->{tentacle_port} $conf->{tentacle_opts} "$file_path"`; + $msg = `$conf->{tentacle_client} -v -a $conf->{tentacle_ip} -p $conf->{tentacle_port} $conf->{tentacle_opts} '$file_path'`; $r = $?; } else { - $msg = `$conf->{tentacle_client} -v -a $conf->{tentacle_ip} -p $conf->{tentacle_port} $conf->{tentacle_opts} "$file_path" 2>&1`; + $msg = `$conf->{tentacle_client} -v -a $conf->{tentacle_ip} -p $conf->{tentacle_port} $conf->{tentacle_opts} '$file_path' 2>&1`; $r = $?; } From fc21a1234d2846e7cec7928dab187e4fb8923423 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 20 Apr 2021 14:05:15 +0200 Subject: [PATCH 2/2] PluginTools transfer_xml, Rename filename if it contains symbols (only parsed ones) --- pandora_server/lib/PandoraFMS/PluginTools.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index 7f0155f40b..b7f5a0a41a 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -805,7 +805,9 @@ sub transfer_xml { if (empty($file_name)){ $file_name = trim(`hostname`); } - + + # Tentacle server does not allow files with symbols in theirs name. + $file_name =~ s/[^a-zA-Z0-9_-]//g; $file_name .= "." . sprintf("%d",time()) . ".data"; }