From 6f375f497ff152f362bcc814c229b5fde46195d9 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Fri, 2 Jun 2023 16:51:53 +0200 Subject: [PATCH] Force omnishell_client to use JSON::PP. The binary compiled with PAR::Packer for Pandora FMS doesn't work well with JSON:XS, probably because JSON::Backend::XS is defined in the __DATA__ section of JSON.pm and that doesn't work well with PAR::Filter. If this becomes a bottleneck, a workaround would be possible (e.g., redefining JSON::Backend::XS in omnishell_client.pl). --- pandora_agents/win32/omnishell/omnishell_client.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pandora_agents/win32/omnishell/omnishell_client.pl b/pandora_agents/win32/omnishell/omnishell_client.pl index 9132c90d5b..fe7f5696da 100644 --- a/pandora_agents/win32/omnishell/omnishell_client.pl +++ b/pandora_agents/win32/omnishell/omnishell_client.pl @@ -12,6 +12,14 @@ use warnings; use File::Basename; BEGIN { push @INC, '/usr/lib/perl5'; } + +# NOTE: The binary compiled with PAR::Packer for Pandora FMS doesn't work well +# with JSON:XS, probably because JSON::Backend::XS is defined in the __DATA__ +# section of JSON.pm and that doesn't work well with PAR::Filter. If this +# becomes a bottleneck, a workaround would be possible (e.g., redefining +# JSON::Backend::XS here). +BEGIN { $ENV{PERL_JSON_BACKEND} = 'JSON::PP' }; + use PandoraFMS::PluginTools; use PandoraFMS::Omnishell; @@ -90,4 +98,4 @@ if ($@) { exit 0; } -exit 0; \ No newline at end of file +exit 0;