From nobody@FreeBSD.org  Sat Aug 13 11:15:26 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 25215106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 13 Aug 2011 11:15:26 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 099818FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 13 Aug 2011 11:15:26 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p7DBFPoY012966
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 13 Aug 2011 11:15:25 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p7DBFPCF012960;
	Sat, 13 Aug 2011 11:15:25 GMT
	(envelope-from nobody)
Message-Id: <201108131115.p7DBFPCF012960@red.freebsd.org>
Date: Sat, 13 Aug 2011 11:15:25 GMT
From: "Holger L. A. Repp" <holgerrepp@googlemail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [NEW PORT] Nagios plugin for checking tftp servers
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         159737
>Category:       ports
>Synopsis:       [NEW PORT] Nagios plugin for checking tftp servers
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    swills
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug 13 11:20:09 UTC 2011
>Closed-Date:    Sat Aug 13 17:29:27 UTC 2011
>Last-Modified:  Sat Aug 13 17:30:11 UTC 2011
>Originator:     Holger L. A. Repp
>Release:        8.2-RELEASE
>Organization:
>Environment:
>Description:
Plugin for Nagios and/or Incinga. This plugin can check the availability of a tftp service as well it can retrieve a file and compare the size with an expected value. 
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

# 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:
#
#	nagios-check_tftp
#	nagios-check_tftp/files
#	nagios-check_tftp/files/patch-check_tftp
#	nagios-check_tftp/pkg-descr
#	nagios-check_tftp/Makefile
#	nagios-check_tftp/distinfo
#
echo c - nagios-check_tftp
mkdir -p nagios-check_tftp > /dev/null 2>&1
echo c - nagios-check_tftp/files
mkdir -p nagios-check_tftp/files > /dev/null 2>&1
echo x - nagios-check_tftp/files/patch-check_tftp
sed 's/^X//' >nagios-check_tftp/files/patch-check_tftp << '268bfffbaabd755475afbc9e9fa77dc0'
X--- ./check_tftp.orig	2011-08-13 12:15:04.000000000 +0200
X+++ ./check_tftp	2011-08-13 12:22:28.000000000 +0200
X@@ -1,4 +1,4 @@
X-#!/bin/bash
X+#!/usr/local/bin/bash
X #
X # check_tftp
X #
X@@ -317,6 +317,7 @@
X STATE_UNKNOWN=3
X STATE_DEPENDENT=4
X 
X+TFTP="/usr/local/bin/tftp -v"
X 
X function print_version () {
X     cat <<EOF
X@@ -412,7 +413,7 @@
X         echo "Cannot create temporary directory in /tmp"
X         exit $STATE_UNKNOWN
X     }
X-    RESULT="$(echo get NaGiOs_ChEcK_FiLe | tftp $HOST 2>&1 | head -n 1)"
X+    RESULT="$(echo get NaGiOs_ChEcK_FiLe | ${TFTP} $HOST 2>&1 | tail -n 2 | head -n 1)"
X     cd ..
X     rm -f "$TMPDIR/NaGiOs_ChEcK_FiLe"
X     rmdir "$TMPDIR"
X@@ -440,16 +441,15 @@
X 	echo "Cannot create temporary directory in /tmp"
X 	exit $STATE_UNKNOWN
X     }
X-    RESULT="$(echo get $FILENAME | tftp $HOST 2>&1 | head -n 1)"
X+    RESULT="$(echo get $FILENAME | ${TFTP} $HOST 2>&1 | tail -n 2 | head -n 1)"
X     if [ -f "$FILENAME" ] ; then
X-	ACTSIZE="$(wc "$FILENAME" --bytes | awk '{print $1;}')"
X+	ACTSIZE="$(wc -c "$FILENAME" | awk '{print $1;}')"
X     else
X 	ACTSIZE=0
X     fi
X 
X-    rm -f "$FILENAME"
X     cd ..
X-    rmdir "$TMPDIR"
X+    rm -r "$TMPDIR"
X 
X     check_principal_errors "$RESULT"
X     case "$RESULT" in
X@@ -457,7 +457,7 @@
X 	    echo "Server answered: file $FILE not found"
X 	    exit $STATE_CRITICAL
X 	;;
X-	*"Received "*" bytes in "*" seconds")
X+	*"Received "*" bytes in "*" seconds "*)
X 	    if [ "$SIZE" -ge "$ACTSIZE" -a "$SIZE" -le "$ACTSIZE" ] ; then
X 		echo "OK - ${RESULT#*tftp> }"
X 		exit $STATE_OK
268bfffbaabd755475afbc9e9fa77dc0
echo x - nagios-check_tftp/pkg-descr
sed 's/^X//' >nagios-check_tftp/pkg-descr << 'cf0d2abe357fd6818a36353ced0bb465'
XNagios plugin for checking tftp servers. It is written as bash script and 
Xrequires tftp-hpa client binary.
XThis plugin is even able to retrieve a file an compare the size with a given 
Xvalue.
X
XPlugin by Matthias Kettner (WWW: http://mathias-kettner.de/download/check_tftp).
cf0d2abe357fd6818a36353ced0bb465
echo x - nagios-check_tftp/Makefile
sed 's/^X//' >nagios-check_tftp/Makefile << 'bbc6d828bf092cc12c35659eb43a0317'
X# New ports collection makefile for:   icinga-web
X# Date created:        7 August 2011
X# Whom:                hr
X#
X# $FreeBSD$
X#
X
XPORTNAME=	${PLUGINNAME}
XPORTVERSION=	1.0.1
XCATEGORIES=	net-mgmt
XMASTER_SITES=	http://mathias-kettner.de/download/
XPKGNAMEPREFIX=  nagios-
XDISTNAME=	${PLUGINNAME}
XEXTRACT_SUFX=
X
XMAINTAINER=	holgerrepp@googlemail.com
XCOMMENT=	Nagios plugin to check tftp servers
X
XRUN_DEPENDS=	bash:${PORTSDIR}/shells/bash \
X		tftp-hpa:${PORTSDIR}/ftp/tftp-hpa
X
XPLUGINNAME=	check_tftp
X
XPLIST_DIRSTRY=  libexec/nagios
XPLIST_FILES=    libexec/nagios/check_tftp
XNO_BUILD=	yes
XNO_WRKSUBDIR=	yes
X
Xdo-extract:
X		@${MKDIR} ${WRKDIR}
X		@${CP} ${DISTDIR}/${PLUGINNAME}	${WRKDIR}/
Xdo-install:
X		@${MKDIR} ${PREFIX}/libexec/nagios
X		@${INSTALL_SCRIPT} ${WRKDIR}/${PLUGINNAME} ${PREFIX}/libexec/nagios
X
X.include <bsd.port.mk>
bbc6d828bf092cc12c35659eb43a0317
echo x - nagios-check_tftp/distinfo
sed 's/^X//' >nagios-check_tftp/distinfo << 'efba502b4f5df9b5b49337df151a75e0'
XSHA256 (check_tftp) = 48881276122cb774d4ad80cb5557fbae34d1c19bc2b41c712b39a8244111b97b
XSIZE (check_tftp) = 21243
efba502b4f5df9b5b49337df151a75e0
exit



>Release-Note:
>Audit-Trail:
Class-Changed-From-To: update->change-request 
Class-Changed-By: edwin 
Class-Changed-When: Sat Aug 13 11:20:22 UTC 2011 
Class-Changed-Why:  
Fix category (new ports should be change-requests) (via the GNATS Auto 
Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=159737 
Responsible-Changed-From-To: freebsd-ports-bugs->swills 
Responsible-Changed-By: swills 
Responsible-Changed-When: Sat Aug 13 14:34:46 UTC 2011 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=159737 
State-Changed-From-To: open->closed 
State-Changed-By: swills 
State-Changed-When: Sat Aug 13 17:29:26 UTC 2011 
State-Changed-Why:  
New port added, with minor changes. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=159737 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/159737: commit references a PR
Date: Sat, 13 Aug 2011 17:29:34 +0000 (UTC)

 swills      2011-08-13 17:29:20 UTC
 
   FreeBSD ports repository
 
   Modified files:
     net-mgmt             Makefile 
   Added files:
     net-mgmt/nagios-check_tftp Makefile distinfo pkg-descr 
     net-mgmt/nagios-check_tftp/files patch-check_tftp 
   Log:
   Nagios plugin for checking tftp servers. This plugin can retrieve a file and
   compare the size with a given value.
   
   WWW: http://mathias-kettner.de/download/check_tftp
   
   PR:             ports/159737
   Submitted by:   hr <holgerrepp at googlemail.com>
   
   Revision  Changes    Path
   1.253     +1 -0      ports/net-mgmt/Makefile
   1.1       +37 -0     ports/net-mgmt/nagios-check_tftp/Makefile (new)
   1.1       +2 -0      ports/net-mgmt/nagios-check_tftp/distinfo (new)
   1.1       +54 -0     ports/net-mgmt/nagios-check_tftp/files/patch-check_tftp (new)
   1.1       +4 -0      ports/net-mgmt/nagios-check_tftp/pkg-descr (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
