From owner-svn-ports-all@FreeBSD.ORG Thu Apr 23 15:38:02 2015 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 583B9AF9; Thu, 23 Apr 2015 15:38:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 382E31E01; Thu, 23 Apr 2015 15:38:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3NFc2u0033016; Thu, 23 Apr 2015 15:38:02 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3NFbxsG032991; Thu, 23 Apr 2015 15:37:59 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201504231537.t3NFbxsG032991@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mat set sender to mat@FreeBSD.org using -f From: Mathieu Arnold Date: Thu, 23 Apr 2015 15:37:59 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r384593 - in head/net-mgmt: . nsca-ng nsca-ng-client nsca-ng/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Apr 2015 15:38:02 -0000 Author: mat Date: Thu Apr 23 15:37:59 2015 New Revision: 384593 URL: https://svnweb.freebsd.org/changeset/ports/384593 Log: 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 Added: head/net-mgmt/nsca-ng/ head/net-mgmt/nsca-ng-client/ head/net-mgmt/nsca-ng-client/Makefile (contents, props changed) head/net-mgmt/nsca-ng-client/pkg-plist (contents, props changed) head/net-mgmt/nsca-ng/Makefile (contents, props changed) head/net-mgmt/nsca-ng/distinfo (contents, props changed) head/net-mgmt/nsca-ng/files/ head/net-mgmt/nsca-ng/files/nsca-ng.in (contents, props changed) head/net-mgmt/nsca-ng/files/patch-src_server_nsca-ng.c (contents, props changed) head/net-mgmt/nsca-ng/pkg-descr (contents, props changed) head/net-mgmt/nsca-ng/pkg-plist (contents, props changed) Modified: head/net-mgmt/Makefile Modified: head/net-mgmt/Makefile ============================================================================== --- head/net-mgmt/Makefile Thu Apr 23 15:27:14 2015 (r384592) +++ head/net-mgmt/Makefile Thu Apr 23 15:37:59 2015 (r384593) @@ -173,6 +173,8 @@ SUBDIR += nrpe-ssl SUBDIR += nsca SUBDIR += nsca-client + SUBDIR += nsca-ng + SUBDIR += nsca-ng-client SUBDIR += nsca27 SUBDIR += nsca27-client SUBDIR += nstreams Added: head/net-mgmt/nsca-ng-client/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/nsca-ng-client/Makefile Thu Apr 23 15:37:59 2015 (r384593) @@ -0,0 +1,15 @@ +# Created by: Alexander Sulfrian +# $FreeBSD$ + +PKGNAMESUFFIX= -client + +CONFLICTS= nsca-client-2.* nsca27-client-2.* +PLIST= ${.CURDIR}/pkg-plist + +DOCSDIR= ${PREFIX}/share/doc/${PORTNAME}${PKGNAMESUFFIX} +PORTEXAMPLES= README acknowledge debug_server disable_notifications \ + downtime enable_notifications invoke_check + +MASTERDIR= ${.CURDIR}/../nsca-ng + +.include "${MASTERDIR}/Makefile" Added: head/net-mgmt/nsca-ng-client/pkg-plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/nsca-ng-client/pkg-plist Thu Apr 23 15:37:59 2015 (r384593) @@ -0,0 +1,5 @@ +@sample etc/send_nsca.cfg.sample +libexec/nagios/send_nsca +man/man5/send_nsca.cfg.5.gz +man/man8/send_nsca.8.gz +sbin/send_nsca Added: head/net-mgmt/nsca-ng/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/nsca-ng/Makefile Thu Apr 23 15:37:59 2015 (r384593) @@ -0,0 +1,56 @@ +# Created by: Alexander Sulfrian +# $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 Added: head/net-mgmt/nsca-ng/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/nsca-ng/distinfo Thu Apr 23 15:37:59 2015 (r384593) @@ -0,0 +1,2 @@ +SHA256 (nsca-ng-1.2.tar.gz) = fd0edf7a3c4da46aff5321bf005c68853dad5bae0b889e5e42336e85cb7a24e7 +SIZE (nsca-ng-1.2.tar.gz) = 327702 Added: head/net-mgmt/nsca-ng/files/nsca-ng.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/nsca-ng/files/nsca-ng.in Thu Apr 23 15:37:59 2015 (r384593) @@ -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" Added: head/net-mgmt/nsca-ng/files/patch-src_server_nsca-ng.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/nsca-ng/files/patch-src_server_nsca-ng.c Thu Apr 23 15:37:59 2015 (r384593) @@ -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; Added: head/net-mgmt/nsca-ng/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/nsca-ng/pkg-descr Thu Apr 23 15:37:59 2015 (r384593) @@ -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/ Added: head/net-mgmt/nsca-ng/pkg-plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/nsca-ng/pkg-plist Thu Apr 23 15:37:59 2015 (r384593) @@ -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