Page 1 of 3

GUI status information UTF-8 characters

Posted: Wed Dec 23, 2015 5:33 am
by tremcer
Enviroment

Nagios Core 4.1.1
OS: Linux Debian 8
Kernel: 3.16.0-4-amd64
The instance is running on an VMware ESXi 5.5.0
Compiled from source

Problem description

Status Information work fine in command line, but not show on GUI.

Example:

./check_printer X.X.X.X public 1 toner 4
OK - Tóner magenta 60% (60 of 100 left) | toner=60;20;0;0;100
X.X.X.X = ip address

The printer use Spanish as language. Answer back by SNMP using UTF-8 characters
But in the GUI can't show Status Information, no errors, only blank
On nagios.log

[1450393200] CURRENT SERVICE STATE: RICOH_MP_C4503;Estado toner MAGENTA;OK;HARD;1;OK - Left 100% of Tner magenta

Look at charset error....
In Spanish the word "toner" has an accent mark in "o"..

Apache virtual host conf has this entry:
AddDefaultCharset UTF-8

/usr/local/nagios/etc/cgi.cfg disable html tags:
escape_html_tags=0

Locale settings:

LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"

Thanks.

Re: GUI status information UTF-8 characters

Posted: Wed Dec 23, 2015 10:40 am
by rkennedy
Can you post a link to where you downloaded the check_printer plugin?

Re: GUI status information UTF-8 characters

Posted: Wed Dec 23, 2015 10:56 am
by tremcer

Re: GUI status information UTF-8 characters

Posted: Wed Dec 23, 2015 11:55 am
by rkennedy
That takes the script out of the question. If you run a SNMP walk against the printer are your results in Spanish?

Re: GUI status information UTF-8 characters

Posted: Mon Jan 11, 2016 4:49 am
by tremcer
Hi. Sorry for the delay. No, the result of snmpwalk are in English. Only when the snmp_get query include the word "toner" in the answer the result didn't see in the GUI.

Re: GUI status information UTF-8 characters

Posted: Mon Jan 11, 2016 12:56 pm
by hsmith
Sorry for asking the obvious here, but have you restarted the nagios and httpd(apache2) services since applying the changes to allow UTF-8?

How long ago did you compile and install core? We did release a few changes for non-english systems, but I don't know if check results were included.

Have you tested using spanish as the locale on the machine, if that's the language a lot of your stuff is in?

Re: GUI status information UTF-8 characters

Posted: Wed Jan 13, 2016 5:02 am
by tremcer
Don't worry...

Yes, I was restarted apache and nagios services.

I was compile about 3 months ago.

And yes, I was test change the system locale to es_ES.UTF-8 and the problem persist.

Re: GUI status information UTF-8 characters

Posted: Wed Jan 13, 2016 11:45 am
by jfrickson
I configured snmp on one of my systems to say syslocation "Tóner room". Then I ran an snmpwalk:

Code: Select all

john@linux-jtgl:~$ snmpwalk -Os -c public -v 1 localhost sysLocation.0 
sysLocation.0 = STRING: \"T..ner room\"
As you can see, snmpd returned T..ner room so I suspect either snmpd itself is having problems with utf-8, or the default language of the device is not set to utf-8.

Re: GUI status information UTF-8 characters

Posted: Wed Jan 13, 2016 12:22 pm
by tremcer
Hi.. But, if I run the script in shell, the results it's ok, the accent mark characters show ok...

----
./check_printer X.X.X.X public 1 toner 4
OK - Tóner magenta 60% (60 of 100 left) | toner=60;20;0;0;100
X.X.X.X = ip address
-----
The problem is only in the GUI, if the snmp answer contain has an accent mark in some character can't show status information...

Re: GUI status information UTF-8 characters

Posted: Wed Jan 13, 2016 1:06 pm
by jfrickson
tremcer wrote:Hi.. But, if I run the script in shell, the results it's ok, the accent mark characters show ok...

----
./check_printer X.X.X.X public 1 toner 4
OK - Tóner magenta 60% (60 of 100 left) | toner=60;20;0;0;100
X.X.X.X = ip address
-----
The problem is only in the GUI, if the snmp answer contain has an accent mark in some character can't show status information...
Ok, let me check some more. I'll get back to you.

[EDIT] Please upload a screen shot where it is showing wrong. Thanks.