Skip to content

Commit

Permalink
add check command for plugin check_pgsql
Browse files Browse the repository at this point in the history
fixes #10112

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
  • Loading branch information
lbetz authored and Michael Friedrich committed Sep 14, 2015
1 parent 4f063b8 commit c601e69
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
22 changes: 22 additions & 0 deletions doc/7-icinga-template-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,28 @@ mailq_timeout | **Optional.** Plugin timeout in seconds (default = 15).
mailq_servertype | **Optional.** [ sendmail | qmail | postfix | exim | nullmailer ] (default = autodetect).


## <a id="plugin-check-command-pgsql"></a> pgsql

Check command object for the `check_pgsql` plugin.

Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters):

Name | Description
------------------------|---------------------------------------------------------------
pgsql_hostname | **Optional.** Host name, IP Address, or unix socket (must be an absolute path).
pgsql_port | **Optional.** Port number (default: 5432).
pgsql_database | **Optional.** Database to check (default: template1).
pgsql_username | **Optional.** Login name of user.
pgsql_password | **Optional.** Password (BIG SECURITY ISSUE).
pgsql_options | **Optional.** Connection parameters (keyword = value), see below.
pgsql_warning | **Optional.** Response time to result in warning status (seconds).
pgsql_critical | **Optional.** Response time to result in critical status (seconds).
pgsql_timeout | **Optional.** Seconds before connection times out (default: 10).
pgsql_query | **Optional.** SQL query to run. Only first column in first row will be read.
pgsql_query_warning | **Optional.** SQL query value to result in warning status (double).
pgsql_query_critical | **Optional.** SQL query value to result in critical status (double).


# <a id="windows-plugins"></a>Icinga 2 Windows plugins

To allow a basic monitoring of Windows clients Icinga 2 comes with a set of Windows only plugins. While trying to mirror the functionalities of their linux cousins from the monitoring-plugins package, the differences between Windows and Linux are too big to be able use the same CheckCommands for both systems.
Expand Down
25 changes: 25 additions & 0 deletions itl/command-plugins.conf
Original file line number Diff line number Diff line change
Expand Up @@ -1620,3 +1620,28 @@ object CheckCommand "mailq" {
}
}
}

object CheckCommand "pgsql" {
import "plugin-check-command"
import "ipv4-or-ipv6"

command = [ PluginDir + "/check_pgsql" ]

arguments = {
"-H" = "$pgsql_hostname$"
"-P" = "$pgsql_port$"
"-d" = "$pgsql_database$"
"-l" = "$pgsql_username$"
"-p" = "$pgsql_password$"
"-o" = "$pgsql_options$"
"-w" = "$pgsql_warning$"
"-c" = "$pgsql_critical$"
"-t" = "$pgsql_timeout$"
"-q" = "$pgsql_query$"
"-W" = "$pgsql_query_warning$"
"-C" = "$pgsql_query_critical$"
}

vars.pgsql_hostname = "$check_address$"
}

0 comments on commit c601e69

Please sign in to comment.