aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/nsca-ng
diff options
context:
space:
mode:
authorMathieu Arnold <mat@FreeBSD.org>2015-04-23 15:37:59 +0000
committerMathieu Arnold <mat@FreeBSD.org>2015-04-23 15:37:59 +0000
commit08b27497b314bd9703d8058fb546cc342a1e329b (patch)
tree58c2469bc94d813658532616dbcf5da389c34c95 /net-mgmt/nsca-ng
parent4272c9ea599921232e696a18d7922a73cb135593 (diff)
downloadports-08b27497b314bd9703d8058fb546cc342a1e329b.tar.gz
ports-08b27497b314bd9703d8058fb546cc342a1e329b.zip
Add net-mgmt/nsca-ng and net-mgmt/nsca-ng-client, client-server pair which
makes the Nagios command file accessible to remote systems. PR: 188938 Submitted by root peng spline inf fu-berlin de Sponsored by: Absolight
Notes
Notes: svn path=/head/; revision=384593
Diffstat (limited to 'net-mgmt/nsca-ng')
-rw-r--r--net-mgmt/nsca-ng/Makefile56
-rw-r--r--net-mgmt/nsca-ng/distinfo2
-rw-r--r--net-mgmt/nsca-ng/files/nsca-ng.in36
-rw-r--r--net-mgmt/nsca-ng/files/patch-src_server_nsca-ng.c16
-rw-r--r--net-mgmt/nsca-ng/pkg-descr19
-rw-r--r--net-mgmt/nsca-ng/pkg-plist4
6 files changed, 133 insertions, 0 deletions
diff --git a/net-mgmt/nsca-ng/Makefile b/net-mgmt/nsca-ng/Makefile
new file mode 100644
index 000000000000..5f97b227085e
--- /dev/null
+++ b/net-mgmt/nsca-ng/Makefile
@@ -0,0 +1,56 @@
+# Created by: Alexander Sulfrian <alexander@sulfrian.net>
+# $FreeBSD$
+
+PORTNAME= nsca-ng
+PORTVERSION= 1.2
+CATEGORIES= net-mgmt
+MASTER_SITES= https://www.nsca-ng.org/download/ http://www.nsca-ng.org/download/
+
+MAINTAINER= alexander@sulfrian.net
+COMMENT= Nagios Service Check Acceptor
+
+LICENSE= BSD2CLAUSE
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+LIB_DEPENDS= libev.so:${PORTSDIR}/devel/libev
+
+.if !defined(PKGNAMESUFFIX)
+LIB_DEPENDS+= libconfuse.so:${PORTSDIR}/devel/libconfuse
+.endif
+
+CONFLICTS?= nsca-2.* nsca27-2.*
+
+GNU_CONFIGURE= yes
+CONFIGURE_ARGS= --localstatedir=/var/spool/nagios
+USE_OPENSSL= yes
+
+.if !defined(PKGNAMESUFFIX)
+USE_RC_SUBR= nsca-ng
+CONFIGURE_ARGS+= --enable-server
+.endif
+
+PORTDOCS= NEWS COPYING README PROTOCOL TODO
+
+post-install:
+.if defined(PKGNAMESUFFIX)
+ ${INSTALL_DATA} -d ${STAGEDIR}${PREFIX}/libexec/nagios/
+ ${LN} -s ${PREFIX}/sbin/send_nsca ${STAGEDIR}${PREFIX}/libexec/nagios/send_nsca
+
+ ${INSTALL_DATA} -d ${STAGEDIR}${EXAMPLESDIR}
+ cd ${WRKSRC}/contrib && ${INSTALL_DATA} ${PORTEXAMPLES} \
+ ${STAGEDIR}${EXAMPLESDIR}
+
+ cd ${STAGEDIR}${PREFIX}/etc && ${MV} send_nsca.cfg send_nsca.cfg.sample
+ # remove files not used here
+ cd ${STAGEDIR}${PREFIX} && ${RM} man/man8/nsca-ng.8 man/man5/nsca-ng.cfg.5
+.else
+ cd ${STAGEDIR}${PREFIX}/etc && ${MV} nsca-ng.cfg nsca-ng.cfg.sample
+ # remove files not used here
+ cd ${STAGEDIR}${PREFIX} && ${RM} etc/send_nsca.cfg man/man5/send_nsca.cfg.5 \
+ man/man8/send_nsca.8 sbin/send_nsca
+.endif
+
+ @${MKDIR} ${STAGEDIR}${DOCSDIR}
+ cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
+
+.include <bsd.port.mk>
diff --git a/net-mgmt/nsca-ng/distinfo b/net-mgmt/nsca-ng/distinfo
new file mode 100644
index 000000000000..8b2a0ab065b7
--- /dev/null
+++ b/net-mgmt/nsca-ng/distinfo
@@ -0,0 +1,2 @@
+SHA256 (nsca-ng-1.2.tar.gz) = fd0edf7a3c4da46aff5321bf005c68853dad5bae0b889e5e42336e85cb7a24e7
+SIZE (nsca-ng-1.2.tar.gz) = 327702
diff --git a/net-mgmt/nsca-ng/files/nsca-ng.in b/net-mgmt/nsca-ng/files/nsca-ng.in
new file mode 100644
index 000000000000..03d58c13ffb4
--- /dev/null
+++ b/net-mgmt/nsca-ng/files/nsca-ng.in
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: nsca-ng
+# REQUIRE: nagios icinga
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable nsca-ng:
+# nsca_ng_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable nsca-ng.
+# nsca_ng_flags (str): Empty by default.
+# nsca_ng_configfile (str): Set to "%%PREFIX%%/etc/nsca-ng.cfg" by default.
+#
+
+. /etc/rc.subr
+
+name=nsca_ng
+desc="Nagios Service Check Acceptor"
+rcvar=nsca_ng_enable
+
+load_rc_config "${name}"
+
+command="%%PREFIX%%/sbin/nsca-ng"
+pidfile="/var/run/${name}.pid"
+extra_commands=reload
+
+nsca_ng_enable=${nsca_ng_enable:-"NO"}
+nsca_ng_configfile=${nsca_ng_configfile:-"%%PREFIX%%/etc/nsca-ng.cfg"}
+
+required_files="${nsca_ng_configfile}"
+command_args="-c ${nsca_ng_configfile} -P ${pidfile}"
+
+run_rc_command "$1"
diff --git a/net-mgmt/nsca-ng/files/patch-src_server_nsca-ng.c b/net-mgmt/nsca-ng/files/patch-src_server_nsca-ng.c
new file mode 100644
index 000000000000..05ca65a7866a
--- /dev/null
+++ b/net-mgmt/nsca-ng/files/patch-src_server_nsca-ng.c
@@ -0,0 +1,16 @@
+--- src/server/nsca-ng.c.orig 2013-11-06 21:44:18 UTC
++++ src/server/nsca-ng.c
+@@ -300,11 +300,9 @@ close_descriptors(void)
+ int min_fd = STDERR_FILENO + 1;
+
+ #if HAVE_CLOSEFROM /* BSD and Solaris. */
+- if (closefrom(min_fd) == -1)
+- die("Cannot close file descriptors >= %d: %m", min_fd);
++ (void)closefrom(min_fd);
+ #elif defined(F_CLOSEM) /* AIX and IRIX. */
+- if (fcntl(min_fd, F_CLOSEM, 0) == -1)
+- die("Cannot close file descriptors >= %d: %m", min_fd);
++ (void)fcntl(min_fd, F_CLOSEM, 0);
+ #else
+ int max_fd = MIN(sysconf(_SC_OPEN_MAX), /* Arbitrary limit: */ 1048576);
+ int fd;
diff --git a/net-mgmt/nsca-ng/pkg-descr b/net-mgmt/nsca-ng/pkg-descr
new file mode 100644
index 000000000000..686c98a894aa
--- /dev/null
+++ b/net-mgmt/nsca-ng/pkg-descr
@@ -0,0 +1,19 @@
+NSCA-ng provides a client-server pair which makes the Nagios command file
+accessible to remote systems. This allows for submitting passive check
+results, downtimes, and many other commands to Nagios or compatible
+monitoring solutions. The submitted data is queued by the NSCA-ng
+server if Nagios goes down. Multiple check results or commands can be
+submitted in one go, and multiline plugin output is fully supported.
+NSCA-ng uses TLS encryption and shared-secret authentication with
+per-client passwords, as well as fine-grained authorization control.
+
+This package contains the NSCA-ng server, which is written in C and
+uses an event-driven architecture. Disk I/O is avoided unless the data
+cannot be submitted in one go due to its size (on Linux, the threshold
+is 4kB). In this case, the data is handed over to Nagios via
+asynchronously written files.
+
+NSCA clients cannot talk to NSCA-ng servers (nor vice versa), but NSCA
+and NSCA-ng servers can happily run side by side.
+
+WWW: http://www.nsca-ng.org/
diff --git a/net-mgmt/nsca-ng/pkg-plist b/net-mgmt/nsca-ng/pkg-plist
new file mode 100644
index 000000000000..c5cf50595619
--- /dev/null
+++ b/net-mgmt/nsca-ng/pkg-plist
@@ -0,0 +1,4 @@
+@sample etc/nsca-ng.cfg.sample
+man/man5/nsca-ng.cfg.5.gz
+man/man8/nsca-ng.8.gz
+sbin/nsca-ng