-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem decoding accentuated characters from powershell output in centreon_nsclient_restapi.pl #5414
Comments
Hi @gehasia,
The error you encountered certainly occurred there:
To get more information, you should run:
It may help us fix it. |
Hi @omercier and thanks for your reply ! Here is the output :
Here is the output of --ps-exec-only
This is the last item which cause the error : Maybe for this kind of powershell output ?? |
Be careful. The error I think you should try to update the /usr/lib/centreon/plugins//centreon_nsclient_restapi.pl file. In the package
By;
|
Ok after changing
to
I get
we see that it returned It seems that nsclient exchange queue plugin still continue to send an incorrectly utf-8 encoded string but the serverside script centreon_nsclient_restapi.pl can handle it normally now but with downside of wrong characters. That can do it for now, i will try to investigate further later when i will be able to install the toolchain for this and do some test/debug correctly if you can't help 'blindly' anymore. Thanks ! |
Hi,
I don't know if it belongs to this codebase or another, as i don't really understand how everything fits in what repo (does the perl serverside module for centreon belongs to here, i don't find it ?
centreon_nsclient_restapi.pl --plugin=apps::nsclient::restapi::plugin
)...The problem seems to be a generic one, but i have it with this particular plugin clientside :
apps::microsoft::exchange::local::plugin
The perl script is called with those arguments serverside :
/usr/lib/centreon/plugins//centreon_nsclient_restapi.pl --plugin=apps::nsclient::restapi::plugin --mode=query --hostname='MYIPADDRESS' --port='8443' --proto='https' --legacy-password='MYSECRET' --command=check_centreon_plugins --arg='apps::microsoft::exchange::local::plugin' --arg='queues' --arg=' --warning-status="" --critical-status="not %{status} =~ /Ready|Active/i" --verbose' --ssl-opt="SSL_verify_mode => SSL_VERIFY_NONE" --timeout=30
I get this response :
UNKNOWN: Cannot decode json response: malformed UTF-8 character in JSON string, at character offset 2020 (before "\x{fffd}0080\\u009Ap...") at /usr/lib/centreon/plugins//centreon_nsclient_restapi.pl line 162.
Sure, if i check the nsclient plugin from the client side it check the Exchange Queue with the powershell command. Here is the problem, powershell reply with this in my case (my server is in French, so Exchange does some automatic translations...)
As you can see the NextHopDomain is "Dépôt" which contains accentuated characters which are not correctly handled by json_decode in
centreon_nsclient_restapi.pl
As it belongs to the base script centreon_nsclient_restapi.pl, i'm pretty sure that any accentuated characters sended in UTF-8 via json to the perl script will crash the same way, not only exchange plugins.
In general i try to do a PR with the issue as i tend to try to debug fully. But i'm new to this project, i don't really get which script has to handle thie case for the moment, nor i have any knowledge in perl (litteraly 0)...
The text was updated successfully, but these errors were encountered: