Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Apr 2014 04:40:21 +0200
From:      "Peng-root" <root@peng.spline.inf.fu-berlin.de>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/188938: New port: net-mgmt/nsca-ng Monitoring command acceptor
Message-ID:  <201404240250.s3O2o1s3016260@freefall.freebsd.org>
Resent-Message-ID: <201404240250.s3O2o1s3016260@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         188938
>Category:       ports
>Synopsis:       New port: net-mgmt/nsca-ng Monitoring command acceptor
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 24 02:50:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Alexander Sulfrian
>Release:        FreeBSD 10.0-RELEASE-p1 amd64
>Organization:
>Environment:
System: FreeBSD peng.spline.inf.fu-berlin.de 10.0-RELEASE-p1 FreeBSD 10.0-RELEASE-p1 #0: Tue Apr 8 06:45:06 UTC 2014 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64

>Description:

This is a port for NSCA-ng. 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.

NSCA-ng is comand line compatible with NSCA, but NSCA clients could not
talk to NSCA-ng servers (nor vice versa). NSCA-ng has varios advantages
over NSCA. It provides for example TLS encryption and shared-secret
authentication with per-client password.

The nsca-ng port contains the server part of NSCA-ng and the nsca-ng-client
port contians the send_nsca client and various example scripts.

>How-To-Repeat:

>Fix:

--- nsca-ng.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	nsca-ng
#	nsca-ng/files
#	nsca-ng/files/patch-src_server_nsca-ng_c.patch
#	nsca-ng/files/nsca-ng.in
#	nsca-ng/Makefile
#	nsca-ng/distinfo
#	nsca-ng/pkg-plist
#	nsca-ng/pkg-descr
#	nsca-ng-client/
#	nsca-ng-client/Makefile
#
echo c - nsca-ng
mkdir -p nsca-ng > /dev/null 2>&1
echo c - nsca-ng/files
mkdir -p nsca-ng/files > /dev/null 2>&1
echo x - nsca-ng/files/patch-src_server_nsca-ng_c.patch
sed 's/^X//' >nsca-ng/files/patch-src_server_nsca-ng_c.patch << '0cda49fa119c0058db46e29b9c15d25e'
XFrom 28d4dc879545e4a797c4dd14441e6f12992372ce Mon Sep 17 00:00:00 2001
XFrom: Holger Weiß <holger@weiss.in-berlin.de>
XDate: Thu, 07 Nov 2013 09:21:05 +0100
XSubject: Ignore errors when closing file descriptors
X
XDon't check the return value of closefrom(3) or fcntl(3) when closing
Xopen file descriptors on startup.  If there are no file descriptors to
Xclose, closefrom(3) will fail with EBADF on NetBSD and OpenBSD.  On
XFreeBSD and Solaris, closefrom(3) is actually declared to return void.
X
X--- src/server/nsca-ng.c.orig	Thu Nov  7 10:30:02 2013
X+++ src/server/nsca-ng.c	Thu Nov  7 10:30:21 2013
X@@ -300,11 +300,9 @@ close_descriptors(void)
X 	int min_fd = STDERR_FILENO + 1;
X 
X #if HAVE_CLOSEFROM /* BSD and Solaris. */
X-	if (closefrom(min_fd) == -1)
X-		die("Cannot close file descriptors >= %d: %m", min_fd);
X+	(void)closefrom(min_fd);
X #elif defined(F_CLOSEM) /* AIX and IRIX. */
X-	if (fcntl(min_fd, F_CLOSEM, 0) == -1)
X-		die("Cannot close file descriptors >= %d: %m", min_fd);
X+	(void)fcntl(min_fd, F_CLOSEM, 0);
X #else
X 	int max_fd = MIN(sysconf(_SC_OPEN_MAX), /* Arbitrary limit: */ 1048576);
X 	int fd;
0cda49fa119c0058db46e29b9c15d25e
echo x - nsca-ng/files/nsca-ng.in
sed 's/^X//' >nsca-ng/files/nsca-ng.in << 'bbb23baf4b08e85a9fdd932b4b643efa'
X#!/bin/sh
X
X# $FreeBSD$
X#
X# PROVIDE: nsca-ng
X# REQUIRE: nagios|icinga
X# BEFORE: LOGIN
X# KEYWORD: shutdown
X#
X# Add the following lines to /etc/rc.conf to enable nsca-ng:
X# nsca_ng_enable (bool):    Set to "NO" by default.
X#                           Set it to "YES" to enable nsca-ng.
X# nsca_ng_flags (str):      Empty by default.
X# nsca_ng_configfile (str): Set to "%%PREFIX%%/etc/nsca-ng.cfg" by default.
X#
X
X. /etc/rc.subr
X
Xname="nsca_ng"
Xrcvar=nsca_ng_enable
X
Xcommand="%%PREFIX%%/sbin/nsca-ng"
Xpidfile="/var/run/${name}.pid"
Xextra_commands=reload
X
Xnsca_ng_enable=${nsca_ng_enable:-"NO"}
Xnsca_ng_configfile=${nsca_ng_configfile:-"%%PREFIX%%/etc/nsca-ng.cfg"}
X
Xload_rc_config "${name}"
X
Xrequired_files="${nsca_ng_configfile}"
Xcommand_args="-c ${nsca_ng_configfile} -P ${pidfile}"
X
Xrun_rc_command "$1"
bbb23baf4b08e85a9fdd932b4b643efa
echo x - nsca-ng/Makefile
sed 's/^X//' >nsca-ng/Makefile << '34ffbb7e4224286dcf2735094b198b66'
X# Created by: Alexander Sulfrian <alexander@sulfrian.net>
X# $FreeBSD$
X
XPORTNAME=	nsca-ng
XPORTVERSION=	1.2
XCATEGORIES=	net-mgmt
XMASTER_SITES=	https://www.nsca-ng.org/download/ http://www.nsca-ng.org/download/
X
XMAINTAINER=	alexander@sulfrian.net
XCOMMENT=	Nagios Service Check Acceptor
X
XLICENSE=	AS-IS
XLICENSE_NAME=	AS-IS
XLICENSE_FILE=	${WRKSRC}/COPYING
XLICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
X
XLIB_DEPENDS=	libev.so:${PORTSDIR}/devel/libev
X
X.if !defined(_BUILDING_NSCA_NG_CLIENT)
XLIB_DEPENDS+=	libconfuse.so:${PORTSDIR}/devel/libconfuse
X.else
XCONFLICTS=	nsca-client-*
X.endif
X
XGNU_CONFIGURE=	yes
XCONFIGURE_ARGS=	--localstatedir=/var/spool/nagios
XDOCSDIR?=	${PREFIX}/share/doc/${PORTNAME}${PKGNAMESUFFIX}
XUSE_OPENSSL=	yes
X
X.if !defined(_BUILDING_NSCA_NG_CLIENT)
XUSE_RC_SUBR=	nsca-ng
XCONFIGURE_ARGS+=	--enable-server
XPLIST_SUB+=	SERVER=""
XPLIST_SUB+=	CLIENT="@comment "
XMAN5=nsca-ng.cfg.5
XMAN8=nsca-ng.8
X.else
XPLIST_SUB+=	SERVER="@comment "
XPLIST_SUB+=	CLIENT=""
XMAN5=send_nsca.cfg.5
XMAN8=send_nsca.8
X.endif
X
XDOCS=		NEWS COPYING README PROTOCOL TODO
X
X.include <bsd.port.options.mk>
X
Xpost-install:
X.if defined(_BUILDING_NSCA_NG_CLIENT)
X	${INSTALL_DATA} -d ${STAGEDIR}${PREFIX}/libexec/nagios/
X	${LN} -s ${PREFIX}/sbin/send_nsca ${STAGEDIR}${PREFIX}/libexec/nagios/send_nsca
X
X	${INSTALL_DATA} -d ${STAGEDIR}${PREFIX}/share/examples/nsca-ng/
X	cd ${WRKSRC}/contrib; ${INSTALL_DATA} README acknowledge debug_server \
X		disable_notifications downtime enable_notifications invoke_check \
X		${STAGEDIR}${PREFIX}/share/examples/nsca-ng/
X
X	cd ${STAGEDIR}${PREFIX}/etc; ${MV} send_nsca.cfg send_nsca.cfg.sample
X.else
X	cd ${STAGEDIR}${PREFIX}/etc; ${MV} nsca-ng.cfg nsca-ng.cfg.sample
X.endif
X
X.if ${PORT_OPTIONS:MDOCS}
X	@${MKDIR} ${STAGEDIR}${DOCSDIR}
X	cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${STAGEDIR}${DOCSDIR}
X.endif
X
X.include <bsd.port.mk>
34ffbb7e4224286dcf2735094b198b66
echo x - nsca-ng/distinfo
sed 's/^X//' >nsca-ng/distinfo << 'db39ed01ff377ba9b73a474c1450cf38'
XSHA256 (nsca-ng-1.2.tar.gz) = fd0edf7a3c4da46aff5321bf005c68853dad5bae0b889e5e42336e85cb7a24e7
XSIZE (nsca-ng-1.2.tar.gz) = 327702
db39ed01ff377ba9b73a474c1450cf38
echo x - nsca-ng/pkg-plist
sed 's/^X//' >nsca-ng/pkg-plist << 'ac4e71cfc79dadb2b274b4ca3feed8f6'
X%%PORTDOCS%%%%DOCSDIR%%/NEWS
X%%PORTDOCS%%%%DOCSDIR%%/COPYING
X%%PORTDOCS%%%%DOCSDIR%%/README
X%%PORTDOCS%%%%DOCSDIR%%/PROTOCOL
X%%PORTDOCS%%%%DOCSDIR%%/TODO
X%%PORTDOCS%%@dirrm %%DOCSDIR%%
X%%SERVER%%sbin/nsca-ng
X%%CLIENT%%share/examples/nsca-ng/README
X%%CLIENT%%share/examples/nsca-ng/acknowledge
X%%CLIENT%%share/examples/nsca-ng/debug_server
X%%CLIENT%%share/examples/nsca-ng/disable_notifications
X%%CLIENT%%share/examples/nsca-ng/downtime
X%%CLIENT%%share/examples/nsca-ng/enable_notifications
X%%CLIENT%%share/examples/nsca-ng/invoke_check
X%%CLIENT%%@dirrm share/examples/nsca-ng
X%%CLIENT%%libexec/nagios/send_nsca
X%%CLIENT%%@dirrmtry libexec/nagios
X%%CLIENT%%sbin/send_nsca
X
X@owner root
X@group wheel
X@mode 750
X%%SERVER%%@sample etc/nsca-ng.cfg.sample
X%%CLIENT%%@sample etc/send_nsca.cfg.sample
ac4e71cfc79dadb2b274b4ca3feed8f6
echo x - nsca-ng/pkg-descr
sed 's/^X//' >nsca-ng/pkg-descr << 'cb7b6a477c2356e3f864a3dec8192630'
XNSCA-ng provides a client-server pair which makes the Nagios command file
Xaccessible to remote systems. This allows for submitting passive check
Xresults, downtimes, and many other commands to Nagios or compatible
Xmonitoring solutions. The submitted data is queued by the NSCA-ng
Xserver if Nagios goes down. Multiple check results or commands can be
Xsubmitted in one go, and multiline plugin output is fully supported.
XNSCA-ng uses TLS encryption and shared-secret authentication with
Xper-client passwords, as well as fine-grained authorization control.
X
XThis package contains the NSCA-ng server, which is written in C and
Xuses an event-driven architecture. Disk I/O is avoided unless the data
Xcannot be submitted in one go due to its size (on Linux, the threshold
Xis 4kB). In this case, the data is handed over to Nagios via
Xasynchronously written files.
X
XNSCA clients cannot talk to NSCA-ng servers (nor vice versa), but NSCA
Xand NSCA-ng servers can happily run side by side.
X
XWWW: http://www.nsca-ng.org/
cb7b6a477c2356e3f864a3dec8192630
echo c - nsca-ng-client/
mkdir -p nsca-ng-client/ > /dev/null 2>&1
echo x - nsca-ng-client/Makefile
sed 's/^X//' >nsca-ng-client/Makefile << 'e9e9cdd73d8358a45f553776df0c8b72'
X# Created by: Alexander Sulfrian <alexander@sulfrian.net>
X# $FreeBSD$
X
XPKGNAMESUFFIX=	-client
X
XMAINTAINER=	alexander@sulfrian.net
X
XLICENSE=	AS-IS
XLICENSE_NAME=	AS-IS
XLICENSE_FILE=	${WRKSRC}/COPYING
XLICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
X
X_BUILDING_NSCA_NG_CLIENT=	yes
XMASTERDIR=	${.CURDIR}/../nsca-ng
X
X.include "${MASTERDIR}/Makefile"
e9e9cdd73d8358a45f553776df0c8b72
exit
--- nsca-ng.shar ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201404240250.s3O2o1s3016260>