From 7111199bb3eb9cfbbbb730785d53aaa8540d8f10 Mon Sep 17 00:00:00 2001 From: Matthew Seaman Date: Sun, 23 Feb 2014 22:13:34 +0000 Subject: check_postgres.pl - a Postgres monitoring script for Nagios, MRTG, Cacti, and others check_postgres.pl is a Perl script that runs many different tests against one or more Postgres databases. It uses the psql program to gather the information, and outputs the results in one of three formats: Nagios, MRTG, or simple. WWW: http://bucardo.org/wiki/Check_postgres Submitted by: Matthew Seaman --- net-mgmt/nagios-check_postgres/Makefile | 114 +++++++++++++++++++++++++++++++ net-mgmt/nagios-check_postgres/distinfo | 2 + net-mgmt/nagios-check_postgres/pkg-descr | 9 +++ net-mgmt/nagios-check_postgres/pkg-plist | 64 +++++++++++++++++ 4 files changed, 189 insertions(+) create mode 100644 net-mgmt/nagios-check_postgres/Makefile create mode 100644 net-mgmt/nagios-check_postgres/distinfo create mode 100644 net-mgmt/nagios-check_postgres/pkg-descr create mode 100644 net-mgmt/nagios-check_postgres/pkg-plist (limited to 'net-mgmt/nagios-check_postgres') diff --git a/net-mgmt/nagios-check_postgres/Makefile b/net-mgmt/nagios-check_postgres/Makefile new file mode 100644 index 000000000000..c05221216ed4 --- /dev/null +++ b/net-mgmt/nagios-check_postgres/Makefile @@ -0,0 +1,114 @@ +# Created by: Matthew Seaman +# $FreeBSD$ + +PORTNAME= check_postgres +PORTVERSION= 2.21.0 +CATEGORIES= net-mgmt databases perl5 +MASTER_SITES= http://bucardo.org/downloads/ +PKGNAMEPREFIX= nagios- + +MAINTAINER= matthew@FreeBSD.org +COMMENT= Monitor various attributes of your PostgreSQL database + +LICENSE= BSD2CLAUSE + +NO_ARCH= yes + +USES= perl5 +USE_PERL5= configure +USE_PGSQL= yes + +# This script is primarily used for monitoring via Nagios, but it also +# has output styles compatible with cacti or mrtg. The options +# control whether symlinks get made to locations where those +# applications expect to find their plugin scripts. + +OPTIONS_DEFINE= NAGIOS CACTI +OPTIONS_DEFAULT= NAGIOS +OPTIONS_SUB= yes + +NAGIOS_DESC= Create symlinks in Nagios plugins dir +NAGIOS_PLUGINS= ${PREFIX}/libexec/nagios +NAGIOS_LINKS= archive_ready \ + autovac_freeze \ + backends \ + bloat \ + checkpoint \ + cluster_id \ + commitratio \ + connection \ + custom_query \ + database_size \ + disabled_triggers \ + disk_space \ + fsm_pages \ + fsm_relations \ + hitratio \ + hot_standby_delay \ + index_size \ + last_analyze \ + last_autoanalyze \ + last_autovacuum \ + last_vacuum \ + listener \ + locks \ + logfile \ + new_version_bc \ + new_version_box \ + new_version_cp \ + new_version_pg \ + new_version_tnm \ + pgagent_jobs \ + pgb_pool_cl_active \ + pgb_pool_cl_waiting \ + pgb_pool_maxwait \ + pgb_pool_sv_active \ + pgb_pool_sv_idle \ + pgb_pool_sv_login \ + pgb_pool_sv_tested \ + pgb_pool_sv_used \ + pgbouncer_backends \ + pgbouncer_checksum \ + prepared_txns \ + query_runtime \ + query_time \ + relation_size \ + replicate_row \ + same_schema \ + sequence \ + settings_checksum \ + slony_status \ + table_size \ + timesync \ + txn_idle \ + txn_time \ + txn_wraparound \ + version \ + wal_files + +CACTI_DESC= Create symlinks in Cacti scripts dir +CACTI_SCRIPTS= ${PREFIX}/share/cacti/scripts +CACTI_LINKS= dbstats + +.include + +post-install: +.if ${PORT_OPTIONS:MNAGIOS} + @${MKDIR} ${STAGEDIR}${NAGIOS_PLUGINS} +.for l in ${NAGIOS_LINKS} + ${LN} -s ../../bin/check_postgres.pl \ + ${STAGEDIR}${NAGIOS_PLUGINS}/check_postgres_${l} +.endfor +.endif +.if ${PORT_OPTIONS:MCACTI} + @${MKDIR} ${STAGEDIR}${CACTI_SCRIPTS} +.for l in ${CACTI_LINKS} + ${LN} -s ../../../bin/check_postgres.pl \ + ${STAGEDIR}/${CACTI_SCRIPTS}/check_postgresql_${l} +.endfor +.endif + +regression-test: build + @cd ${WRKSRC} && ${MAKE} test + +.include diff --git a/net-mgmt/nagios-check_postgres/distinfo b/net-mgmt/nagios-check_postgres/distinfo new file mode 100644 index 000000000000..946003c13c60 --- /dev/null +++ b/net-mgmt/nagios-check_postgres/distinfo @@ -0,0 +1,2 @@ +SHA256 (check_postgres-2.21.0.tar.gz) = e0fdfe9c0d8188b6bb52896c87257a35311f5aea0f0e2ce332961be034314298 +SIZE (check_postgres-2.21.0.tar.gz) = 178511 diff --git a/net-mgmt/nagios-check_postgres/pkg-descr b/net-mgmt/nagios-check_postgres/pkg-descr new file mode 100644 index 000000000000..9dcfa2240699 --- /dev/null +++ b/net-mgmt/nagios-check_postgres/pkg-descr @@ -0,0 +1,9 @@ +check_postgres.pl - a Postgres monitoring script for Nagios, MRTG, +Cacti, and others + +check_postgres.pl is a Perl script that runs many different tests +against one or more Postgres databases. It uses the psql program to +gather the information, and outputs the results in one of three +formats: Nagios, MRTG, or simple. + +WWW: http://bucardo.org/wiki/Check_postgres diff --git a/net-mgmt/nagios-check_postgres/pkg-plist b/net-mgmt/nagios-check_postgres/pkg-plist new file mode 100644 index 000000000000..0a9716046cbd --- /dev/null +++ b/net-mgmt/nagios-check_postgres/pkg-plist @@ -0,0 +1,64 @@ +bin/check_postgres.pl +%%SITE_PERL%%/%%PERL_ARCH%%/auto/check_postgres/.packlist +%%NAGIOS%%libexec/nagios/check_postgres_archive_ready +%%NAGIOS%%libexec/nagios/check_postgres_autovac_freeze +%%NAGIOS%%libexec/nagios/check_postgres_backends +%%NAGIOS%%libexec/nagios/check_postgres_bloat +%%NAGIOS%%libexec/nagios/check_postgres_checkpoint +%%NAGIOS%%libexec/nagios/check_postgres_cluster_id +%%NAGIOS%%libexec/nagios/check_postgres_commitratio +%%NAGIOS%%libexec/nagios/check_postgres_connection +%%NAGIOS%%libexec/nagios/check_postgres_custom_query +%%NAGIOS%%libexec/nagios/check_postgres_database_size +%%NAGIOS%%libexec/nagios/check_postgres_disabled_triggers +%%NAGIOS%%libexec/nagios/check_postgres_disk_space +%%NAGIOS%%libexec/nagios/check_postgres_fsm_pages +%%NAGIOS%%libexec/nagios/check_postgres_fsm_relations +%%NAGIOS%%libexec/nagios/check_postgres_hitratio +%%NAGIOS%%libexec/nagios/check_postgres_hot_standby_delay +%%NAGIOS%%libexec/nagios/check_postgres_index_size +%%NAGIOS%%libexec/nagios/check_postgres_last_analyze +%%NAGIOS%%libexec/nagios/check_postgres_last_autoanalyze +%%NAGIOS%%libexec/nagios/check_postgres_last_autovacuum +%%NAGIOS%%libexec/nagios/check_postgres_last_vacuum +%%NAGIOS%%libexec/nagios/check_postgres_listener +%%NAGIOS%%libexec/nagios/check_postgres_locks +%%NAGIOS%%libexec/nagios/check_postgres_logfile +%%NAGIOS%%libexec/nagios/check_postgres_new_version_bc +%%NAGIOS%%libexec/nagios/check_postgres_new_version_box +%%NAGIOS%%libexec/nagios/check_postgres_new_version_cp +%%NAGIOS%%libexec/nagios/check_postgres_new_version_pg +%%NAGIOS%%libexec/nagios/check_postgres_new_version_tnm +%%NAGIOS%%libexec/nagios/check_postgres_pgagent_jobs +%%NAGIOS%%libexec/nagios/check_postgres_pgb_pool_cl_active +%%NAGIOS%%libexec/nagios/check_postgres_pgb_pool_cl_waiting +%%NAGIOS%%libexec/nagios/check_postgres_pgb_pool_maxwait +%%NAGIOS%%libexec/nagios/check_postgres_pgb_pool_sv_active +%%NAGIOS%%libexec/nagios/check_postgres_pgb_pool_sv_idle +%%NAGIOS%%libexec/nagios/check_postgres_pgb_pool_sv_login +%%NAGIOS%%libexec/nagios/check_postgres_pgb_pool_sv_tested +%%NAGIOS%%libexec/nagios/check_postgres_pgb_pool_sv_used +%%NAGIOS%%libexec/nagios/check_postgres_pgbouncer_backends +%%NAGIOS%%libexec/nagios/check_postgres_pgbouncer_checksum +%%NAGIOS%%libexec/nagios/check_postgres_prepared_txns +%%NAGIOS%%libexec/nagios/check_postgres_query_runtime +%%NAGIOS%%libexec/nagios/check_postgres_query_time +%%NAGIOS%%libexec/nagios/check_postgres_relation_size +%%NAGIOS%%libexec/nagios/check_postgres_replicate_row +%%NAGIOS%%libexec/nagios/check_postgres_same_schema +%%NAGIOS%%libexec/nagios/check_postgres_sequence +%%NAGIOS%%libexec/nagios/check_postgres_settings_checksum +%%NAGIOS%%libexec/nagios/check_postgres_slony_status +%%NAGIOS%%libexec/nagios/check_postgres_table_size +%%NAGIOS%%libexec/nagios/check_postgres_timesync +%%NAGIOS%%libexec/nagios/check_postgres_txn_idle +%%NAGIOS%%libexec/nagios/check_postgres_txn_time +%%NAGIOS%%libexec/nagios/check_postgres_txn_wraparound +%%NAGIOS%%libexec/nagios/check_postgres_version +%%NAGIOS%%libexec/nagios/check_postgres_wal_files +man/man1/check_postgres.1p.gz +%%CACTI%%share/cacti/scripts/check_postgresql_dbstats +%%CACTI%%@dirrmtry share/cacti/scripts +%%CACTI%%@dirrmtry share/cacti +%%NAGIOS%%@dirrmtry libexec/nagios +@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/check_postgres -- cgit v1.2.3