-
Problem report
-
Resolution: Fixed
-
Major
-
4.4.4
-
Sprint 60 (Jan 2020), Sprint 61 (Feb 2020), Sprint 62 (Mar 2020), Sprint 63 (Apr 2020), Sprint 64 (May 2020), Sprint 65 (Jun 2020), Sprint 66 (Jul 2020), Sprint 67 (Aug 2020), Sprint 68 (Sep 2020), Sprint 69 (Oct 2020), Sprint 70 (Nov 2020), Sprint 71 (Dec 2020)
-
0.25
Steps to reproduce:
If locale for zabbix user is not English psql will return localized output which cause preprocessing regex to fail.
Example requests:
Localized one which is failing.
zabbix@dbhost:~$ zabbix_get -s dbhost -k 'pgsql.ping.time["/run/postgresql/","5432","zbx_monitor","postgres"]'
1
Время: 0,207 мс
English one which is fine.
LANG=C.UTF-8 psql -qtAX -h "/run/postgresql/" -p "5432" -U "zbx_monitor" -d "postgres" -f "/var/lib/zabbix/postgresql/pgsql.ping.time.sql" 1 Time: 0.188 ms
Result:
Preprocessing failed for: 1.Время: 0,204 мс
1. Failed: cannot perform regular expression "Time:\s(\d+\.\d+)\sms" match for value of type "string": pattern does not match
Expected:
Regex suitable for any locale. Or locale forced to English in userparameters configuration. Something like:
UserParameter=pgsql.ping.time[*], LANG=C.UTF-8 psql -qtAX -h "$1" -p "$2" -U "$3" -d "$4" -f "/var/lib/zabbix/postgresql/pgsql.ping.time.sql"