diff options
author | Greg Sabino Mullane | 2009-07-12 02:15:29 +0000 |
---|---|---|
committer | Greg Sabino Mullane | 2009-07-12 02:15:29 +0000 |
commit | 6f751f53135064e19a6ceec824c6a5aa35412e14 (patch) | |
tree | 84db14dac8aff9d0891d3e9593aef3ed333d8358 /check_postgres.pl | |
parent | 1f2de60db9bdf6060d568f9be4333061505d629c (diff) |
Make the backends "too many clients" messages i18n friendly.
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-x | check_postgres.pl | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/check_postgres.pl b/check_postgres.pl index 7e1105e06..a092b25a3 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -89,6 +89,7 @@ our %msg = ( 'backends-msg' => q{$1 of $2 connections ($3%)}, 'backends-nomax' => q{Could not determine max_connections}, 'backends-oknone' => q{No connections}, + 'backends-po' => q{sorry, too many clients already}, 'backends-users' => q{$1 for number of users must be a number or percentage}, 'bloat-index' => q{(db $1) index $2 rows:$3 pages:$4 shouldbe:$5 ($6X) wasted bytes:$7 ($8)}, 'bloat-nomin' => q{no relations meet the minimum bloat criteria}, @@ -282,6 +283,7 @@ our %msg = ( 'backends-msg' => q{$1 connexions sur $2 ($3%)}, 'backends-nomax' => q{N'a pas pu déterminer max_connections}, 'backends-oknone' => q{Aucune connexion}, + 'backends-po' => q{d�sol�, trop de clients sont d�j� connect�s}, 'backends-users' => q{$1 pour le nombre d'utilisateurs doit être un nombre ou un pourcentage}, 'bloat-index' => q{(db $1) index $2 lignes:$3 pages:$4 devrait être:$5 ($6X) octets perdus:$7 ($8)}, 'bloat-nomin' => q{aucune relation n'atteint le critère minimum de fragmentation}, @@ -475,15 +477,18 @@ our %msg = ( 'checkpoint-po' => q{�as posledn�ho kontroln�ho bodu:}, }, 'de' => { + 'backends-po' => q{tut mir leid, schon zu viele Verbindungen}, 'checkpoint-po' => q{Zeit des letzten Checkpoints:}, }, 'es' => { + 'backends-po' => q{lo siento, ya tenemos demasiados clientes}, 'checkpoint-po' => q{Instante de �ltimo checkpoint:}, }, 'fa' => { 'checkpoint-po' => q{زمان آخرین وارسی:}, }, 'hr' => { + 'backends-po' => q{nažalost, već je otvoreno previše klijentskih veza}, }, 'hu' => { 'checkpoint-po' => q{A legut�bbi ellen�rz�pont ideje:}, @@ -492,12 +497,15 @@ our %msg = ( 'checkpoint-po' => q{Orario ultimo checkpoint:}, }, 'ja' => { + 'backends-po' => q{現在クライアント数が多すぎます}, 'checkpoint-po' => q{最終チェックポイント時刻:}, }, 'ko' => { + 'backends-po' => q{최대 동시 접속자 수를 초과했습니다.}, 'checkpoint-po' => q{������ üũ����Ʈ �ð�:}, }, 'nb' => { + 'backends-po' => q{beklager, for mange klienter}, 'checkpoint-po' => q{Tidspunkt for nyeste kontrollpunkt:}, }, 'nl' => { @@ -506,33 +514,41 @@ our %msg = ( 'checkpoint-po' => q{Czas najnowszego punktu kontrolnego:}, }, 'pt_BR' => { + 'backends-po' => q{desculpe, muitos clientes conectados}, 'checkpoint-po' => q{Hora do último ponto de controle:}, }, 'ro' => { 'checkpoint-po' => q{Timpul ultimului punct de control:}, }, 'ru' => { + 'backends-po' => q{��������, ��� ������� ����� ��������}, 'checkpoint-po' => q{����� ��������� checkpoint:}, }, 'sk' => { + 'backends-po' => q{je mi ��to, je u� pr�li� ve�a klientov}, 'checkpoint-po' => q{Čas posledného kontrolného bodu:}, }, 'sl' => { + 'backends-po' => q{povezanih je �e preve� odjemalcev}, 'checkpoint-po' => q{�as zadnje kontrolne to�ke ............}, }, 'sv' => { + 'backends-po' => q{ledsen, f�r m�nga klienter}, 'checkpoint-po' => q{Tidpunkt f�r senaste kontrollpunkt:}, }, 'ta' => { 'checkpoint-po' => q{நவீன சோதனை மையத்தின் நேரம்:}, }, 'tr' => { + 'backends-po' => q{üzgünüm, istemci sayısı çok fazla}, 'checkpoint-po' => q{En son checkpoint'in zamanı:}, }, 'zh_CN' => { + 'backends-po' => q{�Բ���, �Ѿ���̫��Ŀͻ�}, 'checkpoint-po' => q{���¼����ʱ��:}, }, 'zh_TW' => { + 'backends-po' => q{對不起,用戶端過多}, 'checkpoint-po' => q{最新的檢查點時間:}, }, ); @@ -2292,9 +2308,13 @@ sub check_backends { my $info = run_command($SQL, {regex => qr[\s*\d+ \| \d+\s+\|], fatalregex => 'too many clients' } ); ## If we cannot connect because of too many clients, we treat as a critical error - if (exists $info->{fatalregex} and $info->{fatalregex} =~ /too many clients/) { - add_critical msg('backends-fatal'); - return; + if (exists $info->{fatalregex}) { + my $regmsg = msg('backends-po'); + my $regmsg2 = msg('backends-po', 'en'); + if ($info->{fatalregex} =~ /$regmsg/ or $info->{fatalregex} =~ /$regmsg2/) { + add_critical msg('backends-fatal'); + return; + } } ## There may be no entries returned if we catch pg_stat_activity at the right |