On Mon, November 28, 2016 16:51, Tim Kuijsten wrote:
> Op 28-11-16 om 14:37 schreef Kirill Bychkov:
>> On Mon, November 28, 2016 02:22, Tim Kuijsten wrote:
>>> Hi ports@,
>>>
>>> I've updated cnagios to the latest release. Quite some segfaults have
>>> been fixed since 0.30.
>>>
>>> Tested on amd64.
>>>
>>> -Tim
>>>
>>> ps. I'm still looking for an easy way to use it with icinga. Maybe a
>>> cnagios package on it's own instead of being a subpackage of nagios
>>> would be better. I'm not sure..
>>>
>>
>> Hmm. It tries to detect data version of status.dat on configure stage.
>> If there is no file, configure fails.
>
> I think this is related to "Remove dependencies on live nagios instance
> #6" [1].
That's it.
>
>> For my icinga installation it detects version3. This could be overrided
>> with CONFIGURE_ARGS = --with-nagios-data=3.
>> But what should be set for nagios itself? Any nagios users around?
>
> I think status file format 3 is the latest in both nagios and icinga.
Thanks to sane defaults in OpenBSD packages! It is enough to install nagios
and run rcctls start nagios to make it run and collect some data for local
host!
But cnagios tells me that nagios uses data version 4:
[...]
nagios var dir... /var/nagios
nagios status file... /var/nagios/status.dat
nagios data version... 4
[...]
>
> -Tim
>
> [1] https://github.com/dannywarren/cnagios/issues/6
>
>>
>> WIP diff attached. Currently only icinga FLAVOR could be installed.
>> Default flavor will fail if there is no /var/nagios/status.dat.
>>
>> P.S. Briefly tested with icinga.
>>
Updated patch is attached.
OK to commit?
Index: Makefile
===================================================================
RCS file: /cvs/ports/net/nagios/cnagios/Makefile,v
retrieving revision 1.22
diff -u -p -r1.22 Makefile
--- Makefile 8 Jul 2016 16:48:21 -0000 1.22
+++ Makefile 28 Nov 2016 14:06:51 -0000
@@ -1,9 +1,11 @@
# $OpenBSD: Makefile,v 1.22 2016/07/08 16:48:21 sthen Exp $
-COMMENT = console interface for nagios
+COMMENT = console interface for nagios/icinga
+
+GH_ACCOUNT = dannywarren
+GH_PROJECT = cnagios
+GH_TAGNAME = 0.33
-DISTNAME = cnagios-0.30
-REVISION = 1
CATEGORIES = net
WANTLIB = c perl pthread curses m
@@ -13,12 +15,25 @@ PERMIT_PACKAGE_CDROM = Yes
NO_TEST = Yes
-RUN_DEPENDS = net/nagios/nagios>=3.0
CONFIGURE_STYLE = gnu
-CONFIGURE_ARGS = --with-nagios-data=3 \
- --with-etc-dir="${SYSCONFDIR}/cnagios" \
- --with-var-dir="/var/nagios" \
+CONFIGURE_ARGS += --with-nagios-data=3 \
+ --with-etc-dir="${SYSCONFDIR}/cnagios"
+
+FLAVORS = icinga
+FLAVOR ?=
+
+.if ${FLAVOR:Micinga}
+RUN_DEPENDS = net/icinga/core
+CONFIGURE_ARGS = --with-var-dir="/var/icinga" \
+ --with-nagios-data=3 \
+ --with-status-file="/var/icinga/status.dat"
+.else
+RUN_DEPENDS = net/nagios/nagios>=3.0
+CONFIGURE_ARGS = --with-var-dir="/var/nagios" \
+ --with-nagios-data=4 \
--with-status-file="/var/nagios/status.dat"
+.endif
+
MODGNU_CONFIG_GUESS_DIRS=${WRKSRC}/config
ALL_TARGET = cnagios
Index: distinfo
===================================================================
RCS file: /cvs/ports/net/nagios/cnagios/distinfo,v
retrieving revision 1.7
diff -u -p -r1.7 distinfo
--- distinfo 1 Apr 2013 18:26:00 -0000 1.7
+++ distinfo 28 Nov 2016 14:06:51 -0000
@@ -1,2 +1,2 @@
-SHA256 (cnagios-0.30.tar.gz) = oHd0oOs7RZGSplgQICTYdNH/dvnx9/6PIG7LADb/FDg=
-SIZE (cnagios-0.30.tar.gz) = 81813
+SHA256 (cnagios-0.33.tar.gz) = YLM89YK1cAWCAG3gVXDFsy4k2qnwQjXmG+TNSZ/CVhE=
+SIZE (cnagios-0.33.tar.gz) = 82080
Index: patches/patch-version_h
===================================================================
RCS file: patches/patch-version_h
diff -N patches/patch-version_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-version_h 28 Nov 2016 14:06:51 -0000
@@ -0,0 +1,10 @@
+$OpenBSD$
+
+Bump version.
+Upsatream commit 3bd27fb40e68f61ffd01bea6234b919a667b6fe4
+
+--- version.h.orig Mon Nov 28 16:11:54 2016
++++ version.h Mon Nov 28 16:12:08 2016
+@@ -1 +1 @@
+-#define VERSION "0.32"
++#define VERSION "0.33"
Index: pkg/DESCR
===================================================================
RCS file: /cvs/ports/net/nagios/cnagios/pkg/DESCR,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 DESCR
--- pkg/DESCR 5 Feb 2008 23:00:22 -0000 1.1.1.1
+++ pkg/DESCR 28 Nov 2016 14:06:51 -0000
@@ -1,4 +1,4 @@
-Cnagios is a full-screen terminal interface for viewing Nagios
+Cnagios is a full-screen terminal interface for viewing Nagios/Icinga
HOST and SERVICE objects, and the durations of their current states.
It's lightning fast because it's written in C using the curses