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).
This commit is contained in:
Ramon Novoa 2023-06-02 16:51:53 +02:00
parent e3445964c4
commit 6f375f497f
1 changed files with 9 additions and 1 deletions

View File

@ -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;
exit 0;