diff --git a/check_postgres.changes b/check_postgres.changes index 87c660a..df546e7 100644 --- a/check_postgres.changes +++ b/check_postgres.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jul 12 18:57:47 UTC 2012 - darin@darins.net + +- added a sample nagios/check_mk command definition file + ------------------------------------------------------------------- Tue Jul 10 16:39:09 UTC 2012 - darin@darins.net diff --git a/check_postgres.spec b/check_postgres.spec index fc7490d..4c88b0a 100644 --- a/check_postgres.spec +++ b/check_postgres.spec @@ -18,6 +18,7 @@ Url: http://bucardo.org/wiki/Check_postgres License: GPL-2.0+ Group: System/Monitoring Source0: %{name}-%{version}.tar.bz2 +Source1: nagios-commands-postgres.cfg Requires: postgresql BuildRequires: perl-macros BuildRequires: perl(DBD::Pg) @@ -67,6 +68,7 @@ Nagios plugins way. %prep %setup -q +%{__install} -m 0644 %SOURCE1 nagios-commands-postgres.cfg %build perl Makefile.PL @@ -98,7 +100,7 @@ rm -rf %buildroot %files -f %{name}.files %defattr(-,root,root) -%doc MANIFEST README TODO +%doc MANIFEST README TODO nagios-commands-postgres.cfg %files -n nagios-plugins-postgres %defattr(-,root,root) diff --git a/nagios-commands-postgres.cfg b/nagios-commands-postgres.cfg new file mode 100644 index 0000000..11f3e7b --- /dev/null +++ b/nagios-commands-postgres.cfg @@ -0,0 +1,370 @@ +# +# Command definitions for check_postgres.pl +# +# Notes: +# +# - to enabled these command definitions: +# - cp nagios-commands-postgres.cfg /etc/nagios/objects/ +# - add cfg_file=/etc/nagios/objects/nagios-commands-postgres.cfg to /etc/nagios/nagios.cfg +# +# OR +# +# - if using check_mk see http://mathias-kettner.de/checkmk_legacy_checks.html +# +# - cp nagios-commands-postgres.cfg /etc/check_mk/conf.d/extra_nagios_conf.mk +# - add to beginning of file uncomment: +# extra_nagios_conf += r""" +# - add to end of file uncomment: +# """ +# +# - setting the pguser password in this file is not advised, use a .pgpass file instead when possible +# +# Example, assuming the same user/pass on all servers) +# +# echo "*:*:*:pgmonitor:password" > /var/lib/nagios/.pgpass +# chmod 0600 /var/lib/nagios/.pgpass +# chown nagios:nagios /var/lib/nagios/.pgpass + +# uncomment for check_mk legacy_checks +#extra_nagios_conf += r""" + +# 'check_postgres_archive_ready' command definition +# +# This command requires SUPERUSER privileges +define command { + command_name check_postgres_archive_ready + command_line $USER1$/check_postgres_archive_ready -H $HOSTADDRESS$ -u pgmonitor -w $ARG1$ -c $ARG2$ + } + +# 'check_postgres_autovac_freeze' command definition +define command { + command_name check_postgres_autovac_freeze + command_line $USER1$/check_postgres_autovac_freeze -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_backends' command definition +define command { + command_name check_postgres_backends + command_line $USER1$/check_postgres_backends -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_bloat' command definition +define command { + command_name check_postgres_bloat + command_line $USER1$/check_postgres_bloat -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_checkpoint' command definition +# +# Can only be run as the user who initialized a database cluster +#define command { +# command_name check_postgres_checkpoint +# command_line $USER1$/check_postgres_checkpoint -H $HOSTADDRESS$ -u pgmonitor --datadir $ARG1$ +# } + +# 'check_postgres_cluster_id' command definition +# +# This is a local check +#define command { +# command_name check_postgres_cluster_id +# command_line $USER1$/check_postgres_cluster_id -H $HOSTADDRESS$ +# } + +# 'check_postgres_connection' command definition +define command { + command_name check_postgres_connection + command_line $USER1$/check_postgres_connection -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_custom_query' command definition +define command { + command_name check_postgres_custom_query + command_line $USER1$/check_postgres_custom_query -H $HOSTADDRESS$ -u pgmonitor -w $ARG1$ -c $ARG2$ + } + +# 'check_postgres_database_size' command definition +define command { + command_name check_postgres_database_size + command_line $USER1$/check_postgres_database_size -H $HOSTADDRESS$ -u pgmonitor -w $ARG1$ -c $ARG2$ + } + +# 'check_postgres_disabled_triggers' command definition +define command { + command_name check_postgres_disabled_triggers + command_line $USER1$/check_postgres_disabled_triggers -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_disk_space' command definition +# +# This command requires SUPERUSER privileges +define command { + command_name check_postgres_disk_space + command_line $USER1$/check_postgres_disk_space -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_fsm_pages' command definition +# +# Cannot check fsm_pages on servers version 8.4 or greater +define command { + command_name check_postgres_fsm_pages + command_line $USER1$/check_postgres_fsm_pages -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_fsm_relations' command definition +# +# Cannot check fsm_pages on servers version 8.4 or greater +define command { + command_name check_postgres_fsm_relations + command_line $USER1$/check_postgres_fsm_relations -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_hitratio' command definition +# +define command { + command_name check_postgres_hitratio + command_line $USER1$/check_postgres_hitratio -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_hot_standby_delay' command definition +# +# Must be run as user postgres +define command { + command_name check_postgres_hot_standby_delay + command_line $USER1$/check_postgres_hot_standby_delay -H $HOSTADDRESS$ -u postgres + } + +# 'check_postgres_index_size' command definition +define command { + command_name check_postgres_index_size + command_line $USER1$/check_postgres_index_size -H $HOSTADDRESS$ -u pgmonitor -w $ARG1$ -c $ARG2$ + } + +# 'check_postgres_last_analyze' command definition +# +define command { + command_name check_postgres_last_analyze + command_line $USER1$/check_postgres_last_analyze -H $HOSTADDRESS$ -u pgmonitor -db $ARG1$ + } + +# 'check_postgres_last_autoanalyze' command definition +define command { + command_name check_postgres_last_autoanalyze + command_line $USER1$/check_postgres_last_autoanalyze -H $HOSTADDRESS$ -u pgmonitor -db $ARG1$ + } + +# 'check_postgres_last_autovacuum' command definition +define command { + command_name check_postgres_last_autovacuum + command_line $USER1$/check_postgres_last_autovacuum -H $HOSTADDRESS$ -u pgmonitor -db $ARG1$ + } + +# 'check_postgres_last_vacuum' command definition +define command { + command_name check_postgres_last_vacuum + command_line $USER1$/check_postgres_last_vacuum -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_listener' command definition +define command { + command_name check_postgres_listener + command_line $USER1$/check_postgres_listener -H $HOSTADDRESS$ -u pgmonitor -w $ARG1$ + } + +# 'check_postgres_locks' command definition +define command { + command_name check_postgres_locks + command_line $USER1$/check_postgres_locks -H $HOSTADDRESS$ -u pgmonitor -db $ARG1$ + } + +# 'check_postgres_logfile' command definition +# +# Requires read permissions to the log file +#define command { +# command_name check_postgres_logfile +# command_line $USER1$/check_postgres_logfile -H $HOSTADDRESS$ -u pgmonitor +# } + +# 'check_postgres_new_version_bc' command definition +define command { + command_name check_postgres_new_version_bc + command_line $USER1$/check_postgres_new_version_bc -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_new_version_cp' command definition +define command { + command_name check_postgres_new_version_cp + command_line $USER1$/check_postgres_new_version_cp -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_new_version_pg' command definition +define command { + command_name check_postgres_new_version_pg + command_line $USER1$/check_postgres_new_version_pg -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_new_version_tnm' command definition +define command { + command_name check_postgres_new_version_tnm + command_line $USER1$/check_postgres_new_version_tnm -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_pgb_pool_cl_active' command definition +define command { + command_name check_postgres_pgb_pool_cl_active + command_line $USER1$/check_postgres_pgb_pool_cl_active -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_pgb_pool_cl_waiting' command definition +define command { + command_name check_postgres_pgb_pool_cl_waiting + command_line $USER1$/check_postgres_pgb_pool_cl_waiting -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_pgb_pool_maxwait' command definition +define command { + command_name check_postgres_pgb_pool_maxwait + command_line $USER1$/check_postgres_pgb_pool_maxwait -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_pgb_pool_sv_active' command definition +define command { + command_name check_postgres_pgb_pool_sv_active + command_line $USER1$/check_postgres_pgb_pool_sv_active -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_pgb_pool_sv_idle' command definition +define command { + command_name check_postgres_pgb_pool_sv_idle + command_line $USER1$/check_postgres_pgb_pool_sv_idle -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_pgb_pool_sv_login' command definition +define command { + command_name check_postgres_pgb_pool_sv_login + command_line $USER1$/check_postgres_pgb_pool_sv_login -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_pgb_pool_sv_tested' command definition +define command { + command_name check_postgres_pgb_pool_sv_tested + command_line $USER1$/check_postgres_pgb_pool_sv_tested -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_pgb_pool_sv_used' command definition +define command { + command_name check_postgres_pgb_pool_sv_used + command_line $USER1$/check_postgres_pgb_pool_sv_used -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_pgbouncer_checksum_warn' command definition +define command { + command_name check_postgres_pgbouncer_checksum_warn + command_line $USER1$/check_postgres_pgbouncer_checksum -H $HOSTADDRESS$ -u pgmonitor -w $ARG1$ + } + +# 'check_postgres_pgbouncer_checksum_crit' command definition +define command { + command_name check_postgres_pgbouncer_checksum_crit + command_line $USER1$/check_postgres_pgbouncer_checksum -H $HOSTADDRESS$ -u pgmonitor -c $ARG1$ + } + +# 'check_postgres_prepared_txns' command definition +define command { + command_name check_postgres_prepared_txns + command_line $USER1$/check_postgres_prepared_txns -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_query_runtime' command definition +#define command { +# command_name check_postgres_query_runtime +# command_line $USER1$/check_postgres_query_runtime -H $HOSTADDRESS$ -u pgmonitor -db $ARG1$ +# } + +# 'check_postgres_query_time' command definition +define command { + command_name check_postgres_query_time + command_line $USER1$/check_postgres_query_time -H $HOSTADDRESS$ -u pgmonitor -db $ARG1$ + } + +# 'check_postgres_relation_size' command definition +define command { + command_name check_postgres_relation_size + command_line $USER1$/check_postgres_relation_size -H $HOSTADDRESS$ -u pgmonitor -db $ARG1$ -w $ARG2$ -c $ARG3$ + } + +# 'check_postgres_replicate_row' command definition +#define command { +# command_name check_postgres_replicate_row +# command_line $USER1$/check_postgres_replicate_row -H $HOSTADDRESS$ -u pgmonitor +# } + +# 'check_postgres_same_schema' command definition +define command { + command_name check_postgres_same_schema + command_line $USER1$/check_postgres_same_schema -H $HOSTADDRESS$ -u pgmonitor -db $ARG1$ + } + +# 'check_postgres_sequence' command definition +define command { + command_name check_postgres_sequence + command_line $USER1$/check_postgres_sequence -H $HOSTADDRESS$ -u pgmonitor -db $ARG1$ + } + +# 'check_postgres_settings_checksum' command definition +define command { + command_name check_postgres_settings_checksum + command_line $USER1$/check_postgres_settings_checksum -H $HOSTADDRESS$ -u pgmonitor -db $ARG1$ -w $ARG2$ -c $ARG3$ + } + +# 'check_postgres_slony_status' command definition +define command { + command_name check_postgres_slony_status + command_line $USER1$/check_postgres_slony_status -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_table_size' command definition +define command { + command_name check_postgres_table_size + command_line $USER1$/check_postgres_table_size -H $HOSTADDRESS$ -u pgmonitor -db $ARG1$ -w $ARG2$ -c $ARG3$ + } + +# 'check_postgres_timesync' command definition +define command { + command_name check_postgres_timesync + command_line $USER1$/check_postgres_timesync -H $HOSTADDRESS$ -u pgmonitor + } + +# 'check_postgres_txn_idle' command definition +define command { + command_name check_postgres_txn_idle + command_line $USER1$/check_postgres_txn_idle -H $HOSTADDRESS$ -u pgmonitor -w $ARG1$ -c $ARG2$ + } + +# 'check_postgres_txn_time' command definition +define command { + command_name check_postgres_txn_time + command_line $USER1$/check_postgres_txn_time -H $HOSTADDRESS$ -u pgmonitor -db $ARG1$ -w $ARG2$ -c $ARG3$ + } + +# 'check_postgres_txn_wraparound' command definition +define command { + command_name check_postgres_txn_wraparound + command_line $USER1$/check_postgres_txn_wraparound -H $HOSTADDRESS$ -u pgmonitor -w $ARG1$ -c $ARG2$ + } + +# 'check_postgres_version' command definition +define command { + command_name check_postgres_version + command_line $USER1$/check_postgres_version -H $HOSTADDRESS$ -u pgmonitor -w $ARG1$ -c $ARG2$ + } + +# 'check_postgres_wal_files' command definition +# +# command requires superuser privileges +#define command { +# command_name check_postgres_wal_files +# command_line $USER1$/check_postgres_wal_files -H $HOSTADDRESS$ -u pgmonitor +# } + +# uncomment for check_mk legacy checks +#"""