From 3f169ae7364f274caa854a451157a3d290876478 Mon Sep 17 00:00:00 2001 From: manu Date: Sun, 10 Feb 2013 05:57:41 +0000 Subject: [PATCH] Add openvpn-nagios, an OpenVPN certificate monitoring plugin to be used in nagios --- net/openvpn-nagios/DESCR | 1 + net/openvpn-nagios/MESSAGE | 18 +++++++++++++++++ net/openvpn-nagios/Makefile | 30 +++++++++++++++++++++++++++++ net/openvpn-nagios/PLIST | 2 ++ net/openvpn-nagios/distinfo | 9 +++++++++ net/openvpn-nagios/patches/patch-aa | 28 +++++++++++++++++++++++++++ 6 files changed, 88 insertions(+) create mode 100644 net/openvpn-nagios/DESCR create mode 100644 net/openvpn-nagios/MESSAGE create mode 100644 net/openvpn-nagios/Makefile create mode 100644 net/openvpn-nagios/PLIST create mode 100644 net/openvpn-nagios/distinfo create mode 100644 net/openvpn-nagios/patches/patch-aa diff --git a/net/openvpn-nagios/DESCR b/net/openvpn-nagios/DESCR new file mode 100644 index 000000000000..d89b83c013f4 --- /dev/null +++ b/net/openvpn-nagios/DESCR @@ -0,0 +1 @@ +This OpenVPN plugin check certificate expiration for Nagios diff --git a/net/openvpn-nagios/MESSAGE b/net/openvpn-nagios/MESSAGE new file mode 100644 index 000000000000..b7824e8ae52c --- /dev/null +++ b/net/openvpn-nagios/MESSAGE @@ -0,0 +1,18 @@ +=========================================================================== +$NetBSD: MESSAGE,v 1.1 2013/02/10 05:57:41 manu Exp $ + +In order to enable the use of this module, add this directive to a, +OpenVPN client configuration file + + plugin ${OPENVPN_PLUGINSDIR}/openvpn-nagios.so + +It can also be configured this way: + + plugin ${OPENVPN_PLUGINSDIR}/openvpn-nagios.so -t 20 -d 2 -w 5 -c 3 + + -t timeut (default 20 s) + -d how many certificates expected in the chain (default 2) + -w days to expiration that trigger a warning (default 3 days) + -c days to expiration that trigger a critical (default 5 days) + +=========================================================================== diff --git a/net/openvpn-nagios/Makefile b/net/openvpn-nagios/Makefile new file mode 100644 index 000000000000..1c7948666555 --- /dev/null +++ b/net/openvpn-nagios/Makefile @@ -0,0 +1,30 @@ +# $NetBSD: Makefile,v 1.1 2013/02/10 05:57:41 manu Exp $ +# + +.include "../../net/openvpn/Makefile.common" + +DISTNAME= openvpn-nagios-20130210 +DISTFILES= ${DISTNAME}${EXTRACT_SUFX} ${OPENVPN_DISTFILE} +CATEGORIES= net +MASTER_SITES= http://ftp.espci.fr/pub/openvpn-nagios/ +EXTRACT_SUFX= .tgz + +MAINTAINER= manu@NetBSD.org +HOMEPAGE= http://ftp.espci.fr/pub/openvpn-nagios/ +COMMENT= OpenVPN certificate checks for Nagios +LICENSE= 2-clause-bsd + +PKG_DESTDIR_SUPPORT= user-destdir + +USE_LIBTOOL= yes +USE_TOOLS+= install + +MAKE_ENV+= OPENVPN_PLUGINSDIR=${PREFIX:Q}/${OPENVPN_PLUGINSDIR:Q} +MAKE_ENV+= OPENVPN_DISTNAME=${OPENVPN_DISTNAME:Q} + +PLIST_SUBST+= OPENVPN_PLUGINSDIR=${OPENVPN_PLUGINSDIR:Q} +MESSAGE_SUBST+= OPENVPN_PLUGINSDIR=${PREFIX:Q}/${OPENVPN_PLUGINSDIR:Q} + +DEPENDS+= openvpn>=2.3.0:../../net/openvpn + +.include "../../mk/bsd.pkg.mk" diff --git a/net/openvpn-nagios/PLIST b/net/openvpn-nagios/PLIST new file mode 100644 index 000000000000..4584ce6f8c62 --- /dev/null +++ b/net/openvpn-nagios/PLIST @@ -0,0 +1,2 @@ +@comment $NetBSD: PLIST,v 1.1 2013/02/10 05:57:41 manu Exp $ +${OPENVPN_PLUGINSDIR}/openvpn-nagios.la diff --git a/net/openvpn-nagios/distinfo b/net/openvpn-nagios/distinfo new file mode 100644 index 000000000000..47a61d08d35d --- /dev/null +++ b/net/openvpn-nagios/distinfo @@ -0,0 +1,9 @@ +$NetBSD: distinfo,v 1.1 2013/02/10 05:57:41 manu Exp $ + +SHA1 (openvpn-2.3.0.tar.gz) = 18b51f7ba0b9e18939451d7787c00e04165efe90 +RMD160 (openvpn-2.3.0.tar.gz) = f24ac128fcd874bf40e8ffd5161065e84170d69f +Size (openvpn-2.3.0.tar.gz) = 1130659 bytes +SHA1 (openvpn-nagios-20130210.tgz) = 8a0fd4e3eba27584aa53c5589c13d4b38af43ba2 +RMD160 (openvpn-nagios-20130210.tgz) = 2a47893ec2db2c280adc7b9fbbea97794ec1a6f4 +Size (openvpn-nagios-20130210.tgz) = 3034 bytes +SHA1 (patch-aa) = 272401960c17de892dc7783a4133b80dec5e909e diff --git a/net/openvpn-nagios/patches/patch-aa b/net/openvpn-nagios/patches/patch-aa new file mode 100644 index 000000000000..e130deeb1786 --- /dev/null +++ b/net/openvpn-nagios/patches/patch-aa @@ -0,0 +1,28 @@ +$NetBSD: patch-aa,v 1.1 2013/02/10 05:57:42 manu Exp $ + +--- Makefile.orig 2013-02-09 06:44:43.000000000 +0100 ++++ Makefile 2013-02-09 18:41:18.000000000 +0100 +@@ -1,9 +1,9 @@ +-prefix=/usr/pkg +-PLUGINDIR=$(prefix)/lib/openvpn +-bindir=/usr/local/bin ++#prefix=/usr/pkg ++PLUGINDIR=${DESTDIR}${OPENVPN_PLUGINSDIR} ++bindir=${DESTDIR}${PREFIX}/bin + +-OPENVPN_SRC=../openvpn-2.3.0 ++OPENVPN_SRC=../${OPENVPN_DISTNAME} + CFLAGS= -Wall -Werror -ansi -g -I$(OPENVPN_SRC)/include -DBINDIR=\"$(bindir)\" + OPENVPN_GROUP=nobody + + LIBTOOL=libtool +@@ -19,8 +19,9 @@ + $(LIBTOOL) --mode=link --tag CC $(CC) -version-info 0:0:0 \ + -rpath $(PLUGINDIR) -module -o $@ $? -lc -lutil + + install: openvpn-nagios.la ++ $(INSTALL) -d -m 0755 $(PLUGINDIR) + $(LIBTOOL) --mode=install cp openvpn-nagios.la $(PLUGINDIR)/ + $(LIBTOOL) --mode=finish + + clean: