Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions check_pgactivity
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,19 @@ $| = 1;
$VERSION = '1.25dev';
$PROGRAM = 'check_pgactivity';

my $PG_VERSION_MIN = 70400;
my $PG_VERSION_74 = 70400;
my $PG_VERSION_80 = 80000;
my $PG_VERSION_81 = 80100;
my $PG_VERSION_82 = 80200;
my $PG_VERSION_83 = 80300;
my $PG_VERSION_84 = 80400;
my $PG_VERSION_90 = 90000;
my $PG_VERSION_91 = 90100;
my $PG_VERSION_92 = 90200;
my $PG_VERSION_93 = 90300;
my $PG_VERSION_94 = 90400;
my $PG_VERSION_MIN = 70400;
my $PG_VERSION_74 = 70400;
my $PG_VERSION_80 = 80000;
my $PG_VERSION_81 = 80100;
my $PG_VERSION_82 = 80200;
my $PG_VERSION_83 = 80300;
my $PG_VERSION_84 = 80400;
my $PG_VERSION_90 = 90000;
my $PG_VERSION_91 = 90100;
my $PG_VERSION_92 = 90200;
my $PG_VERSION_93 = 90300;
my $PG_VERSION_94 = 90400;
my $PG_VERSION_100 = 100000;

# Available services and descriptions.
#
Expand Down Expand Up @@ -886,7 +887,8 @@ sub query_ver($\%;$) {

set_pgversion($host);

foreach my $ver ( sort { $b cmp $a } keys %queries ) {
# foreach my $ver ( sort { $b cmp $a } keys %queries ) {
foreach my $ver ( sort { $b <=> $a } keys %queries ) {
return query( $host, $queries{$ver}, $db )
if ( $ver <= $host->{'version_num'} );
}
Expand Down Expand Up @@ -4513,6 +4515,10 @@ sub check_streaming_delta {
my $master_location = '';
my $num_clusters = 0;
my %queries = (
$PG_VERSION_100 => q{SELECT application_name, client_addr, pid,
sent_lsn, write_lsn, flush_lsn, replay_lsn,
CASE pg_is_in_recovery() WHEN true THEN pg_last_wal_receive_lsn() ELSE pg_current_wal_lsn() END
FROM pg_stat_replication},
$PG_VERSION_92 => q{SELECT application_name, client_addr, pid,
sent_location, write_location, flush_location, replay_location,
CASE pg_is_in_recovery() WHEN true THEN pg_last_xlog_receive_location() ELSE pg_current_xlog_location() END
Expand Down