ports/65144: MAINTAINER UPDATE: fixes for nagios-plugins

Blaz Zupan blaz.zupan at amis.net
Sat Apr 3 23:20:14 UTC 2004


>Number:         65144
>Category:       ports
>Synopsis:       MAINTAINER UPDATE: fixes for nagios-plugins
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 03 15:20:13 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Blaz Zupan
>Release:        FreeBSD 4.9-RELEASE-p1 i386
>Organization:
>Environment:
System: FreeBSD titanic.medinet.si 4.9-RELEASE-p1 FreeBSD 4.9-RELEASE-p1 #3: Sat Dec 20 15:57:16 CET 2003 root at bigbrother.amis.net:/db/obj/usr/src/sys/TITANIC i386


	
>Description:

- make batch compiling nagios-plugins easier by supporting the environment
  variable NAGIOS_PLUGINS_OPTIONS which can be set to the set of options you
  want to compile the plugins with. Useful when used with portupgrade
- fix parameters passed to /bin/ps which is used by check_procs and check_nagios

>How-To-Repeat:
	
>Fix:

diff -urN nagios-plugins.old/Makefile nagios-plugins/Makefile
--- nagios-plugins.old/Makefile	Sun Mar 14 07:17:10 2004
+++ nagios-plugins/Makefile	Sun Apr  4 00:56:22 2004
@@ -7,7 +7,7 @@
 
 PORTNAME=	nagios-plugins
 PORTVERSION=	1.3.1
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	net-mgmt
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	nagiosplug
diff -urN nagios-plugins.old/files/patch-configure.in nagios-plugins/files/patch-configure.in
--- nagios-plugins.old/files/patch-configure.in	Sun Aug  3 10:16:59 2003
+++ nagios-plugins/files/patch-configure.in	Sun Apr  4 01:03:31 2004
@@ -1,5 +1,5 @@
 --- configure.in.orig	Fri Jul 11 08:12:23 2003
-+++ configure.in	Sun Jul 13 13:13:37 2003
++++ configure.in	Sun Apr  4 01:03:13 2004
 @@ -12,7 +12,7 @@
  AM_INIT_AUTOMAKE(nagios-plugins,${PACKAGE_VERSION})
  AM_CONFIG_HEADER(plugins/config.h plugins/common.h plugins/version.h plugins/netutils.h plugins/utils.h plugins/popen.h)
@@ -79,7 +79,33 @@
  LIBS="$_SAVEDLIBS"
  
  dnl Check for OpenSSL location
-@@ -841,6 +852,8 @@
+@@ -418,9 +429,24 @@
+ fi
+ 
+ AC_PATH_PROG(PATH_TO_PS,ps)
++dnl For FreeBSD
++dnl  STAT UCOMM              VSZ   RSS USER      PPID COMMAND
++if ps -axwo 'stat ucomm vsz rss user uid ppid command' 2>/dev/null | egrep -i ["^ *STAT +UCOMM +VSZ +RSS +USER +UID +PPID +COMMAND"] > /dev/null
++then
++	AC_DEFINE(USE_PS_VARS,1,[Define if 'ps' will be parsed with sscanf])
++	AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[Variable list for sscanf of 'ps' output])
++	AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS -axwo 'stat uid ppid command'",[Verbatim command to execute for ps in check_netsaint])
++	EXTRAS="$EXTRAS check_nagios"
++	AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -axwo 'stat uid ppid ucomm command'",[Verbatim command to execute for ps in check_procs])
++	AC_DEFINE_UNQUOTED(PS_FORMAT,"%s %d %d %s %n",[Format string for scanning ps output in check_procs])
++	AC_DEFINE_UNQUOTED(VSZ_COMMAND,"$PATH_TO_PS -axwo 'vsz ucomm'",[Verbatim command to execute for ps in check_vsz])
++	AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%d %s",[Format string for scanning ps output in check_vsz])
++	AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -axwo 'rss ucomm'",[Verbatim command to execute for ps in check_rss])
++	AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s",[Format string for scanning ps output in check_rss])
++  echo "      ps syntax... $PATH_TO_PS -axwo 'stat uid ppid ucomm command'"
+ dnl For OpenBSD 3.2 & 3.3. Must come before ps -weo
+ dnl  STAT UCOMM              VSZ   RSS USER      PPID COMMAND
+-if ps -axwo 'stat comm vsz rss user uid ppid args' 2>/dev/null | egrep -i ["^ *STAT +UCOMM +VSZ +RSS +USER +UID +PPID +COMMAND"] > /dev/null
++elif ps -axwo 'stat comm vsz rss user uid ppid args' 2>/dev/null | egrep -i ["^ *STAT +UCOMM +VSZ +RSS +USER +UID +PPID +COMMAND"] > /dev/null
+ then
+ 	AC_DEFINE(USE_PS_VARS,1,[Define if 'ps' will be parsed with sscanf])
+ 	AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,procprog,&pos],[Variable list for sscanf of 'ps' output])
+@@ -841,6 +867,8 @@
  	AC_DEFINE_UNQUOTED(WHO_COMMAND,"$PATH_TO_WHO",[path and arguments for invoking 'who'])
  fi
  
@@ -88,7 +114,7 @@
  AC_PATH_PROG(PATH_TO_SNMPGET,snmpget)
  if test -x "$PATH_TO_SNMPGET"
  then
-@@ -863,7 +876,10 @@
+@@ -863,7 +891,10 @@
  	echo "** Tried $PERL - install Net::SNMP perl module if you want to"
  	echo "        use the perl snmp plugins"
  fi
@@ -99,7 +125,7 @@
  AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat)
  AC_PATH_PROG(PATH_TO_QSTAT,qstat)
  if test -x "$PATH_TO_QUAKESTAT"
-@@ -877,7 +893,10 @@
+@@ -877,7 +908,10 @@
  else
  	echo "** Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin"
  fi
@@ -110,7 +136,7 @@
  AC_PATH_PROG(PATH_TO_FPING,fping)
  if test -x "$PATH_TO_FPING"
  then
-@@ -885,6 +904,7 @@
+@@ -885,6 +919,7 @@
  	EXTRAS="$EXTRAS check_fping"
  else
  	echo "** Get fping from http://www.fping.com in order to make check_fping plugin"
diff -urN nagios-plugins.old/scripts/configure nagios-plugins/scripts/configure
--- nagios-plugins.old/scripts/configure	Fri Mar 12 13:42:34 2004
+++ nagios-plugins/scripts/configure	Sun Apr  4 00:55:35 2004
@@ -7,24 +7,31 @@
 
 tempfile=`mktemp -t checklist`
 
-if [ "${BATCH}" = "yes" ]; then
-else
-	/usr/bin/dialog --title "NetSaint plugins configuration options" --clear \
+if [ "${NAGIOS_PLUGINS_OPTIONS}" ]; then
+	set ${NAGIOS_PLUGINS_OPTIONS}
+fi
+
+for i; do
+	eval status_$i=ON
+done
+	
+if [ -z "${BATCH}" ]; then
+	/usr/bin/dialog --title "Nagios plugins configuration options" --clear \
 			--checklist "\n\
 Please select desired options:" -1 -1 16 \
-QStat	"Game server query support" OFF \
-FPing	"Support for non-flooding fast ping" OFF \
-NetSNMP	"SNMP support" OFF \
-Radiusclient	"Radius support" OFF \
-MySQL	"MySQL support" OFF \
-PostgreSQL	"PostgreSQL support" OFF \
-OpenLDAP	"OpenLDAP support" OFF \
+QStat	"Game server query support" "$status_QStat" \
+FPing	"Support for non-flooding fast ping" "$status_FPing" \
+NetSNMP	"SNMP support" "$status_NetSNMP" \
+Radius	"Radius support" "$status_Radius" \
+MySQL	"MySQL support" "$status_MySQL" \
+PgSQL	"PostgreSQL support" "$status_PgSQL" \
+OpenLDAP	"OpenLDAP support" "$status_OpenLDAP" \
 2> $tempfile
 
 	retval=$?
 
 	if [ -s $tempfile ]; then
-		set `cat $tempfile`
+		set `sed 's/"//g' $tempfile`
 	fi
 	rm -f $tempfile
 
@@ -42,6 +49,8 @@
 ${MKDIR} ${WRKDIRPREFIX}${CURDIR}
 exec > ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
 
+echo "PREFIX=   ${PREFIX}"
+
 SUB_QSTAT="@comment "
 SUB_FPING="@comment "
 SUB_SNMP="@comment "
@@ -52,19 +61,19 @@
 
 while [ "$1" ]; do
 	case $1 in
-		\"QStat\")
+		QStat)
 			echo "BUILD_DEPENDS+=	qstat:\${PORTSDIR}/games/qstat"
 			echo "RUN_DEPENDS+=	qstat:\${PORTSDIR}/games/qstat"
 			echo "CONFIGURE_ARGS+=	--enable-qstat"
 			SUB_QSTAT=""
 			;;
-		\"FPing\")
+		FPing)
 			echo "BUILD_DEPENDS+=	fping:\${PORTSDIR}/net/fping"
 			echo "RUN_DEPENDS+=	fping:\${PORTSDIR}/net/fping"
 			echo "CONFIGURE_ARGS+=	--enable-fping"
 			SUB_FPING=""
 			;;
-		\"NetSNMP\")
+		NetSNMP)
 			echo "BUILD_DEPENDS+=	snmpcheck:\${PORTSDIR}/net-mgmt/net-snmp"
 			echo "RUN_DEPENDS+=	snmpcheck:\${PORTSDIR}/net-mgmt/net-snmp"
 			echo "BUILD_DEPENDS+=	\${LOCALBASE}/lib/perl5/site_perl/\${PERL_VER}/Net/SNMP.pm:\${PORTSDIR}/net-mgmt/p5-Net-SNMP"
@@ -72,12 +81,12 @@
 			echo "CONFIGURE_ARGS+=	--enable-snmp"
 			SUB_SNMP=""
 			;;
-		\"Radiusclient\")
+		Radius)
 			echo "LIB_DEPENDS+=	radiusclient.0:\${PORTSDIR}/net/radiusclient"
 			echo "CONFIGURE_ARGS+=	--enable-radius"
 			SUB_RADIUS=""
 			;;
-		\"MySQL\")
+		MySQL)
 			echo ".if exists(${LOCALBASE}/lib/mysql/libmysqlclient.so.12)"
 			echo "LIB_DEPENDS+=	mysqlclient.12:${PORTSDIR}/databases/mysql40-client"
 			echo ".else"
@@ -90,19 +99,19 @@
 			echo "CONFIGURE_ARGS+=	--with-mysql=\${LOCALBASE}"
 			SUB_MYSQL=""
 			;;
-		\"PostgreSQL\")
+		PgSQL)
 			echo "POSTGRESQL_PORT?=	databases/postgresql7"
 			echo "LIB_DEPENDS+=	pq.3:\${PORTSDIR}/\${POSTGRESQL_PORT}"
 			echo "CONFIGURE_ARGS+=	--with-pgsql=\${LOCALBASE}"
 			SUB_PGSQL=""
 			;;
-		\"OpenLDAP\")
+		OpenLDAP)
 			echo "LIB_DEPENDS+=	ldap.2:\${PORTSDIR}/net/openldap20-client"
 			echo "CONFIGURE_ARGS+=	--enable-ldap"
 			SUB_LDAP=""
 			;;
 		*)
-			echo "Invalid option(s): $*" > /dev/stderr
+			echo "Unknown option(s): $*" > /dev/stderr
 			rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
 			exit 1
 			;;
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list