[check_postgres] Is it possible to run on *all* databases?

Aleksey Tsalolikhin atsaloli.tech at gmail.com
Mon Aug 22 19:06:57 UTC 2016


On Tue, Oct 27, 2015 at 2:21 AM, Jehan-Guillaume de Rorthais <
jgdr at dalibo.com> wrote:

> On Thu, 15 Oct 2015 11:33:46 +0200
> Rory McCann <rory at technomancy.org> wrote:
>
> > check_postgres looks pretty cool, and I'm adding it to our Nagios set
> > up. But it would be very helpful if there is a way to run an action on
> > *all* databases, so that I don't have to add a separate service for each
> > database. Is this possible? Built-in nagios checks like check_disk do
> > this, and will report a CRITICAL/WARNING if any one of the disks is
> > full. Is it possible to have this for check_postgres?
>
> Checks in check_pgactivity are running on all database by default. Then you
> have --dbinclude or --dbexclude change this behaviour if needed.
>
> See:
> https://exchange.nagios.org/directory/Plugins/Databases/
> PostgresQL/check_pgactivity/details


We have run into the same issue as Rory -- I would like the check_postgres
checks for bloat, locks and sequence exhaustion to run across all databases
in the database cluster specified with the -H command.

Reading the man page, I see that we can have multiple --dbname commands:

       -db NAME or --dbname=NAME
           Specifies which database to connect to. Can be a comma-separated
list of names, and multiple dbname arguments are allowed. If no dbname
option is provided, defaults to the "PGDATABASE" environment variable.
           If that is not set, it defaults to ’postgres’ if psql is version
8 or greater, and ’template1’ otherwise.

As a user, it would be nice to be able to say -db '*', or just have that
happen by default.  :)

Thanks for a great utility!

Best,
-at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.endcrypt.com/pipermail/check_postgres/attachments/20160822/90cdaa9b/attachment.html>


More information about the Check_postgres mailing list