[character set issue] When create Hostgroups in Korean.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
skywalker
Posts: 26
Joined: Tue Jan 14, 2014 7:27 pm

[character set issue] When create Hostgroups in Korean.

Post by skywalker »

Hi,
Since the beginning of August, We have been building Nagios xi 2014 R 1.2 version in customer site.

I need help for technical support because we have an issue.

When I have created an "Hostgroup" by Korean language from the nagios xi web gui, the problem occurs.

Object values(infotable_title_text) in utf8 are displayed incorrectly in the web interface.

For example, I have hostgroup named "한글말" and in web interface it displayed as "í��ê¸� (í��ê¸�í��ì�¤í�"('í��ê¸� (í��ê¸�í��ì�¤í�' in page source)
I think that this issue will be able to be resolved easily.

Best regards,
Thank you
You do not have the required permissions to view the files attached to this post.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: [character set issue] When create Hostgroups in Korean.

Post by tmcdonald »

I believe this was fixed in 2014r1.3, as it is working correctly on my system:
2014-08-13 09_49_09-Nagios XI.png
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
skywalker
Posts: 26
Joined: Tue Jan 14, 2014 7:27 pm

Re: [character set issue] When create Hostgroups in Korean.

Post by skywalker »

We have successfully updated system to Nagios XI 2014.R.1.3 from 2014.R.1.2.

But, The problems still happen.

Are you fresh install as Nagios XI 2014.R.1.3 or upgrade your Nagios XI version?

Thank you.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: [character set issue] When create Hostgroups in Korean.

Post by abrist »

Trevor's version of 1.3 was an upgrade. If the hostgroup is empty, could you remove and recreate it?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
skywalker
Posts: 26
Joined: Tue Jan 14, 2014 7:27 pm

Re: [character set issue] When create Hostgroups in Korean.

Post by skywalker »

I have recreated hostgroup using CCM. Bu the problems are still being happened.

please show me your my.cnf file of Mysql Database.

My /etc/my.cnf
===================================================================
[root@nagiosxi ~]# cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
character-set-server = utf8
init_connect=SET collation_connection = utf8_general_ci
init_connect=SET NAMES utf8
init_connect=SET character_set_database = utf8
init_connect=SET character_set_results = utf8
collation-server = utf8_general_ci
default-character-set=utf8

[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

=====================================================================

I have edited line 133 in the file (/usr/local/nagiosxi/html/includes/components/xicore/dashlets-status.inc.php).

After revisions, on the web, "$hostgroup_alias" variables are properly displayed in korean. But "$hostgroup" variables are incorrectly displayed by ?????.

And The DB data is correctly displayed in Mysql Database, But in the web, "$hostgroup" variables also are incorrectly displayed by ?????.

mysql> select * from tbl_hostgroup;
+----+------------------+--------------------+---------+-------------------+-------+-----------+------------+--------+---------------------+---------------+-----------+
| id | hostgroup_name | alias | members | hostgroup_members | notes | notes_url | action_url | active | last_modified | access_rights | config_id |
+----+------------------+--------------------+---------+-------------------+-------+-----------+------------+--------+---------------------+---------------+-----------+
| 1 | linux-servers | Linux Servers | 1 | 0 | NULL | NULL | NULL | 1 | 2014-05-21 07:11:00 | NULL | 1 |
| 2 | windows-servers | | 0 | 0 | NULL | NULL | NULL | 0 | 2014-05-21 07:11:00 | NULL | 1 |
| 3 | Switch | Switch | 1 | 0 | | | | 1 | 2014-05-23 15:13:47 | NULL | 1 |
| 4 | Printer | Rockplace Printer | 1 | 0 | | | | 1 | 2014-05-28 17:14:52 | NULL | 1 |
| 14 | 한글된다 | 한글된다우와 | 0 | 0 | | | | 1 | 2014-08-14 00:32:24 | NULL | 1 |
| 16 | 박선호그룹 | 박선호 | 0 | 0 | | | | 1 | 2014-08-14 19:05:08 | NULL | 1 |
| 17 | 한글입니다. | 한글입니다 | 0 | 0 | | | | 1 | 2014-08-14 23:04:33 | NULL | 1 |
| 18 | 락플레이스 | 락플레이스 | 0 | 0 | | | | 1 | 2014-08-14 22:54:12 | NULL | 1 |
| 19 | 게시판 | 게시판 | 0 | 0 | | | | 1 | 2014-08-15 13:29:31 | NULL | 1 |
+----+------------------+--------------------+---------+-------------------+-------+-----------+------------+--------+---------------------+---------------+-----------+
9 rows in set (0.00 sec)

What edited
===================================================================================================================================
Line 133 in the file (/usr/local/nagiosxi/html/includes/components/xicore/dashlets-status.inc.php).

Before : $jargs .= "\"" . htmlentities($var) . "\" : \"" . htmlentities($val) . "\"";
After : $jargs .= "\"" . htmlentities($var,ENT_QUOTES|ENT_IGNORE,"UTF-8") . "\" : \"" . htmlentities($val,ENT_QUOTES|ENT_IGNORE,"UTF-8") . "\"";
==================================================================================================================================
case DASHLET_MODE_INBOARD:

$output = "";
//$output.='HOST STATUS SUMMARY: '.serialize($args);

$id = "host_status_summary_" . random_string(6);

// ajax updater args
$ajaxargs = $args;
// build args for javascript
$n = 0;
$jargs = "{";
foreach ($ajaxargs as $var => $val) {
if ($n > 0)
$jargs .= ", ";
$jargs .= "\"" . htmlentities($var,ENT_QUOTES|ENT_IGNORE,"UTF-8") . "\" : \"" . htmlentities($val,ENT_QUOTES|ENT_IGNORE,"UTF-8") . "\"";
$n++;
}
$jargs .= "}";
==================================================================================================================================
skywalker
Posts: 26
Joined: Tue Jan 14, 2014 7:27 pm

Re: [character set issue] When create Hostgroups in Korean.

Post by skywalker »

Today, We have finally upgraded Nagios XI System from version 2014.R1.3 to the lastest version 2014.R1.4.

As a result, in the nagios XI web, "$hostgroup" variables displayed to ???? characters.

But We can see korean character in database.
OK : Database Name: nagios, Table Name: nagios_hostgoups
OK : Database Name : nagiosql, Table Name : tbl_hostgroups

mysql> select * from tbl_hostgroup;
+----+------------------+--------------------+---------+-------------------+-------+-----------+------------+--------+---------------------+---------------+-----------+
| id | hostgroup_name | alias | members | hostgroup_members | notes | notes_url | action_url | active | last_modified | access_rights | config_id |
+----+------------------+--------------------+---------+-------------------+-------+-----------+------------+--------+---------------------+---------------+-----------+
| 1 | linux-servers | Linux Servers | 1 | 0 | NULL | NULL | NULL | 1 | 2014-05-21 07:11:00 | NULL | 1 |
| 2 | windows-servers | | 0 | 0 | NULL | NULL | NULL | 0 | 2014-05-21 07:11:00 | NULL | 1 |
| 3 | Switch | Switch | 1 | 0 | | | | 1 | 2014-05-23 15:13:47 | NULL | 1 |
| 4 | Printer | Rockplace Printer | 1 | 0 | | | | 1 | 2014-05-28 17:14:52 | NULL | 1 |
| 14 | 한글된다 | 한글된다우와 | 0 | 0 | | | | 1 | 2014-08-14 00:32:24 | NULL | 1 |
| 16 | 박선호그룹 | 박선호 | 0 | 0 | | | | 1 | 2014-08-14 19:05:08 | NULL | 1 |
| 17 | 한글입니다. | 한글입니다 | 0 | 0 | | | | 1 | 2014-08-14 23:04:33 | NULL | 1 |
| 18 | 락플레이스 | 락플레이스 | 0 | 0 | | | | 1 | 2014-08-14 22:54:12 | NULL | 1 |
| 19 | 게시판 | 게시판 | 0 | 0 | | | | 1 | 2014-08-15 13:29:31 | NULL | 1 |
+----+------------------+--------------------+---------+-------------------+-------+-----------+------------+--------+---------------------+---------------+-----------+
9 rows in set (0.00 sec)
You do not have the required permissions to view the files attached to this post.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: [character set issue] When create Hostgroups in Korean.

Post by abrist »

I am filing an internal bug report. Keep an eye on the next version's release notes.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
skywalker
Posts: 26
Joined: Tue Jan 14, 2014 7:27 pm

Re: [character set issue] When create Hostgroups in Korean.

Post by skywalker »

Thank you for the support.

Here are a few general reference to remember when creating a bug report.

First, in the hostgroup status and servergroup status, the korean language is incorrectly displayed.

In the dashboard page and hostgroup creation page (in the Core configure manager), the korean language is correctly displayed.

sencond, also the results are diffrent in the database.

Please refer to the files. Thank you.

locale setting

[root@nagiosxi ~]# locale
LANG=ko_KR.UTF-8
LC_CTYPE="ko_KR.UTF-8"
LC_NUMERIC="ko_KR.UTF-8"
LC_TIME="ko_KR.UTF-8"
LC_COLLATE="ko_KR.UTF-8"
LC_MONETARY="ko_KR.UTF-8"
LC_MESSAGES="ko_KR.UTF-8"
LC_PAPER="ko_KR.UTF-8"
LC_NAME="ko_KR.UTF-8"
LC_ADDRESS="ko_KR.UTF-8"
LC_TELEPHONE="ko_KR.UTF-8"
LC_MEASUREMENT="ko_KR.UTF-8"
LC_IDENTIFICATION="ko_KR.UTF-8"
LC_ALL=
You do not have the required permissions to view the files attached to this post.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: [character set issue] When create Hostgroups in Korean.

Post by abrist »

Thank you for the additional information. I referenced this thread in the bug report, so your info may be of some use to the devs. Keep an eye on the release notes for the next few releases.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
skywalker
Posts: 26
Joined: Tue Jan 14, 2014 7:27 pm

Re: [character set issue] When create Hostgroups in Korean.

Post by skywalker »

Hi, addtionally there is an issue on the dashboard deployment.

Local Name is correctly displayed in korean, but Destination Name Column is incorrectly displayed.

Please refer to attached files.

I have edited the file(/etc/my.cnf). So, the Korean language is correctly displayed in host group and service group.

[root@nagiosxi ~]# cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
symbolic-links=0
character-set-server = utf8
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid


Finally, All is good. Only "Destination Name" field in dashboard deploytool is incorrectly displayed.

Thank you.
You do not have the required permissions to view the files attached to this post.
Last edited by skywalker on Fri Aug 22, 2014 7:10 am, edited 1 time in total.
Locked