Update to 0.23. Make work with Nagios 3.x

ok sthen@
This commit is contained in:
merdely 2008-04-09 14:29:44 +00:00
parent 72aa337e03
commit 6a7828c72b
3 changed files with 57 additions and 37 deletions

View File

@ -1,8 +1,8 @@
# $OpenBSD: Makefile,v 1.2 2008/02/23 18:06:51 sthen Exp $
# $OpenBSD: Makefile,v 1.3 2008/04/09 14:29:44 merdely Exp $
COMMENT = console interface for nagios
DISTNAME = cnagios-0.21
DISTNAME = cnagios-0.23
CATEGORIES = net/nagios
HOMEPAGE = http://noc.hep.wisc.edu/cnagios.html
@ -21,9 +21,9 @@ MASTER_SITES = ftp://noc.hep.wisc.edu/pub/src/cnagios/
NO_REGRESS = Yes
RUN_DEPENDS = ::net/nagios/nagios
RUN_DEPENDS = :nagios->=3.0:net/nagios/nagios
CONFIGURE_STYLE = gnu
CONFIGURE_ARGS = --with-nagios-data=2 \
CONFIGURE_ARGS = --with-nagios-data=3 \
--with-etc-dir="${SYSCONFDIR}/cnagios" \
--with-var-dir="/var/nagios"
MODGNU_CONFIG_GUESS_DIRS=${WRKSRC}/config

View File

@ -1,5 +1,5 @@
MD5 (cnagios-0.21.tar.gz) = 9XPBQjOJ2OYU17CJRgd4kw==
RMD160 (cnagios-0.21.tar.gz) = j+oCu186ntlQEwyPOPKrp0ARSUs=
SHA1 (cnagios-0.21.tar.gz) = HaO4n8NLVqxXdp4Qa8GU5bR2u9w=
SHA256 (cnagios-0.21.tar.gz) = xN+Ajyz55koZCq2eATe1DY+d+Ac7Yh3ES1eyINqedxQ=
SIZE (cnagios-0.21.tar.gz) = 56744
MD5 (cnagios-0.23.tar.gz) = 10xXXMAQaJnRJOgWQ9behQ==
RMD160 (cnagios-0.23.tar.gz) = 6BEI/ISCvh2wk2SCRPBUafvdrlk=
SHA1 (cnagios-0.23.tar.gz) = IQ/iQgtcTfFC5Vx7BbzHOHUkTOI=
SHA256 (cnagios-0.23.tar.gz) = KNpkZEfXIKHmsBwQOOHjmFMmpZ75TtawKGEL1927W1I=
SIZE (cnagios-0.23.tar.gz) = 58403

View File

@ -1,32 +1,52 @@
$OpenBSD: patch-configure,v 1.1.1.1 2008/02/05 23:00:22 sthen Exp $
--- configure.orig Tue Feb 5 12:53:01 2008
+++ configure Tue Feb 5 14:27:53 2008
@@ -1480,6 +1480,9 @@ fi;
if test "X $DATA_VER" != "X " ; then
echo "nagios data ver is $DATA_VER"
NAGIOS_STATUS_DATA_VERSION=$DATA_VER
+ if test "${DATA_VER}" == "2" ; then
+ NAGIOS_STATUS_DATA_FILE="$NAGIOS_VAR_DIR/status.dat"
+ fi
fi
$OpenBSD: patch-configure,v 1.2 2008/04/09 14:29:44 merdely Exp $
--- configure.orig Tue Apr 8 19:52:18 2008
+++ configure Tue Apr 8 19:54:23 2008
@@ -1472,47 +1472,7 @@ fi
#----------------------------------------
# nagios status data file and it's format...
echo "nagios status file... $NAGIOS_STATUS_DATA_FILE"
@@ -1488,17 +1491,8 @@ echo "nagios data version... $NAGIOS_STATUS_DATA_VERSI
-if test "X $HOSTNAME" = "X chive.hep.wisc.edu" ; then
- SITE_NAME="TEST "
+ SITE_NAME="OpenBSD World: "
echo "site name... $SITE_NAME"
-else
- echo "enter terse site name (just return for none): "
- read SITE_NAME
- if test "X $SITE_NAME" != "X " ; then
- SITE_NAME="$SITE_NAME "
- fi
-NAGIOS_STATUS_LOG="$NAGIOS_VAR_DIR/status.log"
-NAGIOS_STATUS_DAT="$NAGIOS_VAR_DIR/status.dat"
-
-if test -f "$NAGIOS_STATUS_LOG" ; then
- NAGIOS_STATUS_DATA_FILE=$NAGIOS_STATUS_LOG
-fi
-
-if test -f "$NAGIOS_STATUS_DAT" ; then
- NAGIOS_STATUS_DATA_FILE=$NAGIOS_STATUS_DAT
-fi
-
-if test -f "$NAGIOS_STATUS_LOG" && test -f "$NAGIOS_STATUS_DAT" ; then
- echo
- echo "WARNING: detected status.log and status.dat in $NAGIOS_VAR_DIR"
- echo "WARNING: using $NAGIOS_STATUS_DAT"
- echo
-fi
-
-NAGIOS_STATUS_DATA_VERSION=`head -20 $NAGIOS_STATUS_DATA_FILE | perl -ane '
- BEGIN { $v='UNKNOWN'; }
- if ( $_ =~ /Nagios 1.*? Status File/ ) { $v="1"; last; }
- if ( $_ =~ /version=(\d+)/ ) { $v="$1"; last; }
- END { print $v; }
-'`
-
-if test "$NAGIOS_STATUS_DATA_VERSION" = "UNKNOWN" ; then
- echo
- echo "FATAL ERROR: failed to detect data version in $NAGIOS_STATUS_DATA_FILE"
- echo "It appears you do not have a working Nagios installation."
- echo
- exit
-fi
-
-if test "$NAGIOS_STATUS_DATA_VERSION" -gt 3 ; then
- echo
- echo "FATAL ERROR: unsupported data version ($NAGIOS_STATUS_DATA_VERSION) in $NAGIOS_STATUS_DATA_VERSION"
- echo "Currently supported versions are 1, 2 and 3."
- echo
- exit
-fi
-
+NAGIOS_STATUS_DATA_FILE="$NAGIOS_VAR_DIR/status.dat"
ac_config_files="$ac_config_files Makefile cnagios.h"
# Check whether --with-nagios-data or --without-nagios-data was given.
if test "${with_nagios_data+set}" = set; then