diff options
author | Dirk Froemberg <dirk@FreeBSD.org> | 2001-04-16 11:42:07 +0000 |
---|---|---|
committer | Dirk Froemberg <dirk@FreeBSD.org> | 2001-04-16 11:42:07 +0000 |
commit | 199f814e16a85e7a3c819308899b68b920850f20 (patch) | |
tree | 7ff1f81b80bae0d589995d7f48af19c94038025e /net-mgmt/nagios-plugins | |
parent | e8260625db5d9e82261aa5adb0a44f144df51b9c (diff) | |
download | ports-199f814e16a85e7a3c819308899b68b920850f20.tar.gz ports-199f814e16a85e7a3c819308899b68b920850f20.zip |
Notes
Diffstat (limited to 'net-mgmt/nagios-plugins')
-rw-r--r-- | net-mgmt/nagios-plugins/Makefile | 47 | ||||
-rw-r--r-- | net-mgmt/nagios-plugins/files/patch-ab | 70 | ||||
-rw-r--r-- | net-mgmt/nagios-plugins/pkg-plist | 14 | ||||
-rw-r--r-- | net-mgmt/nagios-plugins/scripts/configure | 107 |
4 files changed, 181 insertions, 57 deletions
diff --git a/net-mgmt/nagios-plugins/Makefile b/net-mgmt/nagios-plugins/Makefile index 7f1edf1066b2..6d84d42c1fa8 100644 --- a/net-mgmt/nagios-plugins/Makefile +++ b/net-mgmt/nagios-plugins/Makefile @@ -7,7 +7,7 @@ PORTNAME= netsaint-plugins PORTVERSION= 1.2.9.3 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net MASTER_SITES= http://download.sourceforge.net/netsaintplug/ DISTNAME= ${PORTNAME}-1.2.9-3 @@ -24,48 +24,17 @@ CONFIGURE_ENV= LOCALBASE=${LOCALBASE} USE_AUTOMAKE= yes USE_GMAKE= yes -.if defined(WANT_QSTAT) -BUILD_DEPENDS+= qstat:${PORTSDIR}/games/qstat -RUN_DEPENDS+= qstat:${PORTSDIR}/games/qstat -PLIST_SUB+= WANT_QSTAT="" -.else -PLIST_SUB+= WANT_QSTAT="@comment " -.endif - -.if defined(WANT_FPING) -BUILD_DEPENDS+= fping:${PORTSDIR}/net/fping -RUN_DEPENDS+= fping:${PORTSDIR}/net/fping -PLIST_SUB+= WANT_FPING="" -.else -PLIST_SUB+= WANT_FPING="@comment " -.endif - -.if defined(WANT_SNMP) -BUILD_DEPENDS+= snmpcheck:${PORTSDIR}/net/net-snmp -RUN_DEPENDS+= snmpcheck:${PORTSDIR}/net/net-snmp -PLIST_SUB+= WANT_SNMP="" -CONFIGURE_ARGS+=--enable-snmp -.else -PLIST_SUB+= WANT_SNMP="@comment " -.endif - -.if defined(WANT_RADIUS) -LIB_DEPENDS+= radiusclient.0:${PORTSDIR}/net/radiusclient -PLIST_SUB+= WANT_RADIUS="" -CONFIGURE_ARGS+=--enable-radius -.else -PLIST_SUB+= WANT_RADIUS="@comment " -.endif +pre-fetch: + @${SETENV} ${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/configure -.if defined(WANT_MYSQL) -LIB_DEPENDS+= mysqlclient.10:${PORTSDIR}/databases/mysql323-client -PLIST_SUB+= WANT_MYSQL="" -CONFIGURE_ARGS+=--with-mysqllibdir=${LOCALBASE}/lib/mysql -.else -PLIST_SUB+= WANT_MYSQL="@comment " +.if exists(${WRKDIRPREFIX}${.CURDIR}/Makefile.inc) +.include "${WRKDIRPREFIX}${.CURDIR}/Makefile.inc" .endif pre-install: ${PERL} ${SCRIPTDIR}/createuser +post-clean: + @${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc + .include <bsd.port.mk> diff --git a/net-mgmt/nagios-plugins/files/patch-ab b/net-mgmt/nagios-plugins/files/patch-ab index 986c84d13442..4d27df545d40 100644 --- a/net-mgmt/nagios-plugins/files/patch-ab +++ b/net-mgmt/nagios-plugins/files/patch-ab @@ -1,5 +1,5 @@ --- configure.in.orig Tue Mar 6 06:40:44 2001 -+++ configure.in Sat Mar 17 21:38:21 2001 ++++ configure.in Mon Apr 16 12:24:22 2001 @@ -7,7 +7,7 @@ dnl AM_INIT_AUTOMAKE(netsaint-plugins,$VERSION) AM_CONFIG_HEADER(plugins/config.h plugins/common.h plugins/version.h plugins/netutils.h plugins/utils.h plugins/popen.h) @@ -9,7 +9,7 @@ dnl Figure out how to invoke "install" and what install options to use. -@@ -126,18 +126,28 @@ +@@ -126,25 +126,37 @@ LIBS="$_SAVEDLIBS" CPPFLAGS="$_SAVEDCPPFLAGS" @@ -38,9 +38,27 @@ LIBS="$_SAVEDLIBS" +fi ++AC_ARG_ENABLE(ldap,--enable-ldap compile check_ldap) ++if test $enableval; then dnl Check for LDAP libraries _SAVEDLIBS="$LIBS" -@@ -157,9 +167,9 @@ +-AC_CHECK_LIB(ldap,main,,,-llber) +-if test "$ac_cv_lib_ldap_main" = "yes"; then +- LDAPLIBS="-lldap -llber"\ +- LDAPINCLUDE="-I/usr/include/ldap" ++AC_CHECK_LIB(ldap,ldap_simple_bind,,,-L${LOCALBASE}/lib -llber) ++if test "$ac_cv_lib_ldap_ldap_simple_bind" = "yes"; then ++ LDAPLIBS="-L${LOCALBASE}/lib -lldap -llber"\ ++ LDAPINCLUDE="-I${LOCALBASE}/include" + AC_SUBST(LDAPLIBS) + AC_SUBST(LDAPINCLUDE) + EXTRAS="$EXTRAS check_ldap" +@@ -153,13 +165,14 @@ + AC_MSG_WARN([install LDAP libs to compile this plugin (see Requirements).]) + fi + LIBS="$_SAVEDLIBS" ++fi + dnl Check for mysql libraries _SAVEDLIBS="$LIBS" _SAVEDCPPFLAGS="$CPPFLAGS" @@ -52,7 +70,7 @@ AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L$MYSQLLIBDIR",,-L$MYSQLLIBDIR -lz) elif test -f /usr/lib/libmysqlclient.so; then AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz",,-lz) -@@ -175,7 +185,8 @@ +@@ -175,7 +188,8 @@ AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql) fi if test "$ac_cv_lib_mysqlclient_mysql_init" = "yes" -o "$ac_cv_lib_mysqlclient_mysql_close" = "yes"; then @@ -62,7 +80,7 @@ if test "$ac_cv_header_mysql_mysql_h" = "yes" -a "$ac_cv_header_mysql_errmsg_h" = "yes"; then EXTRAS="$EXTRAS check_mysql" AC_SUBST(MYSQLLIBS) -@@ -189,7 +200,7 @@ +@@ -189,7 +203,7 @@ AC_MSG_WARN([install mysql client libs to compile this plugin (see Requirements).]) fi LIBS="$_SAVEDLIBS" @@ -71,7 +89,7 @@ dnl Check for OpenSSL location AC_PATH_PROG(OPENSSL,openssl) -@@ -268,16 +279,16 @@ +@@ -268,16 +282,16 @@ dnl AC_SUBST(libgetopt_a_DEPENDENCIES) dnl AC_SUBST(libsnprintf_a_SOURCES) @@ -97,7 +115,7 @@ AC_CHECK_FUNC(vsnprintf,,LIBS="$LIBS -lsnprintf" DEPLIBS="$DEPLIBS libsnprintf.a") -@@ -328,72 +339,72 @@ +@@ -328,72 +342,72 @@ AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS -eo 'rss comm'") AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s") echo " ps syntax... $PATH_TO_PS -eo 's comm vsz rss user ppid args'" @@ -199,7 +217,7 @@ dnl BSD-like mode in RH 6.1 elif [ps waxno 'state comm vsz rss uid user ppid args' 2>/dev/null | egrep -i "^S +COMMAND +VSZ +RSS +UID +USER +PPID +[RGSCOMDNA]+" >/dev/null] then -@@ -407,7 +418,7 @@ +@@ -407,7 +421,7 @@ AC_DEFINE_UNQUOTED(VSZ_FORMAT,"%d %s") AC_DEFINE_UNQUOTED(RSS_COMMAND,"$PATH_TO_PS waxno 'rss comm'") AC_DEFINE_UNQUOTED(RSS_FORMAT,"%d %s") @@ -208,7 +226,7 @@ dnl IRIX 53 elif [ps -el 2>/dev/null | egrep -i "^ *F +S +UID +PID +PPID +C +PRI +NI +P +SZ +RSS +WCHAN +TTY +TIME +[RGSCOMDNA]+" >/dev/null] then -@@ -618,6 +629,8 @@ +@@ -618,6 +632,8 @@ AC_DEFINE_UNQUOTED(WHO_COMMAND,"$PATH_TO_WHO") fi @@ -217,11 +235,39 @@ AC_PATH_PROG(PATH_TO_SNMPGET,snmpget) if test -f "$PATH_TO_SNMPGET" then -@@ -625,6 +638,7 @@ - EXTRAS="$EXTRAS check_hpjd check_snmp" +@@ -626,6 +642,7 @@ else echo "** Get snmpget from http://ucd-snmp.ucdavis.edu to make check_hpjd and check_snmp plugins" -+fi fi ++fi AC_PATH_PROG(PATH_TO_SNMPGETNEXT,snmpgetnext) + if test -f "$PATH_TO_SNMPGETNEXT" +@@ -633,6 +650,8 @@ + AC_DEFINE_UNQUOTED(PATH_TO_SNMPGETNEXT,"$PATH_TO_SNMPGETNEXT") + fi + ++AC_ARG_ENABLE(qstat,--enable-qstat compile check_game) ++if test $enableval; then + AC_PATH_PROG(PATH_TO_QUAKESTAT,quakestat) + AC_PATH_PROG(PATH_TO_QSTAT,qstat) + if test -n "$PATH_TO_QUAKESTAT" +@@ -646,7 +665,10 @@ + else + echo "** Get qstat from http://www.activesw.com/people/steve/qstat.html in order to make check_game plugin" + fi ++fi + ++AC_ARG_ENABLE(fping,--enable-fping compile check_fping) ++if test $enableval; then + AC_PATH_PROG(PATH_TO_FPING,fping) + if test -n "$PATH_TO_FPING" + then +@@ -654,6 +676,7 @@ + EXTRAS="$EXTRAS check_fping" + else + echo "** Get fping from http://www.stanford.edu/~schemers/docs/fping/fping.html in order to make check_fping plugin" ++fi + fi + + AC_PATH_PROG(PATH_TO_SSH,ssh) diff --git a/net-mgmt/nagios-plugins/pkg-plist b/net-mgmt/nagios-plugins/pkg-plist index 27c353282403..dad66c5abf20 100644 --- a/net-mgmt/nagios-plugins/pkg-plist +++ b/net-mgmt/nagios-plugins/pkg-plist @@ -6,33 +6,35 @@ libexec/netsaint/check_disk_smb libexec/netsaint/check_dns libexec/netsaint/check_dummy libexec/netsaint/check_flexlm -%%WANT_FPING%%libexec/netsaint/check_fping +%%SUB_FPING%%libexec/netsaint/check_fping libexec/netsaint/check_ftp -%%WANT_QSTAT%%libexec/netsaint/check_game -%%WANT_SNMP%%libexec/netsaint/check_hpjd +%%SUB_QSTAT%%libexec/netsaint/check_game +%%SUB_SNMP%%libexec/netsaint/check_hpjd libexec/netsaint/check_http libexec/netsaint/check_imap libexec/netsaint/check_ircd +%%SUB_LDAP%%libexec/netsaint/check_ldap libexec/netsaint/check_load libexec/netsaint/check_log libexec/netsaint/check_mrtg libexec/netsaint/check_mrtgtraf -%%WANT_MYSQL%%libexec/netsaint/check_mysql +%%SUB_MYSQL%%libexec/netsaint/check_mysql libexec/netsaint/check_netsaint libexec/netsaint/check_nntp libexec/netsaint/check_ntp libexec/netsaint/check_nwstat libexec/netsaint/check_oracle libexec/netsaint/check_overcr +%%SUB_PGSQL%%libexec/netsaint/check_pgsql libexec/netsaint/check_ping libexec/netsaint/check_pop libexec/netsaint/check_procs -%%WANT_RADIUS%%libexec/netsaint/check_radius +%%SUB_RADIUS%%libexec/netsaint/check_radius libexec/netsaint/check_real libexec/netsaint/check_rpc libexec/netsaint/check_sensors libexec/netsaint/check_smtp -%%WANT_SNMP%%libexec/netsaint/check_snmp +%%SUB_SNMP%%libexec/netsaint/check_snmp libexec/netsaint/check_ssh libexec/netsaint/check_swap libexec/netsaint/check_tcp diff --git a/net-mgmt/nagios-plugins/scripts/configure b/net-mgmt/nagios-plugins/scripts/configure new file mode 100644 index 000000000000..efb83034f1d2 --- /dev/null +++ b/net-mgmt/nagios-plugins/scripts/configure @@ -0,0 +1,107 @@ +#!/bin/sh +# $FreeBSD$ + +if [ -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc ]; then + exit +fi + +tempfile=`mktemp -t checklist` + +if [ "${BATCH}" = "yes" ]; then +else + /usr/bin/dialog --title "NetSaint 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 \ +2> $tempfile + + retval=$? + + if [ -s $tempfile ]; then + set `cat $tempfile` + fi + rm -f $tempfile + + case $retval in + 0) if [ -z "$*" ]; then + echo "Nothing selected" + fi + ;; + 1) echo "Cancel pressed." + exit 1 + ;; + esac +fi + +exec > ${WRKDIRPREFIX}${CURDIR}/Makefile.inc + +SUB_QSTAT="@comment " +SUB_FPING="@comment " +SUB_SNMP="@comment " +SUB_RADIUS="@comment " +SUB_MYSQL="@comment " +SUB_PGSQL="@comment " +SUB_LDAP="@comment " + +while [ "$1" ]; do + case $1 in + \"QStat\") + echo "BUILD_DEPENDS+= qstat:\${PORTSDIR}/games/qstat" + echo "RUN_DEPENDS+= qstat:\${PORTSDIR}/games/qstat" + echo "CONFIGURE_ARGS+= --enable-qstat" + SUB_QSTAT="" + ;; + \"FPing\") + echo "BUILD_DEPENDS+= fping:\${PORTSDIR}/net/fping" + echo "RUN_DEPENDS+= fping:\${PORTSDIR}/net/fping" + echo "CONFIGURE_ARGS+= --enable-fping" + SUB_FPING="" + ;; + \"NetSNMP\") + echo "BUILD_DEPENDS+= snmpcheck:\${PORTSDIR}/net/net-snmp" + echo "RUN_DEPENDS+= snmpcheck:\${PORTSDIR}/net/net-snmp" + echo "CONFIGURE_ARGS+= --enable-snmp" + SUB_SNMP="" + ;; + \"Radiusclient\") + echo "LIB_DEPENDS+= radiusclient.0:\${PORTSDIR}/net/radiusclient" + echo "CONFIGURE_ARGS+= --enable-radius" + SUB_RADIUS="" + ;; + \"MySQL\") + echo "LIB_DEPENDS+= mysqlclient.10:\${PORTSDIR}/databases/mysql323-client" + echo "CONFIGURE_ARGS+= --with-mysqllibdir=\${LOCALBASE}/lib/mysql" + SUB_MYSQL="" + ;; + \"PostgreSQL\") + echo "LIB_DEPENDS+= pq.2:\${PORTSDIR}/databases/postgresql7" + echo "CONFIGURE_ARGS+= --with-pgsql=\${LOCALBASE}/pgsql" + SUB_PGSQL="" + ;; + \"OpenLDAP\") + echo "LIB_DEPENDS+= ldap.2:\${PORTSDIR}/net/openldap2" + echo "CONFIGURE_ARGS+= --enable-ldap" + SUB_LDAP="" + ;; + *) + echo "Invalid option(s): $*" > /dev/stderr + rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc + exit 1 + ;; + esac + shift +done + +echo "PLIST_SUB+= SUB_QSTAT=\"${SUB_QSTAT}\"" +echo "PLIST_SUB+= SUB_FPING=\"${SUB_FPING}\"" +echo "PLIST_SUB+= SUB_SNMP=\"${SUB_SNMP}\"" +echo "PLIST_SUB+= SUB_RADIUS=\"${SUB_RADIUS}\"" +echo "PLIST_SUB+= SUB_MYSQL=\"${SUB_MYSQL}\"" +echo "PLIST_SUB+= SUB_PGSQL=\"${SUB_PGSQL}\"" +echo "PLIST_SUB+= SUB_LDAP=\"${SUB_LDAP}\"" |