Skip to content

Commit

Permalink
Release 2.6
Browse files Browse the repository at this point in the history
gh PR #320
  • Loading branch information
ioguix committed Jul 8, 2022
1 parent fbdce0f commit 742b29d
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 31 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
Changelog
=========

2022-07-08 v2.6:

- add: new `session_stats` service to gather miscellaneous session statistics
- add: compatibility with PostgreSQL 14
- change: service `autovacuum` does not show `max_workers` anymore for 8.2 and below
- change: various messages cleanup
- fix: `last_vacuum` and `last_analyse` to reports the correct oldest maintenance
- fix: service `check_oldest_idlexact` now use `state_change` instead of
`xact_start` to calculate the idle time
- fix: improve locking around the status file to avoid dead locks and status file truncation
- fix: possible division by 0 in `table_bloat` service
- fix: threshold check and support interval for service `check_stat_snapshot_age`
- fix: service `check_archiver` when a .history or .backup file is staled
- fix: service `sequences_exhausted` now checks also sequences that are not owned by a table column
- fix: service `check_archiver` when no WAL was ever archived

2020-11-24 v2.5:

- add: new `oldest_xmin` service
Expand Down
35 changes: 31 additions & 4 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,16 @@ COMPATIBILITY

--status-file PATH
Path to the file where service status information is kept between
successive calls. Default is to save check_pgactivity.data in the
same directory as the script.
successive calls. Default is to save a file called
"check_pgactivity.data" in the same directory as the script.

Note that this file is protected from concurrent writes using a lock
file located in the same directory, having the same name than the
status file, but with the extension ".lock".

On some plateform, network filesystems may not be supported
correctly by the locking mechanism. See "perldoc -f flock" for more
information.

--dump-status-file
Dump the content of the status file and exit. This is useful for
Expand Down Expand Up @@ -430,6 +438,18 @@ COMPATIBILITY
role, in each database of the cluster: "GRANT SELECT ON pg_statistic
TO pg_monitor;"

session_stats (14+)
Gather miscellaneous session statistics.

This service uses the status file (see --status-file parameter).

Perfdata contains the session / active / idle-in-transaction times
for each database since last call, as well as the number of sessions
per second, and the number of sessions killed / abandoned /
terminated by fatal errors.

Required privileges: unprivileged role.

commit_ratio (all)
Check the commit and rollback rate per second since last call.

Expand Down Expand Up @@ -840,6 +860,12 @@ COMPATIBILITY
to filter out pg_dump and pg_dumpall, set this to
'pg_dump,pg_dumpall'.

Before 9.2, this services checks for idle transaction with their
start time. Thus, the service can mistakenly take account of
transaction transiently in idle state. From 9.2 and up, the service
checks for transaction that really had no activity since the given
thresholds.

Required privileges: an unprivileged role checks only its own
queries; a pg_monitor (10+) or superuser (<10) role is required to
check all queries.
Expand Down Expand Up @@ -1045,7 +1071,8 @@ COMPATIBILITY

Perfdata returns the statistics snapshot age.

Critical and Warning thresholds accept a raw number of seconds.
Critical and Warning thresholds only accept an interval (eg.
1h30m25s).

Required privileges: unprivileged role.

Expand Down Expand Up @@ -1268,7 +1295,7 @@ COMPATIBILITY
check_pgactivity -p 5433 -h slave --service hit_ratio --dbinclude importantone -w 90% -c 80%

VERSION
check_pgactivity version 2.5, released on Tue Nov 24 2020
check_pgactivity version 2.6, released on Fri Jul 08 2022.

LICENSING
This program is open source, licensed under the PostgreSQL license. For
Expand Down
33 changes: 29 additions & 4 deletions README.pod
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,17 @@ It should be version 8.3 at least, but the server can be older.

=item B<--status-file> PATH

Path to the file where service status information is kept between
successive calls. Default is to save check_pgactivity.data in the same
Path to the file where service status information is kept between successive
calls. Default is to save a file called C<check_pgactivity.data> in the same
directory as the script.

Note that this file is protected from concurrent writes using a lock file
located in the same directory, having the same name than the status file, but
with the extension C<.lock>.

On some plateform, network filesystems may not be supported correctly by the
locking mechanism. See C<perldoc -f flock> for more information.

=item B<--dump-status-file>

Dump the content of the status file and exit. This is useful for debugging
Expand Down Expand Up @@ -467,6 +474,18 @@ provided that you grant SELECT on the system table pg_statistic
to the pg_monitor role, in each database of the cluster:
C<GRANT SELECT ON pg_statistic TO pg_monitor;>

=item B<session_stats> (14+)

Gather miscellaneous session statistics.

This service uses the status file (see --status-file parameter).

Perfdata contains the session / active / idle-in-transaction times
for each database since last call, as well as the number of sessions per second,
and the number of sessions killed / abandoned / terminated by fatal errors.

Required privileges: unprivileged role.

=item B<commit_ratio> (all)

Check the commit and rollback rate per second since last call.
Expand Down Expand Up @@ -877,6 +896,12 @@ This service supports both C<--dbexclude> and C<--dbinclude> parameters.
Above 9.2, it supports C<--exclude> to filter out connections. Eg., to
filter out pg_dump and pg_dumpall, set this to 'pg_dump,pg_dumpall'.

Before 9.2, this services checks for idle transaction with their start time.
Thus, the service can mistakenly take account of transaction transiently in
idle state.
From 9.2 and up, the service checks for transaction that really had no activity
since the given thresholds.

Required privileges: an unprivileged role checks only its own queries;
a pg_monitor (10+) or superuser (<10) role is required to check all queries.

Expand Down Expand Up @@ -1078,7 +1103,7 @@ This probe helps to detect a frozen stats collector process.

Perfdata returns the statistics snapshot age.

Critical and Warning thresholds accept a raw number of seconds.
Critical and Warning thresholds only accept an interval (eg. 1h30m25s).

Required privileges: unprivileged role.

Expand Down Expand Up @@ -1309,7 +1334,7 @@ pg_ls_waldir

=head1 VERSION

check_pgactivity version 2.5, released on Tue Nov 24 2020
check_pgactivity version 2.6, released on Fri Jul 08 2022.

=head1 LICENSING

Expand Down
56 changes: 38 additions & 18 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,75 @@

## Source code

Edit variable `$VERSION` in `check_pgactivity`

Update the version field at
the end of the inline documentation in this script.
In `check_pgactivity`:
* edit variable `$VERSION`
* update the version and release date at the end of the inline documentation
* date format: `LC_TIME=C date +"%a %b %d %Y"`

In `check_pgactivity.spec`:
* update the tag in the `_tag` variable (first line)
* update the version in `Version:`
* edit the changelog
* date format: `LC_TIME=C date +"%a %b %d %Y"`

## Run tests
In `CHANGELOG.md`, add a changelog entry for the new release with the format:

Run the tests against all possible PostgreSQL releases. At least the one
officially supported. Fix code or tests before releasing.
~~~
YYYY-MM-DD vX.Y:
* add: description...
* ...
* change: description...
* ...
* fix: description...
* ...
~~~

In `t/01-pga_version.t`, edit variable `$good_version`.

## Documentation
Update documentation using the following commands:

Generate updated documentation:
```
~~~
pod2text check_pgactivity > README
podselect check_pgactivity > README.pod
```
~~~

Update the `contributors` file with new contributors.

## Run tests

Run the tests against all possible PostgreSQL releases. At least the one
officially supported. Fix code or tests before releasing.

## Commit

Commit all these changes together with commit message: `Release X.Y`.

## Tagging and building tar file

Directly into the official repo:

```
~~~
TAG=REL2_4
git tag -a $TAG <Release commit number>
git push --tags
git archive --prefix=check_pgactivity-$TAG/ -o /tmp/check_pgactivity-$TAG.tgz $TAG
```
~~~

## Release on github

- Go to https://github.com/OPMDG/check_pgactivity/releases
- Edit the release notes for the new tag
- Set "check_pgactivity $VERSION" as title, eg. "check_pgactivity 2.4"
- Here is the format of the release node itself:
~~~
YYYY-MM-DD - Version X.Y
Changelog:
* item 1
* item 2
* ...
~~~
- Upload the tar file
- Save
- Check or update https://github.com/OPMDG/check_pgactivity/releases
Expand All @@ -59,21 +79,21 @@ git archive --prefix=check_pgactivity-$TAG/ -o /tmp/check_pgactivity-$TAG.tgz $T
### Installation
```
~~~
yum group install "Development Tools"
yum install rpmdevtools
useradd makerpm
```
~~~
### Building the package
```
~~~
su - makerpm
rpmdev-setuptree
git clone https://github.com/OPMDG/check_pgactivity.git
spectool -R -g check_pgactivity/check_pgactivity.spec
rpmbuild -ba check_pgactivity/check_pgactivity.spec
```
~~~
The RPM is generated into `rpmbuild/RPMS/noarch`.
Expand Down
4 changes: 2 additions & 2 deletions check_pgactivity
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ delete $ENV{'LANGUAGE'};

$| = 1;

$VERSION = '2.5';
$VERSION = '2.6';
$PROGRAM = 'check_pgactivity';

my $PG_VERSION_MIN = 70400;
Expand Down Expand Up @@ -9265,7 +9265,7 @@ __END__
=head1 VERSION
check_pgactivity version 2.5, released on Tue Nov 24 2020
check_pgactivity version 2.6, released on Fri Jul 08 2022.
=head1 LICENSING
Expand Down
7 changes: 5 additions & 2 deletions check_pgactivity.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%global _tag REL2_5
%global _tag REL2_6

Name: nagios-plugins-pgactivity
Version: 2.5
Version: 2.6
Release: 1
Summary: PostgreSQL monitoring plugin for Nagios
License: PostgreSQL
Expand Down Expand Up @@ -32,6 +32,9 @@ install -D -p -m 0755 check_pgactivity %{buildroot}/%{_libdir}/nagios/plugins/ch
%doc README LICENSE

%changelog
* Fri Jul 08 2022 Jehan-Guillaume de Rorthais <jgdr@dalibo.com> 2.6-1
- new major release 2.6

* Tue Nov 24 2020 Jehan-Guillaume de Rorthais <jgdr@dalibo.com> 2.5-1
- new major release 2.5

Expand Down
1 change: 1 addition & 0 deletions contributors
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The following contributors helped to bring check_pgactivity :
* Andrey L. (loukash)
* macarbiter
* Frédéric Yhuel
* Julian Vanden Broeck

And many users that reported issues. Thanks to all !

2 changes: 1 addition & 1 deletion t/01-pga_version.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use Test::More tests => 18;

### Begin of tests ###

my $good_version = '2.5';
my $good_version = '2.6';
my $bad_version = '0.0';
my $not_version = 'whatever';

Expand Down

0 comments on commit 742b29d

Please sign in to comment.