Import ports/net/icinga (with -I !, so the 'core' directory doesn't

become cvs-food). See the README file for information about migrating
from Nagios with minimal config changes.

The icinga-web API-backed user interface is a work in progress
and not yet linked to the build; the core program and classic web
interface are perfectly usable.

Comments/ok from pea@, thanks for testing!

-- -- --
Icinga monitors network resources such as servers, routers, switches,
applications and services and notifies administrators or responsible
persons. It's a fork of Nagios and supports its extensive pool of
monitoring plug-ins. Current status information, historical logs
and reports can all be accessed via a web browser.
-- -- --
This commit is contained in:
sthen 2011-03-28 14:06:06 +00:00
parent aecc5f034e
commit 3dff6b41f2
35 changed files with 15896 additions and 0 deletions

7
net/icinga/Makefile Normal file
View File

@ -0,0 +1,7 @@
# $OpenBSD: Makefile,v 1.1.1.1 2011/03/28 14:06:06 sthen Exp $
SUBDIR =
SUBDIR += core
# SUBDIR += web
.include <bsd.port.subdir.mk>

17
net/icinga/Makefile.inc Normal file
View File

@ -0,0 +1,17 @@
# $OpenBSD: Makefile.inc,v 1.1.1.1 2011/03/28 14:06:06 sthen Exp $
V = 1.3.0
CATEGORIES+= net net/icinga
HOMEPAGE?= http://www.icinga.org/
MAINTAINER?= Stuart Henderson <sthen@openbsd.org>
# GPLv2
PERMIT_PACKAGE_CDROM?= Yes
PERMIT_PACKAGE_FTP?= Yes
PERMIT_DISTFILES_CDROM?=Yes
PERMIT_DISTFILES_FTP?= Yes
MASTER_SITES?= ${MASTER_SITE_SOURCEFORGE:=icinga/}

82
net/icinga/core/Makefile Normal file
View File

@ -0,0 +1,82 @@
# $OpenBSD: Makefile,v 1.1.1.1 2011/03/28 14:06:08 sthen Exp $
COMMENT-main = network monitoring system (improved fork of Nagios)
COMMENT-cgi = cgi scripts for Icinga (classic Nagios-style UI)
COMMENT-ido = sotre Icinga configuration and events in a database
COMMENT-api = database-backed API for icinga
DISTNAME = icinga-$V
PKGNAME-main = icinga-$V
PKGNAME-cgi = icinga-cgi-$V
PKGNAME-ido = icinga-idoutils-$V
PKGNAME-api = icinga-api-$V
MULTI_PACKAGES = -main -cgi -api -ido
PREFIX-cgi = /var/www
PREFIX-api = /var/www
WANTLIB = c crypto m pthread ssl
RUN_DEPENDS = ${BASE_PKGPATH},-main
WANTLIB-main = ${WANTLIB} ltdl>=4 perl util
RUN_DEPENDS-main = net/nagios/plugins
LIB_DEPENDS-main = devel/libtool,-ltdl
WANTLIB-ido = ${WANTLIB} dbi
LIB_DEPENDS-ido = databases/libdbi
WANTLIB-api = # empty
RUN_DEPENDS-api = ${RUN_DEPENDS} \
${BASE_PKGPATH},-ido
# the cgi binaries are linked -static to simplify use in chroot,
# but listed as dependency anyway to help pkg_add -u find updates.
# these will show as "extra".
WANTLIB-cgi = c m gd jpeg png z
LIB_DEPENDS-cgi = graphics/gd
FAKE_FLAGS = CFGDIR=${TRUEPREFIX}/share/examples/icinga
CONFIGURE_STYLE = gnu
CONFIGURE_STYLE += old # don't override sysconfdir
CONFIGURE_ARGS += \
--sysconfdir=${SYSCONFDIR}/icinga \
--datarootdir=/var/www/icinga-cgi \
--libexecdir=${PREFIX}/libexec/nagios \
--localstatedir=/var/icinga \
--sbindir=/var/www/cgi-bin/icinga \
--with-command-group=www \
--with-cgiurl=/cgi-bin/icinga \
--with-checkresult-dir=/var/spool/icinga \
--with-htmurl=/icinga \
--with-httpd-conf=/var/www/conf/modules.sample \
--with-icinga-group=_icinga \
--with-icinga-user=_icinga \
--with-lockfile=/var/run/icinga/icinga.pid \
--enable-embedded-perl \
--enable-idoutils \
--enable-ssl
CFLAGS += -fPIC \
-I${LOCALBASE}/include \
-L${X11BASE}/lib -L${LOCALBASE}/lib
CFGDIR = ${SYSCONFDIR}/icinga
MAKE_FLAGS = CFGDIR=${CFGDIR} SYSCONFDIR=${CFGDIR}
INSTALL_TARGET = install-unstripped install-idoutils \
install-config install-webconf install-api
# perl tests work; C tests require --enable-libtap in configure and
# fixing up WRKSRC/tap/configure
REGRESS_TARGET = test
post-install:
${INSTALL_DATA_DIR} ${WRKINST}${PREFIX-cgi}/conf/modules.sample
mv ${WRKINST}${PREFIX-cgi}/icinga-cgi/icinga-api \
${WRKINST}${PREFIX-cgi}/icinga-api
cd ${WRKINST}${PREFIX-cgi}; \
mv conf/modules.sample/icinga.conf \
conf/modules.sample/icinga-cgi.conf.dist; \
chown -R ${SHAREOWN}:${SHAREGRP} icinga-api icinga-cgi conf
.include <bsd.port.mk>

5
net/icinga/core/distinfo Normal file
View File

@ -0,0 +1,5 @@
MD5 (icinga-1.3.0.tar.gz) = 9rl4Z/yj5dlmGMdGgAJJhw==
RMD160 (icinga-1.3.0.tar.gz) = K2hcLlumJz2RfVtMs+IjUBhLdSw=
SHA1 (icinga-1.3.0.tar.gz) = 5szk5tTIbgVuUzGQDa6ImCc9x+E=
SHA256 (icinga-1.3.0.tar.gz) = 7sO2/8x72sfITQjWvI2JnKPM/UDwY/D9wPteOG7ghvQ=
SIZE (icinga-1.3.0.tar.gz) = 12084804

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-base_Makefile_in,v 1.1.1.1 2011/03/28 14:06:08 sthen Exp $
--- base/Makefile.in.orig Tue Feb 15 13:28:41 2011
+++ base/Makefile.in Thu Mar 24 11:22:48 2011
@@ -206,8 +206,8 @@ install-unstripped:
install-basic:
$(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(BINDIR)
- $(INSTALL) -m 774 $(INSTALL_OPTS) @icinga_name@ $(DESTDIR)$(BINDIR)
- $(INSTALL) -m 774 $(INSTALL_OPTS) @icingastats_name@ $(DESTDIR)$(BINDIR)
+ $(BSD_INSTALL_PROGRAM) @icinga_name@ $(DESTDIR)$(BINDIR)
+ $(BSD_INSTALL_PROGRAM) @icingastats_name@ $(DESTDIR)$(BINDIR)
strip-post-install:
$(STRIP) $(DESTDIR)$(BINDIR)/@icinga_name@

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-cgi_Makefile_in,v 1.1.1.1 2011/03/28 14:06:08 sthen Exp $
Allows for simpler use in a chroot jail
--- cgi/Makefile.in.orig Sat Mar 19 11:50:20 2011
+++ cgi/Makefile.in Sat Mar 19 11:50:29 2011
@@ -34,7 +34,7 @@ CFLAGS=@CFLAGS@ @DEFS@ -DNSCGI
#CFLAGS_DEBUG=-ggdb3 -g3
#CFLAGS+=$(CFLAGS_WARN) $(CFLAGS_DEBUG)
-LDFLAGS=@LDFLAGS@
+LDFLAGS=-static @LDFLAGS@
LIBS=@LIBS@
CGIS=avail.cgi cmd.cgi config.cgi extinfo.cgi history.cgi notifications.cgi outages.cgi showlog.cgi status.cgi statuswml.cgi summary.cgi tac.cgi $(CGIEXTRAS)

View File

@ -0,0 +1,74 @@
$OpenBSD: patch-configure,v 1.1.1.1 2011/03/28 14:06:08 sthen Exp $
--- configure.orig Tue Feb 15 13:28:41 2011
+++ configure Fri Mar 25 08:32:55 2011
@@ -4774,13 +4774,13 @@ if test $ac_cv_lib_cma_pthread_create = yes; then
have_pthreads="yes"
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
-$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -pthread" >&5
+$as_echo_n "checking for pthread_create in -pthread... " >&6; }
if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread $LIBS"
+LIBS="-pthread $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -4811,7 +4811,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then :
- THREADLIBS="$THREADLIBS -lpthread"
+ THREADLIBS="$THREADLIBS -pthread"
fi
if test $ac_cv_lib_pthread_pthread_create = yes; then
@@ -5102,7 +5102,7 @@ cat >>confdefs.h <<_ACEOF
#define DEFAULT_NAGIOS_GROUP "$icinga_grp"
_ACEOF
-INSTALL_OPTS="-o $icinga_user -g $icinga_grp"
+INSTALL_OPTS=""
@@ -5123,7 +5123,7 @@ fi
-COMMAND_OPTS="-o $command_user -g $command_grp"
+COMMAND_OPTS=""
MAIL_PROG=no
@@ -5456,7 +5456,7 @@ $as_echo_n "checking for gdImagePng in -lgd (order 1).
$as_echo_n "(cached) " >&6
else
ac_save_LIBS="$LIBS"
- LIBS="-lgd -lttf -lpng -ljpeg -lz -lm $LIBS"
+ LIBS="-lgd -lpng -ljpeg -lz -lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
@@ -5487,7 +5487,7 @@ fi
$as_echo "yes" >&6; }
GDLIBFOUND=yep
- GDLIBS="-lgd -lttf -lpng -ljpeg -lz -lm"
+ GDLIBS="-lgd -lpng -ljpeg -lz -lm"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -6725,7 +6725,7 @@ $as_echo_n "checking for SSL libraries... " >&6; }
found_ssl=no
for dir in $ssl_lib_dir $ssl_dir /usr/lib64 /usr/lib /usr/local/lib /usr/lib/ssl /usr/ssl/lib /usr/openssl/lib /usr/pkg/lib /usr/freeware/lib/openssl; do
ssllibdir="$dir"
- if test -f "$dir/libssl.so"; then
+ if test -f "$dir/libssl.a"; then
found_ssl=yes
break
fi

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-module_icinga-api_Makefile_in,v 1.1.1.1 2011/03/28 14:06:08 sthen Exp $
Otherwise it tries to install the API owned by _icinga:_icinga,
possibly before the user was created by pkg_add.
--- module/icinga-api/Makefile.in.orig Thu Mar 24 12:59:25 2011
+++ module/icinga-api/Makefile.in Thu Mar 24 13:00:46 2011
@@ -10,7 +10,7 @@ BINDIR=@bindir@
CGIDIR=@sbindir@
HTMLDIR=@datarootdir@
INSTALL=@INSTALL@
-INSTALL_OPTS=@INSTALL_OPTS@
+#INSTALL_OPTS=@INSTALL_OPTS@
COMMAND_OPTS=@COMMAND_OPTS@
INSTALL_OPTS_WEB=@INSTALL_OPTS_WEB@
WEB_USER=@web_user@

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-module_idoutils_src_Makefile_in,v 1.1.1.1 2011/03/28 14:06:08 sthen Exp $
--- module/idoutils/src/Makefile.in.orig Tue Mar 22 17:53:51 2011
+++ module/idoutils/src/Makefile.in Tue Mar 22 17:54:14 2011
@@ -97,7 +97,7 @@ devclean: distclean
install:
$(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(BINDIR)
- $(INSTALL) -m 774 $(INSTALL_OPTS) ido2db $(DESTDIR)$(BINDIR)
- $(INSTALL) -m 774 $(INSTALL_OPTS) log2ido $(DESTDIR)$(BINDIR)
- $(INSTALL) -m 774 $(INSTALL_OPTS) idomod.o $(DESTDIR)$(BINDIR)
+ $(BSD_INSTALL_PROGRAM) ido2db $(DESTDIR)$(BINDIR)
+ $(BSD_INSTALL_PROGRAM) log2ido $(DESTDIR)$(BINDIR)
+ $(BSD_INSTALL_PROGRAM) idomod.o $(DESTDIR)$(BINDIR)

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-sample-config_cgi_cfg_in,v 1.1.1.1 2011/03/28 14:06:08 sthen Exp $
--- sample-config/cgi.cfg.in.orig Thu Mar 24 13:14:16 2011
+++ sample-config/cgi.cfg.in Thu Mar 24 13:16:20 2011
@@ -294,7 +294,10 @@ default_statuswrl_layout=4
# OS and distribution, so you may have to tweak this to
# work on your system.
-ping_syntax=/bin/ping -n -U -c 5 $HOSTADDRESS$
+# For chroot, use /bin/ping and chroot 4555 /var/www/bin/ping.
+# Only needed for WML interface.
+#ping_syntax=/bin/ping -n -c 5 $HOSTADDRESS$
+ping_syntax=/sbin/ping -n -c 5 $HOSTADDRESS$

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-sample-config_icinga_cfg_in,v 1.1.1.1 2011/03/28 14:06:08 sthen Exp $
--- sample-config/icinga.cfg.in.orig Tue Feb 15 13:28:41 2011
+++ sample-config/icinga.cfg.in Sun Mar 20 21:22:10 2011
@@ -14,7 +14,7 @@
# for historical purposes. This should be the first option specified
# in the config file!!!
-log_file=@localstatedir@/icinga.log
+log_file=/var/log/icinga/icinga.log
@@ -1292,8 +1292,8 @@ use_true_regexp_matching=0
# using the $ADMINEMAIL$ and $ADMINPAGER$ macros in your notification
# commands.
-admin_email=@icinga_user@@localhost
-admin_pager=page@icinga_user@@localhost
+admin_email=root@localhost
+admin_pager=root@localhost

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-sample-config_template-object_contacts_cfg_in,v 1.1.1.1 2011/03/28 14:06:08 sthen Exp $
--- sample-config/template-object/contacts.cfg.in.orig Sun Mar 20 21:20:46 2011
+++ sample-config/template-object/contacts.cfg.in Sun Mar 20 21:22:20 2011
@@ -30,7 +30,7 @@ define contact{
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Icinga Admin ; Full name of user
- email @icinga_user@@localhost ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
+ email root@localhost ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}

View File

@ -0,0 +1 @@
This package contains the PHP-based API for icinga.

View File

@ -0,0 +1,2 @@
This package contains CGIs and webpages for Icinga's legacy web frontend.
The modern API-based frontend is also available in the icinga-web package.

View File

@ -0,0 +1,5 @@
This package contains the IDOUtils add-on for Icinga. It is designed
to store all configuration and event data from Icinga in a relational
database. Storing information from Icinga in an RDBMS will allow
for quicker retrieval and processing of that data. The Icinga-API
relies on that data.

View File

@ -0,0 +1,5 @@
Icinga monitors network resources such as servers, routers, switches,
applications and services and notifies administrators or responsible
persons. It's a fork of Nagios and supports its extensive pool of
monitoring plug-ins. Current status information, historical logs
and reports can all be accessed via a web browser.

View File

@ -0,0 +1,85 @@
@comment $OpenBSD: PLIST-api,v 1.1.1.1 2011/03/28 14:06:08 sthen Exp $
icinga-api/
icinga-api/IcingaApi.php
icinga-api/contrib/
icinga-api/contrib/ido2dbparser/
icinga-api/contrib/ido2dbparser/Ido2dbParser.php
@group www
icinga-api/log/
@comment icinga-api/log/PLACEHOLDER
@group
icinga-api/objects/
icinga-api/objects/IcingaApiConstantsInterface.php
icinga-api/objects/command/
icinga-api/objects/command/IcingaApiCommand.php
icinga-api/objects/command/IcingaApiCommandCollection.php
icinga-api/objects/command/IcingaApiCommandDispatcher.php
icinga-api/objects/command/IcingaApiCommandInterface.php
icinga-api/objects/command/IcingaApiCommandSend.php
icinga-api/objects/command/IcingaApiCommandSendPipe.php
icinga-api/objects/command/IcingaApiCommandSendSsh.php
icinga-api/objects/connection/
icinga-api/objects/connection/IcingaApiConnection.php
icinga-api/objects/connection/IcingaApiConnectionDatabase.php
icinga-api/objects/connection/IcingaApiConnectionFile.php
icinga-api/objects/connection/IcingaApiConnectionIdo.php
icinga-api/objects/connection/IcingaApiConnectionInterface.php
icinga-api/objects/connection/IcingaApiConnectionLivestatus.php
icinga-api/objects/conversion/
icinga-api/objects/conversion/IcingaApiConversionTime.php
icinga-api/objects/debug/
icinga-api/objects/debug/debugTargets/
icinga-api/objects/debug/debugTargets/icingaApiDebuggerTargetInterface.php
icinga-api/objects/debug/debugTargets/icingaApiEchoDebugger.php
icinga-api/objects/debug/debugTargets/icingaApiFileDebugger.php
icinga-api/objects/debug/icingaApiDebugger.php
icinga-api/objects/ociPDO/
icinga-api/objects/ociPDO/PDO/
icinga-api/objects/ociPDO/PDO/ociPDO.php
icinga-api/objects/ociPDO/PDO/ociPDOStatement.php
icinga-api/objects/ociPDO/icingaApiPDO.php
icinga-api/objects/result/
icinga-api/objects/result/IcingaApiResult.php
icinga-api/objects/result/IcingaApiResultFile.php
icinga-api/objects/result/IcingaApiResultIdo.php
icinga-api/objects/result/IcingaApiResultInterface.php
icinga-api/objects/result/IcingaApiResultLivestatus.php
icinga-api/objects/search/
icinga-api/objects/search/IcingaApiSearch.php
icinga-api/objects/search/IcingaApiSearchColumnsFile.php
icinga-api/objects/search/IcingaApiSearchFile.php
icinga-api/objects/search/IcingaApiSearchIdo.php
icinga-api/objects/search/IcingaApiSearchInterface.php
icinga-api/objects/search/IcingaApiSearchLivestatus.php
icinga-api/objects/search/data_interfaces/
icinga-api/objects/search/data_interfaces/IcingaApiSearchIdoInterface.php
icinga-api/objects/search/data_interfaces/IcingaApiSearchIdoMysql.php
icinga-api/objects/search/data_interfaces/IcingaApiSearchIdoOci.php
icinga-api/objects/search/data_interfaces/IcingaApiSearchIdoOci8.php
icinga-api/objects/search/data_interfaces/IcingaApiSearchIdoPgsql.php
icinga-api/objects/search/data_interfaces/IcingaApiSearchLivestatusSocket.php
icinga-api/objects/search/filter/
icinga-api/objects/search/filter/IcingaApiSearchFilter.php
icinga-api/objects/search/filter/IcingaApiSearchFilterGroup.php
icinga-api/objects/search/filter/IcingaApiSearchFilterGroupIdo.php
icinga-api/objects/search/filter/IcingaApiSearchFilterIdo.php
icinga-api/objects/search/filter/IcingaApiSearchFilterInterface.php
icinga-api/tests/
icinga-api/tests/icingaApiTests.php
icinga-api/tests/idoTests/
icinga-api/tests/idoTests/apiSearchDefinitions/
icinga-api/tests/idoTests/apiSearchDefinitions/custom.ini
icinga-api/tests/idoTests/apiSearchDefinitions/icinga-web.ini
icinga-api/tests/idoTests/apiSearchDefinitions/objectsearch.ini
icinga-api/tests/idoTests/dbConfig.php
icinga-api/tests/idoTests/idoConnectionTest.php
icinga-api/tests/idoTests/idoCreateSearchTest.php
icinga-api/tests/idoTests/testDatabases/
icinga-api/tests/idoTests/testDatabases/mysql_delete.sql
icinga-api/tests/idoTests/testDatabases/mysql_dump.sql
icinga-api/tests/idoTests/testDatabases/mysql_schema.sql
icinga-api/tests/idoTests/testDatabases/oci8_delete.sql
icinga-api/tests/idoTests/testDatabases/oci8_schema.sql
icinga-api/tests/idoTests/testDatabases/oracle_dump.sql
icinga-api/tests/idoTests/testDatabases/pgsql.sql
icinga-api/tests/idoTests/testSuite.php

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
@comment $OpenBSD: PLIST-ido,v 1.1.1.1 2011/03/28 14:06:08 sthen Exp $
@bin bin/ido2db
@bin bin/idomod.o
@bin bin/log2ido
share/examples/icinga/ido2db.cfg-sample
@sample ${SYSCONFDIR}/icinga/ido2db.cfg
share/examples/icinga/idomod.cfg-sample

View File

@ -0,0 +1,50 @@
@comment $OpenBSD: PLIST-main,v 1.1.1.1 2011/03/28 14:06:08 sthen Exp $
@newgroup _icinga:667
@newuser _icinga:667:_icinga:daemon:Icinga user:/var/www/icinga:/sbin/nologin
@bin bin/icinga
@bin bin/icingastats
bin/p1.pl
share/doc/pkg-readmes/${FULLPKGNAME}
share/examples/icinga/
@sample ${SYSCONFDIR}/icinga/
share/examples/icinga/cgi.cfg
@sample ${SYSCONFDIR}/icinga/cgi.cfg
share/examples/icinga/cgiauth.cfg
@sample ${SYSCONFDIR}/icinga/cgiauth.cfg
share/examples/icinga/icinga.cfg
@sample ${SYSCONFDIR}/icinga/icinga.cfg
share/examples/icinga/objects/
@sample ${SYSCONFDIR}/icinga/objects/
share/examples/icinga/objects/commands.cfg
@sample ${SYSCONFDIR}/icinga/objects/commands.cfg
share/examples/icinga/objects/contacts.cfg
@sample ${SYSCONFDIR}/icinga/objects/contacts.cfg
share/examples/icinga/objects/localhost.cfg
@sample ${SYSCONFDIR}/icinga/objects/localhost.cfg
share/examples/icinga/objects/printer.cfg
@sample ${SYSCONFDIR}/icinga/objects/printer.cfg
share/examples/icinga/objects/switch.cfg
@sample ${SYSCONFDIR}/icinga/objects/switch.cfg
share/examples/icinga/objects/templates.cfg
@sample ${SYSCONFDIR}/icinga/objects/templates.cfg
share/examples/icinga/objects/timeperiods.cfg
@sample ${SYSCONFDIR}/icinga/objects/timeperiods.cfg
share/examples/icinga/objects/windows.cfg
@sample ${SYSCONFDIR}/icinga/objects/windows.cfg
share/examples/icinga/resource.cfg
@sample ${SYSCONFDIR}/icinga/resource.cfg
@mode 755
@owner _icinga
@group _icinga
@sample /var/icinga/
@sample /var/icinga/archives/
@sample /var/log/icinga/
@sample /var/spool/icinga/
@mode 775
@group www
@sample /var/icinga/rw/
@extraunexec rm -f ${SYSCONFDIR}/icinga/*
@extraunexec rm -f /var/icinga
@owner
@group
@rcscript ${RCDIR}/icinga

View File

@ -0,0 +1,78 @@
$OpenBSD: README-main,v 1.1.1.1 2011/03/28 14:06:08 sthen Exp $
Running ICINGA on OpenBSD
=========================
Getting Started
---------------
The main documentation for Icinga is provided in HTML format as part of
the icinga-cgi package, see /var/www/icinga-cgi/docs/en/index.html
The included sample configuration carries out some simple checks
on the local machine; these should work as-is.
You may check your configuration file format before starting Icinga:
/usr/local/bin/icinga -v ${SYSCONFDIR}/icinga/icinga.cfg
This will parse all configuration files and warn about any problems
which have been identified.
Chroot Considerations
---------------------
If using OpenBSD's default chroot environment for httpd, some files
will need to be moved inside the jail and symbolic links created:
mkdir -p /var/www/etc /var/www/var/log
mv ${SYSCONFDIR}/icinga /var/www/etc/
ln -s /var/www/etc/icinga ${SYSCONFDIR}
mv /var/icinga /var/www/var/
ln -s /var/www/var/icinga /var
mv /var/log/icinga /var/www/var/log/
ln -s /var/www/var/log/icinga /var/log
Web User-Interfaces
-------------------
Two web-based user interfaces are available for Icinga:
- icinga-cga: the classic (but improved) Nagios-style interface
- icinga-web: new API-based interface
At the time of writing, porting and packaging of icinga-web is
a work-in-progress. To enable icinga-cgi, link the provided httpd.conf
snippet:
ln -s ../modules.sample/icinga-cgi.conf /var/www/conf/modules
You may wish to modify this file. By default it uses HTTP basic
authentication; you can create the password file as follows:
touch ${SYSCONFDIR}/icinga/htpasswd.users
htpasswd ${SYSCONFDIR}/icinga/htpasswd.users <username>
When done, restart the web server:
apachectl stop
apachectl start
You should then be able to access the web interface at
http://localhost/icinga/
Moving from Nagios
------------------
The configuration format is compatible with Nagios. If you'd like
to move across with minimal changes, you can point Icinga at your
existing configuration files:
echo 'icinga_flags="-d ${SYSCONFDIR}/nagios/nagios.cfg"' >> /etc/rc.conf.local
echo 'rc_scripts="${rc_scripts} icinga' >> /etc/rc.conf.local
You will need to merge the settings between Nagios' and Icinga's
cgi.cfg files. sdiff(1), as used by sysmerge(8), can help with this.
main_config_file and some other settings (admin usernames etc) should
be taken from the Nagios file, whereas the various web-related settings
(url_html_path, physical_html_path, etc) need to point to the Icinga files.

View File

@ -0,0 +1,14 @@
#!/bin/sh
#
# $OpenBSD: icinga.rc,v 1.1.1.1 2011/03/28 14:06:08 sthen Exp $
daemon="${TRUEPREFIX}/bin/icinga"
daemon_flags="-d ${SYSCONFDIR}/icinga/icinga.cfg"
. /etc/rc.d/rc.subr
rc_pre() {
install -d -o _icinga /var/run/icinga
}
rc_cmd $1

9
net/icinga/web/.todo Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0"?>
<todo version="0.1.20">
<note priority="medium" time="1300668945">
modules.sample
</note>
<note priority="medium" time="1300713689">
cronjob: * * * * * %%USER%% php %%PATH%%/lib/icingaScheduler/icingaCron.php --useAgavi --exec &gt;&gt; /var/log/icingaCron/error.log
</note>
</todo>

96
net/icinga/web/Makefile Normal file
View File

@ -0,0 +1,96 @@
# $OpenBSD: Makefile,v 1.1.1.1 2011/03/28 14:06:06 sthen Exp $
COMMENT= web UI for icinga
DISTNAME= icinga-web-$V
BUILD_DEPENDS= net/icinga/core,-api
RUN_DEPENDS= www/pear \
www/php5/core \
www/php5/extensions,-ldap \
www/php5/extensions,-pdo_mysql \
www/php5/extensions,-xsl \
net/icinga/core,-api
# is icinga-api RUN_DEPENDS or not?
# pdo_mysql | pdo_pgsql
#Optional php extension
# 16/23 Test php5-soap ... (Extension soap does not exist) FAIL
# 17/23 Test php5-xmlrpc ... (Extension xmlrpc does not exist) FAIL
# 18/23 Test php5-iconv ... (iconv found) OK
# 19/23 Test php5-gd ... (Extension gd does not exist) FAIL
# 20/23 Test php5-ctype ... (ctype found) OK
# 21/23 Test php5-json ... (json found v1.2.1) OK
# 22/23 Test php5-hash ... (hash found v1.0) OK
# 23/23 Test php.ini memory_limit ... (memory_limit='134217728') OK
#MODULES= devel/gettext
MAKE_FLAGS= PREFIX=/var/www/icinga-web
FAKE_FLAGS= CFGDIR=${TRUEPREFIX}/share/examples/icinga
USE_X11= Yes
CONFIGURE_STYLE=gnu
# XXX some of this is probably crap copied from nagios or icinga/core
CONFIGURE_ARGS+=--datarootdir=/var/www \
--with-icinga-api=/var/www/icinga-api \
--localstatedir=/var/icinga \
--sbindir=/var/www/cgi-bin/icinga \
--with-web-apache-path=/var/www/conf/modules.sample \
--with-api-cmd-file=/var/icinga/rw/icinga.cmd \
--with-web-user=www \
--with-web-group=www \
--with-bin-user=${SHAREOWN} \
--with-bin-group=${SHAREGRP}
# --with-web-absolute-path=/var/www/icinga-web
# --with-db-type=DBTYPE Type of dbms (default mysql)
# --with-db-host=HOST Host of dbms (default localhost)
# --with-db-port=PORT Port of the dbms (default 3306)
# --with-db-name=DBNAME DB name for icinga (default icinga_web)
# --with-db-user=USER DB user for icinga (default icinga_web)
# --with-db-pass=PASS DB pass for icinga (default icinga_web)
## --with-db-socket=SOCKET DB path to unix socket (default /tmp/mysql.sock)
# --with-api-type=APICON API type (default CONNECTION_IDO)
# --with-api-subtype=TYPE DB driver or network connection
# --with-api-cmd-file=PATH Icinga command file (default /usr/local/icinga/var/rw/icinga.cmd)
NO_REGRESS= Yes
NO_BUILD= Yes
CFLAGS+= -fPIC \
-I${LOCALBASE}/include \
-L${X11BASE}/lib -L${LOCALBASE}/lib
#LDFLAGS=
#ALL_TARGET=
INSTALL_TARGET= install install-apache-config
# or install-javascript instead of install-apache-config?
PREFIX= /var/www
#REGRESS_TARGET=
#pre-configure:
# @perl -pi -e 's, /etc/, ${SYSCONFDIR}/,' \
# ${WRKSRC}/sample-config/httpd.conf
pre-install:
${INSTALL_DATA_DIR} ${WRKINST}/var/www/icinga-web
${INSTALL_DATA_DIR} ${WRKINST}/var/www/conf/modules.sample
post-install:
find ${WRKINST} -name '*.orig' -print0 | xargs -0r rm
cd ${PREFIX}; mv app bin doc etc lib pub icinga-web/ ; \
mv conf/modules.sample/icinga-web.conf \
conf/modules.sample/icinga-web.conf.dist
find ${PREFIX} -name '*.site.xml' -exec mv {} {}.dist \;
${INSTALL_DATA_DIR} ${WRKINST}/var/www/icinga-web/etc/schema/updates
cd ${WRKSRC}/etc/schema; \
${INSTALL_DATA} *sql ${WRKINST}/var/www/icinga-web/etc/schema; \
${INSTALL_DATA} updates/*sql \
${WRKINST}/var/www/icinga-web/etc/schema/updates
.include <bsd.port.mk>

5
net/icinga/web/distinfo Normal file
View File

@ -0,0 +1,5 @@
MD5 (icinga-web-1.3.0.tar.gz) = Zt6EkFBohg37oDtDzX8TAA==
RMD160 (icinga-web-1.3.0.tar.gz) = 1RhzM+T7yheXV636GfQNcnvMgn8=
SHA1 (icinga-web-1.3.0.tar.gz) = twhsnN+7tfk1np6XWh/06jK+o50=
SHA256 (icinga-web-1.3.0.tar.gz) = fz0EF/FNjde7cnJU7FB34PmVUPwAyjtY6EnJKPyjBUs=
SIZE (icinga-web-1.3.0.tar.gz) = 21419137

View File

@ -0,0 +1,33 @@
$OpenBSD: patch-app_Makefile_in,v 1.1.1.1 2011/03/28 14:06:06 sthen Exp $
--- app/Makefile.in.orig Sun Mar 20 21:41:34 2011
+++ app/Makefile.in Sun Mar 20 21:41:45 2011
@@ -13,21 +13,21 @@ INSTALL_OPTS_CACHE=@INSTALL_OPTS_CACHE@
install: installdirs
find . -mindepth 1 -type f \
- -not -name "*.in" \
- -and -not -name "Makefile" \
- -and -not -path "./cache/*" \
- -and -not -path "*/data/log*" \
+ \! -name "*.in" \
+ -and \! -name "Makefile" \
+ -and \! -path "./cache/*" \
+ -and \! -path "*/data/log*" \
-exec $(INSTALL) -m 644 $(INSTALL_OPTS) {} $(DESTDIR)$(prefix)/app/{} \;
installdirs:
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/app
find . -mindepth 1 -type d \
- -not -path "./cache/*" \
- -and -not -path "*/data/log*" \
+ \! -path "./cache/*" \
+ -and \! -path "*/data/log*" \
-exec $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/app/{} \;
$(INSTALL) -m 755 $(INSTALL_OPTS_CACHE) -d $(DESTDIR)$(prefix)/app/cache
$(INSTALL) -m 755 $(INSTALL_OPTS_CACHE) -d $(DESTDIR)$(prefix)/app/cache/config
- $(INSTALL) -m 755 $(INSTALL_OPTS_WEB) -d $(DESTDIR)$(prefix)/app/data/log
\ No newline at end of file
+ $(INSTALL) -m 755 $(INSTALL_OPTS_WEB) -d $(DESTDIR)$(prefix)/app/data/log

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-bin_Makefile_in,v 1.1.1.1 2011/03/28 14:06:06 sthen Exp $
--- bin/Makefile.in.orig Sun Mar 20 21:41:34 2011
+++ bin/Makefile.in Sun Mar 20 21:41:49 2011
@@ -10,9 +10,9 @@ INSTALL=@INSTALL@
INSTALL_OPTS=@INSTALL_OPTS@
install: installdirs
- find . -mindepth 1 -type f -not -name "*.in" -and -not -name "Makefile" -exec $(INSTALL) -m 775 $(INSTALL_OPTS) {} $(DESTDIR)$(prefix)/bin/{} \;
+ find . -mindepth 1 -type f \! -name "*.in" -and \! -name "Makefile" -exec $(INSTALL) -m 775 $(INSTALL_OPTS) {} $(DESTDIR)$(prefix)/bin/{} \;
installdirs:
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/bin
find . -mindepth 1 -type d -exec $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/bin/{} \;
-
\ No newline at end of file
+

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-doc_Makefile_in,v 1.1.1.1 2011/03/28 14:06:06 sthen Exp $
--- doc/Makefile.in.orig Sun Mar 20 21:41:34 2011
+++ doc/Makefile.in Sun Mar 20 21:41:51 2011
@@ -10,9 +10,9 @@ INSTALL=@INSTALL@
INSTALL_OPTS=@INSTALL_OPTS@
install: installdirs
- find . -mindepth 1 -type f -not -name "*.in" -and -not -name "Makefile" -exec $(INSTALL) -m 644 $(INSTALL_OPTS) {} $(DESTDIR)$(prefix)/doc/{} \;
+ find . -mindepth 1 -type f \! -name "*.in" -and \! -name "Makefile" -exec $(INSTALL) -m 644 $(INSTALL_OPTS) {} $(DESTDIR)$(prefix)/doc/{} \;
installdirs:
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/doc
find . -mindepth 1 -type d -exec $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/doc/{} \;
-
\ No newline at end of file
+

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-etc_Makefile_in,v 1.1.1.1 2011/03/28 14:06:06 sthen Exp $
--- etc/Makefile.in.orig Sun Mar 20 21:41:34 2011
+++ etc/Makefile.in Sun Mar 20 21:41:55 2011
@@ -10,9 +10,9 @@ INSTALL=@INSTALL@
INSTALL_OPTS=@INSTALL_OPTS@
install: installdirs
- find . -mindepth 1 -maxdepth 1 -type f -not -name "*.in" -and -not -name "Makefile" -exec $(INSTALL) -m 644 $(INSTALL_OPTS) {} $(DESTDIR)$(prefix)/etc/{} \;
- find lib/ -mindepth 1 -type f -not -name "*.in" -and -not -name "Makefile" -exec $(INSTALL) -m 644 $(INSTALL_OPTS) {} $(DESTDIR)$(prefix)/etc/{} \;
- find tests/ -mindepth 1 -type f -not -name "*.in" -and -not -name "Makefile" -exec $(INSTALL) -m 644 $(INSTALL_OPTS) {} $(DESTDIR)$(prefix)/etc/{} \;
+ find . -mindepth 1 -maxdepth 1 -type f \! -name "*.in" -and \! -name "Makefile" -exec $(INSTALL) -m 644 $(INSTALL_OPTS) {} $(DESTDIR)$(prefix)/etc/{} \;
+ find lib/ -mindepth 1 -type f \! -name "*.in" -and \! -name "Makefile" -exec $(INSTALL) -m 644 $(INSTALL_OPTS) {} $(DESTDIR)$(prefix)/etc/{} \;
+ find tests/ -mindepth 1 -type f \! -name "*.in" -and \! -name "Makefile" -exec $(INSTALL) -m 644 $(INSTALL_OPTS) {} $(DESTDIR)$(prefix)/etc/{} \;
installdirs:
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/etc
@@ -20,4 +20,4 @@ installdirs:
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/etc/tests
find lib/ -mindepth 1 -type d -exec $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/etc/{} \;
find tests/ -mindepth 1 -type d -exec $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/etc/{} \;
-
\ No newline at end of file
+

View File

@ -0,0 +1,26 @@
$OpenBSD: patch-etc_apache2_icinga-web_conf_in,v 1.1.1.1 2011/03/28 14:06:06 sthen Exp $
--- etc/apache2/icinga-web.conf.in.orig Mon Mar 21 00:22:52 2011
+++ etc/apache2/icinga-web.conf.in Mon Mar 21 00:23:22 2011
@@ -4,15 +4,18 @@
# - Add extjs library to alias
#
-Alias @web_path@/js/ext3 @prefix@/lib/ext3
-Alias @web_path@ @prefix@/pub
+<IfModule !mod_rewrite.c>
+LoadModule rewrite_module /usr/lib/apache/modules/mod_rewrite.so
+</IfModule>
+Alias @web_path@/js/ext3 @prefix@/icinga-web/lib/ext3
+Alias @web_path@ @prefix@/icinga-web/pub
-<Directory @prefix@/lib/ext3>
+<Directory @prefix@/icinga-web/lib/ext3>
Order allow,deny
Allow from all
</Directory>
-<Directory @prefix@/pub>
+<Directory @prefix@/icinga-web/pub>
DirectoryIndex index.php
Options FollowSymLinks
AllowOverride all

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-lib_Makefile_in,v 1.1.1.1 2011/03/28 14:06:06 sthen Exp $
--- lib/Makefile.in.orig Sun Mar 20 21:41:34 2011
+++ lib/Makefile.in Sun Mar 20 21:41:57 2011
@@ -10,9 +10,9 @@ INSTALL=@INSTALL@
INSTALL_OPTS=@INSTALL_OPTS@
install: installdirs
- find . -mindepth 1 -type f -not -name "*.in" -and -not -name "Makefile" -exec $(INSTALL) -m 644 $(INSTALL_OPTS) {} $(DESTDIR)$(prefix)/lib/{} \;
+ find . -mindepth 1 -type f \! -name "*.in" -and \! -name "Makefile" -exec $(INSTALL) -m 644 $(INSTALL_OPTS) {} $(DESTDIR)$(prefix)/lib/{} \;
installdirs:
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/lib
find . -mindepth 1 -type d -exec $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/lib/{} \;
-
\ No newline at end of file
+

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-pub_Makefile_in,v 1.1.1.1 2011/03/28 14:06:06 sthen Exp $
--- pub/Makefile.in.orig Sun Mar 20 21:41:34 2011
+++ pub/Makefile.in Sun Mar 20 21:42:00 2011
@@ -10,9 +10,9 @@ INSTALL=@INSTALL@
INSTALL_OPTS=@INSTALL_OPTS@
install: installdirs
- find . -mindepth 1 -type f -not -name "*.in" -and -not -name "Makefile" -exec $(INSTALL) -m 644 $(INSTALL_OPTS) {} $(DESTDIR)$(prefix)/pub/{} \;
+ find . -mindepth 1 -type f \! -name "*.in" -and \! -name "Makefile" -exec $(INSTALL) -m 644 $(INSTALL_OPTS) {} $(DESTDIR)$(prefix)/pub/{} \;
installdirs:
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/pub
find . -mindepth 1 -type d -exec $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/pub/{} \;
-
\ No newline at end of file
+

2
net/icinga/web/pkg/DESCR Normal file
View File

@ -0,0 +1,2 @@
This package contains Icinga's modern API-based web frontend.
The legacy frontend is also available in the icinga-cgi package.

13982
net/icinga/web/pkg/PLIST Normal file

File diff suppressed because it is too large Load Diff

18
net/icinga/web/pkg/README Normal file
View File

@ -0,0 +1,18 @@
$OpenBSD: README,v 1.1.1.1 2011/03/28 14:06:08 sthen Exp $
SQL> GRANT USAGE ON *.* TO 'icinga_web'@'localhost' IDENTIFIED BY 'icinga_web';
SQL> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, INDEX ON icinga_web.* TO 'icinga_web'@'localhost';
SQL> FLUSH PRIVILEGES;
app/config/databases.xml
Change the credentials for your database connection
app/modules/Web/config/module.xml
Go to the appkit.factories section and change the path and the
credentials for the icinga-api
default
User: root
Pass: password