Page 1 of 1

NagVis under NagiosXI JSON error UTF8

Posted: Mon Jul 20, 2020 4:22 am
by fpernet
Hi all,
After upgrade to nagiosXI 5.7.1, NagVis is unable to display the map... Error is:

Code: Select all

Error: (0) json_encode(): Invalid UTF-8 sequence in argument
URL: /nagvis/server/core/ajax_handler.php?mod=Map&act=getMapObjects&show=Business_process_idsa&header_menu=1&hover_menu=1&context_menu=1&zoom=100&_ajaxid=1595236591
File: /usr/local/nagvis/share/server/core/classes/NagVisMap.php
Line: 115
#0 [internal function]: nagvisExceptionErrorHandler(2, 'json_encode(): ...', '/usr/local/nagv...', 115, Array)
#1 /usr/local/nagvis/share/server/core/classes/NagVisMap.php(115): json_encode(Array)
#2 /usr/local/nagvis/share/server/core/classes/CoreModMap.php(322): NagVisMap->parseObjectsJson()
#3 /usr/local/nagvis/share/server/core/classes/CoreModMap.php(105): CoreModMap->getMapObjects()
#4 /usr/local/nagvis/share/server/core/functions/index.php(120): CoreModMap->handleAction()
#5 /usr/local/nagvis/share/server/core/ajax_handler.php(59): require('/usr/local/nagv...')
#6 {main}
I tried to upgrade to NagiosXI 5.7.2 -> same error
I tried to upgrade NagVis to version 2.5.5 -> same error
I jumped from version 5.6.14 to 5.7.1 (I don't know if lied to my problem )
Thx in advance

Re: NagVis under NagiosXI JSON error UTF8

Posted: Mon Jul 20, 2020 5:15 pm
by benjaminsmith
HI,

Please your /etc/my.cnf and under the [mysqld] section add this line:

Code: Select all

init-connect='SET NAMES utf8'
Then restart the services:

Code: Select all

systemctl stop nagios
systemctl restart mariadb
systemctl start nagios
Let me know if the issue is resolved. If not, please send use your system profile. Thanks, Benjamin

To send us your system profile.
Login to the Nagios XI GUI using a web browser.
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button
Save the profile.zip file and share in a private message or upload it to the post/ticket, and then reply to this post to bring it up in the queue

Re: NagVis under NagiosXI JSON error UTF8

Posted: Wed Jul 22, 2020 3:16 am
by fpernet
Hi,

Thank you very much for your answer.
This solved the problem as far as i can see ...

Thanks again
Francois

Re: NagVis under NagiosXI JSON error UTF8

Posted: Wed Jul 22, 2020 8:45 am
by benjaminsmith
Hi Francois,

Great! We'll close this out for now, but feel free to open another if you have any new questions or further issues.