aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net-mgmt/Makefile1
-rw-r--r--net-mgmt/icinga2/Makefile92
-rw-r--r--net-mgmt/icinga2/distinfo2
-rw-r--r--net-mgmt/icinga2/files/icinga2.in107
-rw-r--r--net-mgmt/icinga2/files/patch-CMakeLists.txt12
-rw-r--r--net-mgmt/icinga2/files/patch-components__CMakeLists.txt19
-rw-r--r--net-mgmt/icinga2/files/patch-components__db_ido_mysql__CMakeLists.txt9
-rw-r--r--net-mgmt/icinga2/files/patch-components__db_ido_pgsql__CMakeLists.txt9
-rw-r--r--net-mgmt/icinga2/pkg-descr13
-rw-r--r--net-mgmt/icinga2/pkg-plist128
10 files changed, 392 insertions, 0 deletions
diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile
index d4bc806ab725..41be1790cb19 100644
--- a/net-mgmt/Makefile
+++ b/net-mgmt/Makefile
@@ -83,6 +83,7 @@
SUBDIR += hawk
SUBDIR += horde3-nic
SUBDIR += icinga
+ SUBDIR += icinga2
SUBDIR += icli
SUBDIR += icmpmonitor
SUBDIR += icmpquery
diff --git a/net-mgmt/icinga2/Makefile b/net-mgmt/icinga2/Makefile
new file mode 100644
index 000000000000..cb9bcc1aa089
--- /dev/null
+++ b/net-mgmt/icinga2/Makefile
@@ -0,0 +1,92 @@
+# $FreeBSD$
+
+PORTNAME= icinga2
+DISTVERSION= 2.0.0
+CATEGORIES= net-mgmt
+MASTER_SITES= http://github.com/Icinga/${PORTNAME}/archive/v${DISTVERSION}.tar.gz?dummy=/
+
+MAINTAINER= lme@FreeBSD.org
+COMMENT= Monitoring and management system for hosts, services and networks
+
+LICENSE= GPLv2
+
+LIB_DEPENDS= libboost_system.so:${PORTSDIR}/devel/boost-libs \
+ libexecinfo.so:${PORTSDIR}/devel/libexecinfo # for better debugging
+RUN_DEPENDS= ${LOCALBASE}/libexec/nagios/check_nagios:${PORTSDIR}/net-mgmt/monitoring-plugins \
+ ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash
+
+USES= bison cmake
+USE_LDCONFIG= yes
+
+USE_RC_SUBR= ${PORTNAME}
+
+OPTIONS_SINGLE= BACKEND
+OPTIONS_SINGLE_BACKEND= MYSQL PGSQL
+
+OPTIONS_DEFAULT= MYSQL
+
+MYSQL_CMAKE_ON= -DWITH_MYSQL:BOOL=true
+PGSQL_CMAKE_ON= -DWITH_PGSQL:BOOL=true
+
+ICINGA2USER?= icinga
+ICINGA2GROUP?= icinga
+USERS= ${ICINGA2USER}
+GROUPS= ${ICINGA2GROUP}
+
+LOCALSTATEDIR?= /var
+ICINGA2LOGDIR?= /var/log/${PORTNAME}
+
+CMAKE_ARGS+= -DICINGA2_USER=${ICINGA2USER} \
+ -DICINGA2_GROUP=${ICINGA2GROUP} \
+ -DICINGA2_COMMAND_USER=${ICINGA2USER} \
+ -DICINGA2_COMMAND_GROUP=${ICINGA2USER} \
+ -DCMAKE_INSTALL_SYSCONFDIR=${PREFIX}/etc \
+ -DCMAKE_INSTALL_LOCALSTATEDIR=${LOCALSTATEDIR} \
+ -DCMAKE_INSTALL_MANDIR=${MANPREFIX}/man \
+
+SUB_LIST= ICINGA2LOGDIR=${ICINGA2LOGDIR} \
+ ICINGA2USER=${ICINGA2USER} \
+ ICINGA2GROUP=${ICINGA2GROUP} \
+ WWWGRP=${WWWGRP}
+
+LINUX_CONFIG= groups.conf services.conf hosts/localhost.conf
+
+.include <bsd.port.pre.mk>
+.if ${OSVERSION} < 1000033
+BUILD_DEPENDS+= flex>=2.5.31:${PORTSDIR}/textproc/flex
+CMAKE_ARGS+= -DFLEX_EXECUTABLE:STRING=${LOCALBASE}/bin/flex
+CXXFLAGS+= -I${LOCALBASE}/include/flex
+.endif
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MMYSQL}
+USE_MYSQL= yes
+PLIST_SUB+= MYSQL=""
+.else
+PLIST_SUB+= MYSQL="@comment "
+.endif
+
+.if ${PORT_OPTIONS:MPGSQL}
+USE_PGSQL= yes
+PLIST_SUB+= PGSQL=""
+.else
+PLIST_SUB+= PGSQL="@comment "
+.endif
+
+post-patch:
+ ${REINPLACE_CMD} -e '/^add_subdirectory(initsystem)/d' \
+ -e '/logrotate\.d/d' ${WRKSRC}/etc/CMakeLists.txt
+ ${REINPLACE_CMD} 's,/usr/lib/nagios/plugins,${LOCALBASE}/libexec/nagios,g' \
+ ${WRKSRC}/etc/icinga2/constants.conf
+.for f in ${LINUX_CONFIG}
+ ${REINPLACE_CMD} 's,[Ll]inux,FreeBSD,g' ${WRKSRC}/etc/icinga2/conf.d/${f}
+.endfor
+.if !${PORT_OPTIONS:MMYSQL}
+ ${REINPLACE_CMD} '/^add_subdirectory(db_ido_mysql)/d' ${WRKSRC}/components/CMakeLists.txt
+.endif
+.if !${PORT_OPTIONS:MMYSQL}
+ ${REINPLACE_CMD} '/^add_subdirectory(db_ido_pgsql)/d' ${WRKSRC}/components/CMakeLists.txt
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/net-mgmt/icinga2/distinfo b/net-mgmt/icinga2/distinfo
new file mode 100644
index 000000000000..441dd0388cf2
--- /dev/null
+++ b/net-mgmt/icinga2/distinfo
@@ -0,0 +1,2 @@
+SHA256 (icinga2-2.0.0.tar.gz) = c8a0717b0726d084fc93f695e51f35c80afb853a184a9bae8927d95830ef6e1a
+SIZE (icinga2-2.0.0.tar.gz) = 533346
diff --git a/net-mgmt/icinga2/files/icinga2.in b/net-mgmt/icinga2/files/icinga2.in
new file mode 100644
index 000000000000..d87313107434
--- /dev/null
+++ b/net-mgmt/icinga2/files/icinga2.in
@@ -0,0 +1,107 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: icinga2
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf to enable icinga2:
+# icinga2_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable icinga2.
+# icinga2_flags (str): Set to "" by default.
+# icinga2_configfile (str): Set to "%%PREFIX%%/etc/icinga2/icinga2.cfg" by default.
+#
+
+. /etc/rc.subr
+
+# Add /usr/local/bin to path, so that the notification scripts
+# can work (#!/usr/bin/env bash)
+export PATH=$PATH:%%LOCALBASE%%/bin
+
+name="icinga2"
+rcvar=icinga2_enable
+
+load_rc_config "${name}"
+
+: ${icinga2_enable:="NO"}
+: ${icinga2_configfile="%%PREFIX%%/etc/${name}/${name}.conf"}
+
+command="%%PREFIX%%/sbin/${name}"
+extra_commands="reload checkconfig configtest"
+icinga2_user="%%ICINGA2USER%%"
+icinga2_group="%%ICINGA2GROUP%%"
+
+icinga2_cachedir="/var/cache/${name}"
+icinga2_libdir="/var/lib/${name}"
+icinga2_logdir="%%ICINGA2LOGDIR%%"
+icinga2_rundir="/var/run/${name}"
+icinga2_spooldir="/var/spool/${name}"
+
+pidfile="${icinga2_rundir}/${name}.pid"
+icinga2_logfile="${icinga2_logdir}/${name}.log"
+icinga2_errorlogfile="${icinga2_logdir}/error.log"
+
+start_cmd="start_cmd"
+start_precmd="start_precmd"
+restart_precmd="icinga2_checkconfig"
+reload_precmd="reload_precmd"
+checkconfig_cmd="icinga2_checkconfig verbose"
+configtest_cmd="${checkconfig_cmd}"
+sig_reload=HUP
+
+required_files="${icinga2_configfile}"
+command_args="-d -e ${icinga2_errorlogfile} -u ${icinga2_user} -g ${icinga2_group} -c ${icinga2_configfile}"
+
+icinga2_checkconfig() {
+ echo -n "Performing sanity check of icinga2 configuration: "
+
+ if [ "$1" != "verbose" ]; then
+ quietredir="2>&1 >/dev/null"
+ fi
+
+ ${command} -c ${icinga2_configfile} -C -u ${icinga2_user} -g ${icinga2_group}
+
+ if [ $? -ne 0 ]; then
+ echo "FAILED"
+ return 1
+ else
+ echo "OK"
+ fi
+}
+
+reload_precmd() {
+ if ! icinga2_checkconfig; then
+ return 1
+ fi
+}
+
+start_precmd() {
+ # Create necessary directories / change ownership
+ for d in "${icinga2_logdir}" "${icinga2_logdir}/compat" \
+ "${icinga2_logdir}/compat/archives" "${icinga2_libdir}" \
+ "${icinga2_spooldir}" "${icinga2_spooldir}/tmp" \
+ "${icinga2_rundir}" "${icinga2_cachedir}"; do
+ install -d -o ${icinga2_user} -g ${icinga2_group} "${d}"
+ done
+
+ install -d -o ${icinga2_user} -g %%WWWGRP%% "${icinga2_rundir}/cmd"
+
+ chown -R ${icinga2_user}:${icinga2_user} "${icinga2_libdir}"
+ chown -R ${icinga2_user}:${icinga2_user} "${icinga2_spooldir}"
+
+ if ! icinga2_checkconfig; then
+ return 1
+ fi
+
+ if [ ! -f "${icinga2_logfile}" ]; then
+ install -o "${icinga2_user}" -g "${icinga2_group}" -m 644 /dev/null "${icinga2_logfile}"
+ fi
+}
+
+start_cmd() {
+ ${command} ${command_args}
+}
+
+run_rc_command "$1"
diff --git a/net-mgmt/icinga2/files/patch-CMakeLists.txt b/net-mgmt/icinga2/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..b450b97eafdd
--- /dev/null
+++ b/net-mgmt/icinga2/files/patch-CMakeLists.txt
@@ -0,0 +1,12 @@
+--- CMakeLists.txt.orig 2014-06-16 23:18:51.000000000 +0000
++++ CMakeLists.txt 2014-06-16 23:19:01.000000000 +0000
+@@ -27,6 +27,9 @@
+ FORCE)
+ endif()
+
++option(WITH_MYSQL "MySQL support" OFF)
++option(WITH_PGSQL "PostgreSQL support" OFF)
++
+ file(STRINGS icinga2.spec VERSION_LINE REGEX "^Version: ")
+ string(REPLACE "Version: " "" ICINGA2_VERSION ${VERSION_LINE})
+
diff --git a/net-mgmt/icinga2/files/patch-components__CMakeLists.txt b/net-mgmt/icinga2/files/patch-components__CMakeLists.txt
new file mode 100644
index 000000000000..248fe4b11458
--- /dev/null
+++ b/net-mgmt/icinga2/files/patch-components__CMakeLists.txt
@@ -0,0 +1,19 @@
+--- components/CMakeLists.txt.orig 2014-06-16 23:20:12.000000000 +0000
++++ components/CMakeLists.txt 2014-06-16 23:20:18.000000000 +0000
+@@ -1,7 +1,14 @@
+ add_subdirectory(checker)
+ add_subdirectory(compat)
+-add_subdirectory(db_ido_mysql)
+-add_subdirectory(db_ido_pgsql)
++
++if(WITH_MYSQL)
++ add_subdirectory(db_ido_mysql)
++endif()
++
++if(WITH_PGSQL)
++ add_subdirectory(db_ido_pgsql)
++endif()
++
+ add_subdirectory(demo)
+ add_subdirectory(livestatus)
+ add_subdirectory(notification)
diff --git a/net-mgmt/icinga2/files/patch-components__db_ido_mysql__CMakeLists.txt b/net-mgmt/icinga2/files/patch-components__db_ido_mysql__CMakeLists.txt
new file mode 100644
index 000000000000..b88cbc6011ad
--- /dev/null
+++ b/net-mgmt/icinga2/files/patch-components__db_ido_mysql__CMakeLists.txt
@@ -0,0 +1,9 @@
+--- components/db_ido_mysql/CMakeLists.txt.orig 2014-06-16 23:31:26.000000000 +0000
++++ components/db_ido_mysql/CMakeLists.txt 2014-06-16 23:31:37.000000000 +0000
+@@ -38,4 +38,6 @@
+ RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
+ )
++else()
++ message( FATAL_ERROR "You have selected MySQL support, but MySQL could not be found." )
+ endif()
diff --git a/net-mgmt/icinga2/files/patch-components__db_ido_pgsql__CMakeLists.txt b/net-mgmt/icinga2/files/patch-components__db_ido_pgsql__CMakeLists.txt
new file mode 100644
index 000000000000..a404a017fa48
--- /dev/null
+++ b/net-mgmt/icinga2/files/patch-components__db_ido_pgsql__CMakeLists.txt
@@ -0,0 +1,9 @@
+--- components/db_ido_pgsql/CMakeLists.txt.orig 2014-06-16 23:27:15.000000000 +0000
++++ components/db_ido_pgsql/CMakeLists.txt 2014-06-16 23:29:03.000000000 +0000
+@@ -40,4 +40,6 @@
+ RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
+ )
++else()
++ message( FATAL_ERROR "You have selected PostgreSQL support, but PostgreSQL could not be found." )
+ endif()
diff --git a/net-mgmt/icinga2/pkg-descr b/net-mgmt/icinga2/pkg-descr
new file mode 100644
index 000000000000..64f5085e0b5a
--- /dev/null
+++ b/net-mgmt/icinga2/pkg-descr
@@ -0,0 +1,13 @@
+Icinga 2 is a network monitoring system and parallel development branch to
+Icinga 1.
+Written from scratch, it builds on the success of Icinga 1 and deals with
+shortcomings inherited from Nagios as a fork.
+
+Icinga 2 is:
+- Easy to install with soft link activation of functions and packages
+- Multithreaded and very fast: Capable of thousands of checks per second
+- Intuitive to configure, using new object-based, template-driven format
+- Easy to extend with native support for Livestatus and Graphite
+- Cluster-enabled for distributed monitoring out of the box
+
+WWW: http://www.icinga.org/icinga2/
diff --git a/net-mgmt/icinga2/pkg-plist b/net-mgmt/icinga2/pkg-plist
new file mode 100644
index 000000000000..677c69a9a496
--- /dev/null
+++ b/net-mgmt/icinga2/pkg-plist
@@ -0,0 +1,128 @@
+bin/icinga2-build-ca
+bin/icinga2-build-key
+bin/icinga2-sign-key
+%%ETCDIR%%/conf.d/commands.conf
+%%ETCDIR%%/conf.d/downtimes.conf
+%%ETCDIR%%/conf.d/groups.conf
+%%ETCDIR%%/conf.d/hosts/localhost.conf
+%%ETCDIR%%/conf.d/hosts/localhost/disk.conf
+%%ETCDIR%%/conf.d/hosts/localhost/http.conf
+%%ETCDIR%%/conf.d/hosts/localhost/icinga.conf
+%%ETCDIR%%/conf.d/hosts/localhost/load.conf
+%%ETCDIR%%/conf.d/hosts/localhost/procs.conf
+%%ETCDIR%%/conf.d/hosts/localhost/ssh.conf
+%%ETCDIR%%/conf.d/hosts/localhost/swap.conf
+%%ETCDIR%%/conf.d/hosts/localhost/users.conf
+%%ETCDIR%%/conf.d/notifications.conf
+%%ETCDIR%%/conf.d/services.conf
+%%ETCDIR%%/conf.d/templates.conf
+%%ETCDIR%%/conf.d/timeperiods.conf
+%%ETCDIR%%/conf.d/users.conf
+%%ETCDIR%%/constants.conf
+%%ETCDIR%%/features-available/api.conf
+%%ETCDIR%%/features-available/checker.conf
+%%ETCDIR%%/features-available/command.conf
+%%ETCDIR%%/features-available/compatlog.conf
+%%ETCDIR%%/features-available/debuglog.conf
+%%ETCDIR%%/features-available/graphite.conf
+%%ETCDIR%%/features-available/icingastatus.conf
+%%ETCDIR%%/features-available/ido-mysql.conf
+%%ETCDIR%%/features-available/ido-pgsql.conf
+%%ETCDIR%%/features-available/livestatus.conf
+%%ETCDIR%%/features-available/mainlog.conf
+%%ETCDIR%%/features-available/notification.conf
+%%ETCDIR%%/features-available/perfdata.conf
+%%ETCDIR%%/features-available/statusdata.conf
+%%ETCDIR%%/features-available/syslog.conf
+%%ETCDIR%%/features-enabled/checker.conf
+%%ETCDIR%%/features-enabled/mainlog.conf
+%%ETCDIR%%/features-enabled/notification.conf
+%%ETCDIR%%/icinga2.conf
+%%ETCDIR%%/scripts/mail-host-notification.sh
+%%ETCDIR%%/scripts/mail-service-notification.sh
+%%ETCDIR%%/zones.conf
+%%ETCDIR%%/zones.d/README
+lib/icinga2/libbase.so
+lib/icinga2/libcJSON.so
+lib/icinga2/libchecker.so
+lib/icinga2/libcompat.so
+lib/icinga2/libconfig.so
+lib/icinga2/libdb_ido.so
+%%MYSQL%%lib/icinga2/libdb_ido_mysql.so
+%%PGSQL%%lib/icinga2/libdb_ido_pgsql.so
+lib/icinga2/libdemo.so
+lib/icinga2/libexecvpe.so
+lib/icinga2/libhello.so
+lib/icinga2/libicinga.so
+lib/icinga2/liblivestatus.so
+lib/icinga2/libmethods.so
+lib/icinga2/libmmatch.so
+lib/icinga2/libnotification.so
+lib/icinga2/libperfdata.so
+lib/icinga2/libremote.so
+man/man8/icinga2-build-ca.8.gz
+man/man8/icinga2-build-key.8.gz
+man/man8/icinga2-disable-feature.8.gz
+man/man8/icinga2-enable-feature.8.gz
+man/man8/icinga2-prepare-dirs.8.gz
+man/man8/icinga2-sign-key.8.gz
+man/man8/icinga2.8.gz
+sbin/icinga2
+sbin/icinga2-disable-feature
+sbin/icinga2-enable-feature
+%%PORTDOCS%%%%DOCSDIR%%/AUTHORS
+%%PORTDOCS%%%%DOCSDIR%%/COPYING
+%%PORTDOCS%%%%DOCSDIR%%/COPYING.Exceptions
+%%PORTDOCS%%%%DOCSDIR%%/ChangeLog
+%%PORTDOCS%%%%DOCSDIR%%/INSTALL
+%%PORTDOCS%%%%DOCSDIR%%/NEWS
+%%PORTDOCS%%%%DOCSDIR%%/README
+%%PORTDOCS%%%%DOCSDIR%%/markdown/1-about.md
+%%PORTDOCS%%%%DOCSDIR%%/markdown/2-getting-started.md
+%%PORTDOCS%%%%DOCSDIR%%/markdown/3-monitoring-basics.md
+%%PORTDOCS%%%%DOCSDIR%%/markdown/4-monitoring-remote-systems.md
+%%PORTDOCS%%%%DOCSDIR%%/markdown/5-addons-plugins.md
+%%PORTDOCS%%%%DOCSDIR%%/markdown/6-configuring-icinga-2.md
+%%PORTDOCS%%%%DOCSDIR%%/markdown/7-troubleshooting.md
+%%PORTDOCS%%%%DOCSDIR%%/markdown/8-migration.md
+%%PORTDOCS%%%%DOCSDIR%%/markdown/9-appendix.md
+%%DATADIR%%/include/command-icinga.conf
+%%DATADIR%%/include/command-plugins.conf
+%%DATADIR%%/include/command.conf
+%%DATADIR%%/include/itl
+%%DATADIR%%/include/plugins
+%%DATADIR%%/include/timeperiod.conf
+%%DATADIR%%/pki/openssl-quiet.cnf
+%%DATADIR%%/pki/openssl.cnf
+%%DATADIR%%/pki/pkifuncs
+%%DATADIR%%/pki/vars
+@dirrmtry %%ETCDIR%%/conf.d/hosts/localhost
+@dirrmtry %%ETCDIR%%/conf.d/hosts
+@dirrmtry %%ETCDIR%%/conf.d
+@dirrmtry %%ETCDIR%%/features-available
+@dirrmtry %%ETCDIR%%/features-enabled
+@dirrmtry %%ETCDIR%%/pki
+@dirrmtry %%ETCDIR%%/scripts
+@dirrmtry %%ETCDIR%%/zones.d
+@dirrmtry %%ETCDIR%%
+@dirrmtry lib/icinga2
+%%PORTDOCS%%@dirrmtry %%DOCSDIR%%/markdown
+%%PORTDOCS%%@dirrmtry %%DOCSDIR%%
+@dirrmtry %%DATADIR%%/include
+@dirrmtry %%DATADIR%%/pki
+@dirrmtry %%DATADIR%%
+@unexec rmdir "/var/cache/icinga2" >/dev/null 2>&1 || :
+@unexec rmdir "/var/lib/icinga2/api/log" >/dev/null 2>&1 || :
+@unexec rmdir "/var/lib/icinga2/api/repository" >/dev/null 2>&1 || :
+@unexec rmdir "/var/lib/icinga2/api/zones" >/dev/null 2>&1 || :
+@unexec rmdir "/var/lib/icinga2/api" >/dev/null 2>&1 || :
+@unexec rmdir "/var/lib/icinga2" >/dev/null 2>&1 || :
+@unexec rmdir "/var/lib" >/dev/null 2>&1 || :
+@unexec rmdir "/var/log/icinga2/compat/archives" >/dev/null 2>&1 || :
+@unexec rmdir "/var/log/icinga2/compat" >/dev/null 2>&1 || :
+@unexec rmdir "/var/log/icinga2" >/dev/null 2>&1 || :
+@unexec rmdir "/var/run/icinga2/cmd" >/dev/null 2>&1 || :
+@unexec rmdir "/var/run/icinga2" >/dev/null 2>&1 || :
+@unexec rmdir "/var/spool/icinga2/perfdata" >/dev/null 2>&1 || :
+@unexec rmdir "/var/spool/icinga2/tmp" >/dev/null 2>&1 || :
+@unexec rmdir "/var/spool/icinga2" >/dev/null 2>&1 || :