ports/98364: [PATCH] add several contrib checks

Dmitriy Kirhlarov dkirhlarov at oilspace.com
Fri Jun 2 11:00:22 UTC 2006


>Number:         98364
>Category:       ports
>Synopsis:       [PATCH] add several contrib checks
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 02 11:00:20 GMT 2006
>Closed-Date:
>Last-Modified:
>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 at 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:
>Unformatted:



More information about the freebsd-ports-bugs mailing list