Sets the threshold at which a critical alert is fired. The valid options for this
option depends on the action used.

-t VAL or –timeout=VAL

Sets the timeout in seconds after which the script will abort whatever it is doing
and return an UNKNOWN status. The timeout is per Postgres cluster, not for the entire
script. The default value is 10; the units are always in seconds.

-h or –help

Displays a help screen with a summary of all actions and options.

-V or –version

Shows the current version.

-v or –verbose

Set the verbosity level. Can call more than once to boost the level. Setting it to three
or higher (in other words, issuing -v -v -v) turns on debugging information for this
program which is sent to stderr.


Determines if we output additional performance data in standard Nagios format
(at end of string, after a pipe symbol, using name=value).
VAL should be 0 or 1. The default is 1. Only takes effect if using Nagios output mode.


Sets a limit as to how many items of interest are reported back when using the
showperf option. This only has an effect for actions that return a large
number of items, such as table_size. The default is 0, or no limit. Be
careful when using this with the –include or –exclude options, as
those restrictions are done after the query has been run, and thus your
limit may not include the items you want. Only takes effect if using Nagios output mode.


Determines if the time taken to run each query is shown in the output. VAL
should be 0 or 1. The default is 1. No effect unless showperf is on.
Only takes effect if using Nagios output mode.


Enables test mode. See the TEST MODE section below.


Tells the script where to find the psql program. Useful if you have more than
one version of the psql executable on your system, or if there is no psql program
in your path. Note that this option is in all uppercase. By default, this option
is not allowed. To enable it, you must change the $NO_PSQL_OPTION near the
top of the script to 0. Avoid using this option if you can, and instead hard-code
your psql location into the $PSQL variable, also near the top of the script.


Creates symlinks to the main program for each action.


Determines the format of the output, for use in various programs. The default is ‘nagios’. No
other systems are supported yet.


Used only for the MRTG or simple output, for a few specific actions.


Outputs the exact string returned by psql, for use in debugging. The value is one or more letters,
which determine if the output is displayed or not, where ‘a’ = all, ‘c’ = critical, ‘w’ = warning,
‘o’ = ok, and ‘u’ = unknown. Letters can be combined.


The script runs one or more actions. This can either be done with the –action
flag, or by using a symlink to the main file that contains the name of the action
inside of it. For example, to run the action "timesync", you may either issue:


  1. --action=timesync

or use a program named:


  1. check_postgres_timesync

All the symlinks are created for you in the current directory
if use the option –symlinks


  1. perl --symlinks

If the file name already exists, it will not be overwritten. If the file exists
and is a symlink, you can force it to overwrite by using "–action=build_symlinks_force"

Most actions take a –warning and a –critical option, indicating at what
point we change from OK to WARNING, and what point we go to CRITICAL. Note that
because criticals are always checked first, setting the warning equal to the
critical is an effective way to turn warnings off and always give a critical.

The current supported actions are:

Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment