[Nagiosplug-devel] [PATCH/PULL] Various improvements and fixes for check_pgsql

Sebastian Harl tokkee at debian.org
Fri Apr 8 11:31:32 CEST 2011


Hi,

I'm not sure about the preferred way to submit patches, so I'll just go
for a "pull request" for now. Please feel free to beat me to whatever
you prefer most ;-)

Anyway … I've got a few changes to the check_pgsql plugin sitting in the
sh/check_pgsql branch at git://oss.teamix.org/nagiosplug.git:

      check_pgsql: Added support for executing queries.
      check_pgsql: Fixed query perfdata output for empty warn/crit ranges.
      check_pgsql: Use PQconnectdb() rather than PQsetdbLogin().
      check_pgsql: Allow UNIX socket directories as hostname as well.
      check_pgsql: Removed -4/-6 flags from help output.
      check_pgsql: Added support for the -o command line option.
      check_pgsql: Updated copyright.
      check_pgsql: Leave 'min' value in query perfdata empty.
      check_pgsql: Determine connection time in µs-resolution.

The most important changes are the following:

    check_pgsql: Added support for executing queries.

    The query result (the double value of the first column in the first row, to be
    precise) will be checked against threshold ranges specified using the -C and
    -W options.

    Note that this also allows to query PostgreSQL internal values using the
    information available from the database daemon's "statistics collector" -- see
    the chapter "Monitoring Database Activity" in the PostgreSQL manual for
    details.

(diff: <http://oss.teamix.org/projects/nagiosplug/repository/diff?rev=8a55b5215a1194335455594e39ac2004e4eea754&rev_to=1bc7a4a198aefde2389c9c1685baed0da7856bf5>)

    check_pgsql: Added support for the -o command line option.

    This option may be used to specify further connection parameters to be passed
    to PQconnectdb(). For example, this may be used to specify a service name in
    pg_service.conf to be used for additional connection parameters: -o
    'service=<name>' or to specify the SSL mode: -o 'sslmode=require'.

    See the chapter "libpq - C Library" in the PostgreSQL manual for details.

(diff: <http://oss.teamix.org/projects/nagiosplug/repository/diff?rev=a02b463ff6c923d2432fe8ab6536262a250b330d&rev_to=5d7f78dd28b747a9117853a1465aebd767396329>)

I'd be happy for any feedback and comments.

Cheers,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://nagios-plugins.org/archive/devel/attachments/20110408/510f55ba/attachment.sig>


More information about the Devel mailing list