Re: [PATCH/PULL] Various improvements and fixes for check_pgsql

Sebastian Harl <[email protected]>
Newsgroups gmane.network.nagios.plugins.devel
Message-ID <[email protected]>
Hi,

while going through my nagios-plugins repo, I noticed the following
branch still sitting there ;-)

While the query support is a bit redundant with the check_dbi plugin by
now, I still think that could also be included in check_pgsql (after all
the code is already there, it's not that complex/much and I'm willing to
support it ;-)). Comments, flames, whatever about that would be much
appreciated, though. If people disagree, I'll extract the other patches.

The branch is now available at
<https://github.com/tokkee/nagios-plugins/tree/sh/check_pgsql>.

Any comments, feedback?

Cheers,
Sebastian

On Fri, Apr 08, 2011 at 11:31:32AM +0200, Sebastian Harl wrote:
> 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 Harl
Consultant, Trainer

teamix GmbH
Südwestpark 35
90449 Nürnberg

fon:   +49 911 30999-0
fax:   +49 911 30999-99
mail:  [email protected]
web:   http://www.teamix.de

Amtsgericht Nürnberg, HRB 18320
Geschäftsführer: Oliver Kügow, Richard Müller

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

_______________________________________________________
Nagios Plugin Development Mailing List Nagiosplug-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Unsubscribe at https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel
::: Please include plugins version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null
signature.asc (application/pgp-signature, 836 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBAgAGBQJP9WQyAAoJENhL2qQCcg3AO0oP/i9TppAqLZraO+Md1TKk+LCj
Q3IzEA2fB3hEr24lRBch9qo7BuDw16qsjg0C1TxLcp7Iw3ZR8Tk40tWJFy6P2l13
UnoQok09/FxKBjsewaCWZwCFDrsmrzz7wAqBpFV2cG/rLE/+5EEdcJ3PKY2Gt43x
Zb5RRBB0uIVVfELR4j63bsv1wiVqNDLUhh0GWuJVanz35q9Al3CS8+UptyxHXj98
eCt3AtJn0tprVeoW2VFgzWRF/ih1TVuJdnsNRO/53N4OkpoUoNhv0+fOQTjvFpDV
ZE2jP5CRhZyCSIXT9UEV958T6OWbhsGx4yRo0gdQXeKdriOWMlpGkEGBN8tmvX7t
4W0RP1mSOEKgoCuLnts+PoSY6e4duESnU/o7HP2zNYguudVeaMJywpfNtvTrU9eI
xrt8UQ4RPTplNKvh2SNNYN10SXzJFcT9/Pnxo0EMqTfAN30L8KVmvGnxlUq7cQT2
nnq+Q5VZGvnsgHz4rOYr2UP+zb8jNsI8Iebet8ReMoYVli3GzH4aJoJ/jUVmFlL1
I2qepvcZw2t7a1HLObL+Mc2Xg7716Iaei3ZxhMKs/G88L2Rz2vNUcJt4Tu0x0q/I
nNnVNVg3meeJF/XXI878mOGM03EarvCEUfMgKZBbkUPEZzFKXUGxGrwExD2YIHLu
dnx3go0+pFF4pz+erA0t
=LXSK
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.