summaryrefslogtreecommitdiff
path: root/check_postgres.pl
diff options
context:
space:
mode:
authorPeter Eisentraut2014-06-11 20:04:38 +0000
committerPeter Eisentraut2014-06-11 20:04:38 +0000
commitf958d61e84212de92079401fbc29a183850cce73 (patch)
tree2a8e7360abb20a003122cd54db7f4d2e58c0410a /check_postgres.pl
parentff6e828dc4346194c007a79fbee98b6c0f9268d1 (diff)
Show actual long-running query in query_time output
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-xcheck_postgres.pl7
1 files changed, 5 insertions, 2 deletions
diff --git a/check_postgres.pl b/check_postgres.pl
index d3c55815e..32bf11c53 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -209,6 +209,7 @@ our %msg = (
'qtime-for-msg' => q{$1 queries longer than $2s, longest: $3s$4 $5},
'qtime-msg' => q{longest query: $1s$2 $3},
'qtime-none' => q{no queries},
+ 'query' => q{query},
'queries' => q{queries},
'query-time' => q{query_time},
'range-badcs' => q{Invalid '$1' option: must be a checksum},
@@ -461,6 +462,7 @@ our %msg = (
'qtime-for-msg' => q{$1 requêtes plus longues que $2s, requête la plus longue : $3s$4 $5},
'qtime-msg' => q{requête la plus longue : $1s$2 $3},
'qtime-none' => q{aucune requête},
+ 'query' => q{requête},
'queries' => q{requêtes},
'query-time' => q{durée de la requête},
'range-badcs' => q{Option « $1 » invalide : doit être une somme de contrôle},
@@ -7661,13 +7663,14 @@ sub check_txn_idle {
## Details on who the top offender was
if ($max > 0) {
- $whodunit = sprintf q{%s:%s %s:%s %s:%s%s%s},
+ $whodunit = sprintf q{%s:%s %s:%s %s:%s%s%s %s:%s},
msg('PID'), $maxr->{pid},
msg('database'), $maxr->{datname},
msg('username'), $maxr->{usename},
$maxr->{client_addr} eq '' ? '' : (sprintf ' %s:%s', msg('address'), $maxr->{client_addr}),
($maxr->{client_port} eq '' or $maxr->{client_port} < 1)
- ? '' : (sprintf ' %s:%s', msg('port'), $maxr->{client_port});
+ ? '' : (sprintf ' %s:%s', msg('port'), $maxr->{client_port}),
+ msg('query'), $maxr->{query} || $maxr->{current_query};
}
## For MRTG, we can simply exit right now