Pio
May 8, 2019, 7:42am
1
Hi everybody,
i have a Problem with two Icinga installations. The Language Settings of the GUI takes no effekt.
System:
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en
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”
LC_ALL=
locale -a
...
de_AT.utf8
de_BE.utf8
de_CH.utf8
de_DE.utf8
de_IT.utf8
de_LI.utf8
de_LU.utf8
....
Process Info
Program Version r2.10.4-1
Icinga Web 2 Version
2.6.3
Monitoring Version
2.6.3
PHP
Configuration File (php.ini) Path => /etc/php/7.2/cli
Loaded Configuration File => /etc/php/7.2/cli/php.ini
for testing purposes more date.timezones set to Eurpoe/Berlin than required
/etc/php/7.2/apache2/php.ini:940:; http://php.net/date.timezone
/etc/php/7.2/apache2/php.ini:941:date.timezone = Europe/Berlin
/etc/php/7.2/apache2/php.ini.ucf-dist:940:; http://php.net/date.timezone
/etc/php/7.2/apache2/php.ini.ucf-dist:941:;date.timezone =
/etc/php/7.2/cli/php.ini:940:; http://php.net/date.timezone
/etc/php/7.2/cli/php.ini:941:date.timezone = Europe/Berlin
/etc/php/7.2/cli/php.ini.ucf-dist:940:; http://php.net/date.timezone
/etc/php/7.2/cli/php.ini.ucf-dist:941:;date.timezone =
/etc/php/7.2/fpm/php.ini:940:; http://php.net/date.timezone
/etc/php/7.2/fpm/php.ini:941:date.timezone = Europe/Berlin
More than one restart of icinga, apache, php and the server. What did i forget?
Thanks!
Hrocc
(Holger)
May 8, 2019, 8:03am
2
same problem here!
Icinga Web 2 2.6.3
Debian 9.9
nilmerg
(Johannes Meyer)
May 8, 2019, 8:13am
3
Is there an error message appearing in the log?
The only thing that makes me wonder is that your locale -a
only shows de_DE.utf8
. Though, when Icinga Web 2 sets its locale it uses either de_DE
or de_DE.UTF-8
as name.
If that’s really the issue it should manifest itself with “Cannot set locale <locale> for category ‘LC_ALL’ ” in the log.
With locale -a | grep de_DE
I’ll get this:
de_DE
de_DE@euro
de_DE.iso88591
de_DE.iso885915@euro
de_DE.utf8
Pio
May 8, 2019, 8:25am
4
Icinga2.log when i change the Language in the GUI. I cannot find any Error Messages.
[2019-05-08 10:20:35 +0200] information/WorkQueue: #7 (IdoMysqlConnection, ido-mysql) items: 2, rate: 2.58333/s (155/min 811/5min 2453/15min);
[2019-05-08 10:20:45 +0200] information/WorkQueue: #7 (IdoMysqlConnection, ido-mysql) items: 1, rate: 2.58333/s (155/min 811/5min 2451/15min);
[2019-05-08 10:21:25 +0200] information/WorkQueue: #7 (IdoMysqlConnection, ido-mysql) items: 1, rate: 2.58333/s (155/min 811/5min 2453/15min);
[2019-05-08 10:21:44 +0200] information/WorkQueue: #6 (ApiListener, SyncQueue) items: 0, rate: 0/s (0/min 0/5min 0/15min);
[2019-05-08 10:21:44 +0200] information/WorkQueue: #5 (ApiListener, RelayQueue) items: 0, rate: 0.05/s (3/min 15/5min 42/15min);
[2019-05-08 10:21:45 +0200] information/WorkQueue: #7 (IdoMysqlConnection, ido-mysql) items: 0, rate: 2.58333/s (155/min 811/5min 2451/15min);
nilmerg
(Johannes Meyer)
May 8, 2019, 8:34am
5
That’s the wrong log. We’re speaking of Icinga Web 2 here and its log can usually be found at /var/log/icingaweb2/icingaweb2.log
.
Pio
May 8, 2019, 9:09am
6
Okay, my default log was set up to “syslog”. I have tried to change it like you say, but there is no data wrote in the log file. Can you tell me the owner settings to /var/log/icingaweb2/. I referenced the chmod setting to /var/log/icingaweb2/ from /var/log/icinga2/.
Temporarily i have set the loggin type to webserver an thats the result after change the language settings.
x.x.x.x - - [08/May/2019:11:05:55 +0200] “GET /icingaweb2/img/icinga-logo-big-dark.png HTTP/1.1” 200 3776 “http://x.x.x.x/icingaweb2/navigation/dashboard?name=system ” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0”
x.x.x.x - - [08/May/2019:11:05:58 +0200] “GET /icingaweb2/navigation/dashboard?name=configuration HTTP/1.1” 200 973 “http://x.x.x.x/icingaweb2/about ” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0”
x.x.x.x - - [08/May/2019:11:05:59 +0200] “GET /icingaweb2/config/general HTTP/1.1” 200 2970 “http://x.x.x.x/icingaweb2/navigation/dashboard?name=configuration ” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0”
x.x.x.x - - [08/May/2019:11:06:07 +0200] “GET /icingaweb2/layout/menu?url=%2Ficingaweb2%2Fnavigation%2Fdashboard%3Fname%3Dconfiguration HTTP/1.1” 200 1642 “http://x.x.x.x/icingaweb2/config/general ” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0”
x.x.x.x - - [08/May/2019:11:06:09 +0200] “GET /icingaweb2/navigation/dashboard?name=user HTTP/1.1” 200 920 “http://x.x.x.x/icingaweb2/config/general ” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0”
x.x.x.x - - [08/May/2019:11:06:09 +0200] “GET /icingaweb2/account HTTP/1.1” 200 6546 “http://x.x.x.x/icingaweb2/navigation/dashboard?name=user ” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0”
x.x.x.x - - [08/May/2019:11:06:16 +0200] “POST /icingaweb2/account HTTP/1.1” 200 532 “http://x.x.x.x/icingaweb2/account ” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0”
x.x.x.x - - [08/May/2019:11:06:16 +0200] “GET /icingaweb2/css/icinga.min.css?id=1557306376418 HTTP/1.1” 200 83401 “http://x.x.x.x/icingaweb2/account ” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0”
x.x.x.x - - [08/May/2019:11:06:16 +0200] “GET /icingaweb2/account HTTP/1.1” 200 6554 “http://x.x.x.x/icingaweb2/account ” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0”
nilmerg
(Johannes Meyer)
May 9, 2019, 6:17am
7
How did you install Icinga Web 2? The log path is usually created by the package
The required permissions are just the usual ones. The webserver’s user/group needs read and write access to the directory.
Pio
May 9, 2019, 7:34am
8
With the installation command “apt-get install icingaweb2 ” and through the install wizard. The default settings for logging are type:Syslog and level:error.
The problem was that i only have reloaded icinga2.service after chaning the settings. I restarted icinga and now it works.
I set the level to debug an tested some changes of language in the web gui. here are the results.
2019-05-09T09:28:40+02:00 - ERROR - Icinga\Exception\IcingaException in /usr/share/php/Icinga/Util/Translator.php:181 with message: Cannot set locale ‘ar_SA’ for category ‘LC_ALL’
2019-05-09T09:28:41+02:00 - ERROR - Icinga\Exception\IcingaException in /usr/share/php/Icinga/Util/Translator.php:181 with message: Cannot set locale ‘ar_SA’ for category ‘LC_ALL’
2019-05-09T09:28:46+02:00 - ERROR - Icinga\Exception\IcingaException in /usr/share/php/Icinga/Util/Translator.php:181 with message: Cannot set locale ‘ar_SA’ for category ‘LC_ALL’
i can change between “Browser (de_DE) ”, “de_DE ” and “en_US ” without some entrys in the logfile.
log1c
May 9, 2019, 11:24am
9
Same issue here with Ubuntu18.04 and Icinga Web 2 v2.6.3
Had the de_DE locales missing at first, installed them via local-gen de_DE.UTF-8
and locale de_DE
de_DE installs this:
locale-gen de_DE
Generating locales (this might take a while)...
de_DE.ISO-8859-1... done
Generation complete.
did a reboot after that.
I also have no log entries when switching to de_DE or en_US.
Other languages trigger an entry.
nilmerg
(Johannes Meyer)
May 9, 2019, 2:43pm
10
So, just tried it myself with specifically Ubuntu 18.04 (docker).
Works like a charm. (After apt install locales && locale-gen de_DE
)
Since none of you get an error when choosing de_DE
I suspect there’s something wrong with your gettext integration. What does this output?: php -i | grep -i gettext
Should be something like this:
/etc/php/7.2/cli/conf.d/20-gettext.ini,
gettext
GetText Support => enabled
1 Like
log1c
May 9, 2019, 3:00pm
11
nilmerg:
php -i | grep -i gettext
# php -i | grep -i gettext
/etc/php/7.2/cli/conf.d/20-gettext.ini,
gettext
GetText Support => enabled
Did a apt install --reinstall locales
and a reboot. Didn’t help
Pio
May 9, 2019, 3:05pm
12
Thank you Johannes for testing.
After i “apt install locales && locale-gen de_DE ” and “update-local ” my output from “locale -a ” looks like.
root@MONITORING-TEST:~# locale -a
C
C.UTF-8
de_AT.utf8
de_BE.utf8
de_CH.utf8
de_DE
de_DE.iso88591
de_DE.utf8
de_IT.utf8
de_LI.utf8
de_LU.utf8
deutsch
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IL
en_IL.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZM
en_ZM.utf8
en_ZW.utf8
german
POSIX
The output of “php -i | grep -i gettext ” is.
root@MONITORING-TEST:~# php -i | grep -i gettext
/etc/php/7.2/cli/conf.d/20-gettext.ini,
gettext
GetText Support => enabled
i restarted icinga, php, apache und rebooted the server, just to be sure. But nothing happens
log1c
May 10, 2019, 6:02am
13
Did you, by chance, also use the English language in the Ubuntu installation process?
Because that is the only difference I can make out in the setup.
1 Like
Pio
May 10, 2019, 6:29am
14
i have Ubuntu installed with the following parameters.
Systemlanguage: EN
Location: DE
Locale: EN
Keyboardlayout: DE
Timezone: Europe/Berlin
can it be a problem that i have installed the DE Languagepack after i installed icingaweb2 ?
log1c
May 10, 2019, 6:54am
15
Some here.
I now manually changed /etc/default/locale
to
LANG=de_DE.UTF-8
LC_MESSAGES=en_US.UTF-8
to have error and system messages displayed in English.
Language of Icinga Web 2 is now changeable to German or English.
1 Like
nilmerg
(Johannes Meyer)
May 10, 2019, 8:29am
16
What were it’s contents previously? I currently try to reproduce this since we already had a case on Github but even with the following I still can switch languages without problem:
cat /etc/default/locale
# File generated by update-locale
LANG=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
1 Like
Pio
May 10, 2019, 8:43am
17
log1c:
I now manually changed /etc/default/locale
to
LANG=de_DE.UTF-8
LC_MESSAGES=en_US.UTF-8
to have error and system messages displayed in English.
Language of Icinga Web 2 is now changeable to German or English.
my locale before:
LANG=en_US.UTF-8
LANGUAGE=“en_US:en”
my locale after:
#File generated by update-locale
LANG=de_DE.UTF-8
#LANGUAGE=“en_US:en”
LC_MESSAGES=en_US.UTF-8
But the language in the web gui ist still english.
log1c
May 10, 2019, 8:46am
18
LANG=en_US.UTF-8
LANGUAGE=“en_US:en”
Did you do a reboot of the server after changing?
Did you refresh (F5) the webinterface after setting the language?
1 Like
Pio
May 10, 2019, 8:55am
19
After a reboot it works. Thanks!
For testing in browser i used FF, Vivaldi and Edge with delete cookies and a browser restart.
But how is the problem now? In my other Icinga installations (16.04 and 18.04) I do not have the problem.
nilmerg
(Johannes Meyer)
May 10, 2019, 9:06am
20
It’s due to the LANGUAGE
environment variable. Once this is set and visible to PHP it overrides any and all other settings. I’ll try to identify if this has changed recently (and when) or if it’s the case ever since and it became evident just recently.
Anyhow, not setting this environment variable is the solution.
2 Likes