From dkirhlarov@oilspace.com  Fri Jun  2 10:56:56 2006
Return-Path: <dkirhlarov@oilspace.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id D81BE16A429
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  2 Jun 2006 10:56:56 +0000 (UTC)
	(envelope-from dkirhlarov@oilspace.com)
Received: from office.oilspace.com (office.oilspace.com [194.129.65.230])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 3C9F043D5C
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  2 Jun 2006 10:56:56 +0000 (GMT)
	(envelope-from dkirhlarov@oilspace.com)
Received: from dimma.mow.oilspace.com (hq.oilspace.com [81.222.156.185])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by office.oilspace.com (Postfix) with ESMTP
	id 35DB3136CD9; Fri,  2 Jun 2006 11:56:55 +0100 (BST)
Received: from dimma.mow.oilspace.com (localhost [127.0.0.1])
	by dimma.mow.oilspace.com (8.13.4/8.13.3) with ESMTP id k52AusK2003112;
	Fri, 2 Jun 2006 14:56:54 +0400 (MSD)
	(envelope-from dkirhlarov@localhost.oilspace.com)
Received: (from dkirhlarov@localhost)
	by dimma.mow.oilspace.com (8.13.4/8.13.3/Submit) id k52AuqwL003111;
	Fri, 2 Jun 2006 14:56:52 +0400 (MSD)
	(envelope-from dkirhlarov)
Message-Id: <200606021056.k52AuqwL003111@dimma.mow.oilspace.com>
Date: Fri, 2 Jun 2006 14:56:52 +0400 (MSD)
From: Dmitriy Kirhlarov <dkirhlarov@oilspace.com>
Reply-To: Dmitriy Kirhlarov <dkirhlarov@oilspace.com>
To: FreeBSD-gnats-submit@freebsd.org, jarrod@netleader.com.au
Cc:
Subject: [PATCH] add several contrib checks
X-Send-Pr-Version: 3.113
X-GNATS-Notify: jarrod@netleader.com.au

>Number:         98364
>Category:       ports
>Synopsis:       [PATCH] net-mgmt/nagios-plugins: add several contrib checks
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 02 11:00:20 GMT 2006
>Closed-Date:    Sat Dec 09 14:39:59 GMT 2006
>Last-Modified:  Sat Dec 09 14:39:59 GMT 2006
>Originator:     Dmitriy Kirhlarov
>Release:        FreeBSD 5.4-STABLE i386
>Organization:
>Environment:
System: FreeBSD dimma.mow.oilspace.com 5.4-STABLE FreeBSD 5.4-STABLE #0: Sun Sep 25 23:26:13 MSD 2005 root@dimma.mow.oilspace.com:/usr/obj/usr/src/sys/dimma i386

	
>Description:
	I add several checks (with new special OPTION) from contrib/
	subdirectory of tarball. I look in every from this checks and
	not find problems, but I work only with check_netapp.pl and
	not test others.

>How-To-Repeat:
	
>Fix:

diff -NBur nagios-plugins.orig/Makefile nagios-plugins/Makefile
--- nagios-plugins.orig/Makefile	Thu Jun  1 12:51:32 2006
+++ nagios-plugins/Makefile	Fri Jun  2 10:34:33 2006
@@ -7,6 +7,7 @@
 
 PORTNAME=	nagios-plugins
 PORTVERSION=	1.4.3
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	net-mgmt
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE_EXTENDED}
@@ -30,6 +31,7 @@
 		MYSQL "MySQL support (check_mysql)" OFF \
 		PGSQL "PostgreSQL support (check_pgsql)" OFF \
 		LDAP "OpenLDAP support (check_ldap)" OFF \
+		CONTRIB "With contrib checks" OFF \
 		IPV6 "IPv6 support" ON
 
 GNU_CONFIGURE=	yes
@@ -126,6 +128,74 @@
 PLIST_SUB+=	SUB_LDAP=""
 .else
 PLIST_SUB+=	SUB_LDAP="@comment "
+.endif
+
+.if defined(WITH_CONTRIB)
+RUN_DEPENDS+=	${SITE_PERL}/Getopt/Long.pm:${PORTSDIR}/devel/p5-Getopt-Long \
+		${SITE_PERL}/Net/SNMP.pm:${PORTSDIR}/net-mgmt/p5-Net-SNMP \
+		${SITE_PERL}/LWP/UserAgent.pm:${PORTSDIR}/www/p5-libwww \
+		${SITE_PERL}/URI/URL.pm:${PORTSDIR}/net/p5-URI \
+		${SITE_PERL}/XML/Parser.pm:${PORTSDIR}/textproc/p5-XML-Parser \
+		${SITE_PERL}/Net/Jabber.pm:${PORTSDIR}/net-im/p5-Net-Jabber \
+		smartctl:${PORTSDIR}/sysutils/smartmontools \
+		sudo:${PORTSDIR}/security/sudo \
+		smbstatus:${PORTSDIR}/net/samba3
+
+CONTRIB_SCRIPTS = check_apache.pl \
+check_apc_ups.pl \
+check_appletalk.pl \
+check_asterisk.pl \
+check_backup.pl \
+check_bgpstate.pl \
+check_breeze.pl \
+check_digitemp.pl \
+check_disk_snmp.pl \
+check_dlswcircuit.pl \
+check_email_loop.pl \
+check_hprsc.pl \
+check_ica_master_browser.pl \
+check_ica_metaframe_pub_apps.pl \
+check_ica_program_neigbourhood.pl \
+check_inodes-freebsd.pl \
+check_javaproc.pl \
+check_log2.pl \
+check_lotus.pl \
+check_maxchannels.pl \
+check_maxwanstate.pl \
+check_mem.pl \
+check_ms_spooler.pl \
+check_netapp.pl \
+check_pfstate \
+check_qmailq.pl \
+check_remote_nagios_status.pl \
+check_smart.pl \
+check_smb.sh \
+check_snmp_printer.pl \
+check_snmp_process_monitor.pl \
+check_snmp_procs.pl \
+check_sockets.pl \
+check_traceroute-pure_perl.pl \
+check_traceroute.pl \
+checkciscotemp.pl \
+mrtgext.pl \
+nagios_sendim.pl \
+packet_utils.pm \
+rblcheck-dns \
+rblcheck-web \
+restrict.pl \
+sched_downtime.pl \
+
+.for f in ${CONTRIB_SCRIPTS}
+PLIST_FILES+=	libexec/nagios/${f}
+.endfor
+
+.endif
+
+post-install:
+.if defined(WITH_CONTRIB)
+.for f in ${CONTRIB_SCRIPTS}
+	${INSTALL_SCRIPT} ${WRKSRC}/contrib/${f} ${PREFIX}/libexec/nagios/
+.endfor
 .endif
 
 post-patch:
diff -NBur nagios-plugins.orig/files/patch-contrib__check_ms_spooler.pl nagios-plugins/files/patch-contrib__check_ms_spooler.pl
--- nagios-plugins.orig/files/patch-contrib__check_ms_spooler.pl	Thu Jan  1 00:00:00 1970
+++ nagios-plugins/files/patch-contrib__check_ms_spooler.pl	Fri Jun  2 07:40:07 2006
@@ -0,0 +1,11 @@
+--- contrib/check_ms_spooler.pl.orig	Fri Jun  2 07:37:15 2006
++++ contrib/check_ms_spooler.pl	Fri Jun  2 07:38:42 2006
+@@ -53,7 +53,7 @@
+ 
+ delete @ENV{'PATH', 'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
+ 
+-use constant SMBCLIENT_PATH	=> '/usr/local/samba/bin/smbclient' ;
++use constant SMBCLIENT_PATH	=> '/usr/local/bin/smbclient' ;
+ use constant MAX_QUEUES_TO_CHECK => 20 ;		# So that the check doesn't take longer than $TIMEOUT
+ 
+ use constant SMBCLIENT_SVC	=> sub { return `${\SMBCLIENT_PATH} -L //$_[0] -U $_[1]%$_[2]` } ;
diff -NBur nagios-plugins.orig/files/patch-contrib__check_smart.pl nagios-plugins/files/patch-contrib__check_smart.pl
--- nagios-plugins.orig/files/patch-contrib__check_smart.pl	Thu Jan  1 00:00:00 1970
+++ nagios-plugins/files/patch-contrib__check_smart.pl	Fri Jun  2 07:58:00 2006
@@ -0,0 +1,11 @@
+--- contrib/check_smart.pl.orig	Fri Jun  2 07:53:19 2006
++++ contrib/check_smart.pl	Fri Jun  2 07:56:52 2006
+@@ -26,7 +26,7 @@
+ 	$s, $i, $out, $retcode, $errtxt, $exitcode,
+ 	$device, $text_mode, $exitcode_mode, $help, $verbose, $type,
+ );
+-my $smartctl = "sudo /usr/sbin/smartctl";
++my $smartctl = "sudo /usr/local/sbin/smartctl";
+ my $e_commandline = 0;
+ my $e_devopen = 0;
+ my $e_chksum = 0;
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Fri Jun 2 12:07:30 UTC 2006 
State-Changed-Why:  
Awaiting maintainers feedback 

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

From: Jarrod Sayers <jarrod@netleader.com.au>
To: Dmitriy Kirhlarov <dkirhlarov@oilspace.com>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/98364: [PATCH] net-mgmt/nagios-plugins: add several contrib checks
Date: Sat, 3 Jun 2006 14:03:04 +0930

 Thanks for that rather large patch.  I would rather the contrib/  
 section be broken down further to at least ports requiring extra  
 libraries or applications - the fact that sudo is installed for a  
 user just wanting check_mem doesn't quite sit with me.  I'll see what  
 I can come up with over the next few days based on your patch and  
 will PR in separately.
 
 Jarrod.

From: Dmitriy Kirhlarov <dkirhlarov@oilspace.com>
To: bug-followup@FreeBSD.org, Jarrod Sayers <jarrod@netleader.com.au>
Cc:  
Subject: Re: ports/98364: [PATCH] add several contrib checks
Date: Tue, 6 Jun 2006 11:31:21 +0400

 Also, if it possible, please, look on check_ldap . It look like
 broken:
 
 -bash-2.05b$ ./check_ldap -H fbsd -b 'o=oilspace' -3 -4
 Could not search/find objectclasses in o=oilspace
 
 -bash-2.05b$ ./check_ldap -H fbsd -b 'o=oilspace' -3 -4 -D \
 'cn=ldapadm,o=oil-space' -P password
 Could not bind to the ldap-server
 
 WBR
 -- 
 Dmitriy Kirhlarov
 OILspace, 26 Leninskaya sloboda, bld. 2, 2nd floor, 115280 Moscow, Russia
 P:+7 495 105 7247 ext.203 F:+7 495 105 7246 E:DmitriyKirhlarov@oilspace.com
 OILspace - The resource enriched - www.oilspace.com

From: Jarrod Sayers <jarrod@netleader.com.au>
To: Dmitriy Kirhlarov <dkirhlarov@oilspace.com>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/98364: [PATCH] add several contrib checks
Date: Wed, 7 Jun 2006 21:07:05 +0930

 Could you please provide some more details on your LDAP issue like  
 the version of FreeBSD and nagios-plugins you are running?  A quick  
 check of check_ldap shows that it is working, at least a basic  
 connection and protocol check which failed in your example.
 
 wallace# uname -srp
 FreeBSD 4.11-RELEASE-p18 i386
 wallace# pkg_info | grep nagios-plugins
 nagios-plugins-1.4.3,1 Plugins for Nagios
 wallace# /usr/local/libexec/nagios/check_ldap \
 ? -H directory.washington.edu \
 ? -b 'o=University of Washington,c=US' -3 -4
 LDAP OK - 0.936 seconds response time|time=0.935617s;;;0.000000
 wallace#
 
 I am also working on your contrib/ section updates. Don't worry, I  
 haven't forgotten.
 
 Jarrod.

From: Dmitriy Kirhlarov <dkirhlarov@oilspace.com>
To: Jarrod Sayers <jarrod@netleader.com.au>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/98364: [PATCH] add several contrib checks
Date: Wed, 7 Jun 2006 16:13:13 +0400

 On Wed, Jun 07, 2006 at 09:07:05PM +0930, Jarrod Sayers wrote:
 > Could you please provide some more details on your LDAP issue like the version of 
 > FreeBSD and nagios-plugins you are running?  A quick check of check_ldap shows that it 
 > is working, at least a basic connection and protocol check which failed in your 
 > example.
 
 I'm wrong about check_ldap. Sorry.
 Now I check carefully and find problem.
 My ldap server allow only SSL/TLS connections. I forget about
 /usr/local/etc/openldap/ldap.conf and check don't find CAcertificate
 on client host.
 But check_ldap error not very informatively and also "verbose" option
 not work.
 
 WBR
 -- 
 Dmitriy Kirhlarov
 OILspace, 26 Leninskaya sloboda, bld. 2, 2nd floor, 115280 Moscow, Russia
 P:+7 495 105 7247 ext.203 F:+7 495 105 7246 E:DmitriyKirhlarov@oilspace.com
 OILspace - The resource enriched - www.oilspace.com

From: Pav Lucistnik <pav@FreeBSD.org>
To: bug-followup@FreeBSD.org, dkirhlarov@oilspace.com, jarrod@netleader.com.au
Cc:  
Subject: Re: ports/98364: [PATCH] net-mgmt/nagios-plugins: add several
	contrib checks
Date: Sat, 07 Oct 2006 17:33:33 +0200

 Have there been any progress on this one?
 
 -- 
 Pav Lucistnik <pav@oook.cz>
               <pav@FreeBSD.org>
 
 No one expects the spanish inquisition.

From: Jarrod Sayers <jarrod@netleader.com.au>
To: pav@FreeBSD.org
Cc: bug-followup@FreeBSD.org, dkirhlarov@oilspace.com
Subject: Re: ports/98364: [PATCH] net-mgmt/nagios-plugins: add several contrib checks
Date: Sun, 8 Oct 2006 11:43:13 +0930

 Yes, progress has been made and as mentioned in previous emails, will  
 be broken down further into individual options.  I expect to have a  
 patch for release in the next few days.
 
 Jarrod.
 
State-Changed-From-To: feedback->closed 
State-Changed-By: miwi 
State-Changed-When: Sat Dec 9 14:39:57 UTC 2006 
State-Changed-Why:  
Timeout over 2 Months. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=98364 
>Unformatted:
