GUI status information UTF-8 characters

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
tremcer
Posts: 13
Joined: Mon Dec 21, 2015 5:48 am

GUI status information UTF-8 characters

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: GUI status information UTF-8 characters

Post by rkennedy »

Can you post a link to where you downloaded the check_printer plugin?
Former Nagios Employee
tremcer
Posts: 13
Joined: Mon Dec 21, 2015 5:48 am

Re: GUI status information UTF-8 characters

Post by tremcer »

rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: GUI status information UTF-8 characters

Post by rkennedy »

That takes the script out of the question. If you run a SNMP walk against the printer are your results in Spanish?
Former Nagios Employee
tremcer
Posts: 13
Joined: Mon Dec 21, 2015 5:48 am

Re: GUI status information UTF-8 characters

Post 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.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: GUI status information UTF-8 characters

Post 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?
Former Nagios Employee.
me.
tremcer
Posts: 13
Joined: Mon Dec 21, 2015 5:48 am

Re: GUI status information UTF-8 characters

Post 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.
jfrickson

Re: GUI status information UTF-8 characters

Post 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.
tremcer
Posts: 13
Joined: Mon Dec 21, 2015 5:48 am

Re: GUI status information UTF-8 characters

Post 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...
jfrickson

Re: GUI status information UTF-8 characters

Post 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.
Locked