aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/nagios-check_postgres
diff options
context:
space:
mode:
authormatthew <matthew@FreeBSD.org>2015-04-08 19:18:19 +0800
committermatthew <matthew@FreeBSD.org>2015-04-08 19:18:19 +0800
commitbb1b17c87c2095ae6b5c4b46683a908d6a32643f (patch)
treee81e311dd732d1aa90f4700dc10700d151dfb5e3 /net-mgmt/nagios-check_postgres
parent453cb632b9db9ad737d1ca36298ae66fecab7c3d (diff)
downloadfreebsd-ports-gnome-bb1b17c87c2095ae6b5c4b46683a908d6a32643f.tar.gz
freebsd-ports-gnome-bb1b17c87c2095ae6b5c4b46683a908d6a32643f.tar.zst
freebsd-ports-gnome-bb1b17c87c2095ae6b5c4b46683a908d6a32643f.zip
I've had reports from colleagues of check_postgres not finding psql
when run via nrpe. Hardcode the directory (${LOCALBASE}/bin) expected to contain the postgres client and other binaries.
Diffstat (limited to 'net-mgmt/nagios-check_postgres')
-rw-r--r--net-mgmt/nagios-check_postgres/Makefile5
-rw-r--r--net-mgmt/nagios-check_postgres/files/patch-check__postgres.pl11
2 files changed, 15 insertions, 1 deletions
diff --git a/net-mgmt/nagios-check_postgres/Makefile b/net-mgmt/nagios-check_postgres/Makefile
index 4df47e35eebf..7315e460d2dc 100644
--- a/net-mgmt/nagios-check_postgres/Makefile
+++ b/net-mgmt/nagios-check_postgres/Makefile
@@ -3,7 +3,7 @@
PORTNAME= check_postgres
PORTVERSION= 2.21.0
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= net-mgmt databases perl5
MASTER_SITES= http://bucardo.org/downloads/
PKGNAMEPREFIX= nagios-
@@ -93,6 +93,9 @@ CACTI_LINKS= dbstats
.include <bsd.port.options.mk>
+post-patch:
+ ${SED} -i.bak -e s,%%LOCALBASE%%,${LOCALBASE}, ${WRKSRC}/check_postgres.pl
+
post-install:
.if ${PORT_OPTIONS:MNAGIOS}
@${MKDIR} ${STAGEDIR}${NAGIOS_PLUGINS}
diff --git a/net-mgmt/nagios-check_postgres/files/patch-check__postgres.pl b/net-mgmt/nagios-check_postgres/files/patch-check__postgres.pl
new file mode 100644
index 000000000000..b4c66f976785
--- /dev/null
+++ b/net-mgmt/nagios-check_postgres/files/patch-check__postgres.pl
@@ -0,0 +1,11 @@
+--- check_postgres.pl.orig 2015-04-08 10:32:58 UTC
++++ check_postgres.pl
+@@ -47,7 +47,7 @@ our $DEFAULT_OUTPUT = 'nagios';
+
+ ## If psql binaries are not in your path, it is recommended to hardcode it here,
+ ## as an alternative to the --PGBINDIR option
+-$PGBINDIR = '';
++$PGBINDIR = '%%LOCALBASE%%/bin';
+
+ ## If this is true, $opt{PSQL} and $opt{PGBINDIR} are disabled for security reasons
+ our $NO_PSQL_OPTION = 1;