Skip to content
Commits on Source (7)
......@@ -4,10 +4,11 @@
Gunnar Beutner <gunnar.beutner@icinga.com> <icinga@net-icinga2.adm.netways.de>
<michael.friedrich@icinga.com> <michael.friedrich@gmail.com>
<michael.friedrich@icinga.com> <Michael.Friedrich@netways.de>
Michael Insel <mcktr55@gmail.com> <mcktr55@gmail.com>
<tobias.vonderkrone@profitbricks.com> <tobias@vonderkrone.info>
Jean-Marcel Flach <jean-marcel.flach@icinga.com> <jean-marcel.flach@netways.de>
Jean-Marcel Flach <jean-marcel.flach@icinga.com> <Crunsher@users.noreply.github.com>
Jean-Marcel Flach <jean-marcel.flach@icinga.com> Jean Flach <jean-marcel.flach@icinga.com>
Jean Flach <jean-marcel.flach@icinga.com> <jean-marcel.flach@netways.de>
Jean Flach <jean-marcel.flach@icinga.com> <Crunsher@users.noreply.github.com>
Jean Flach <jean-marcel.flach@icinga.com> Jean Flach <jean-marcel.flach@icinga.com>
Dolf Schimmel <dolf@transip.nl> <dolf@dolfschimmel.nl>
Markus Waldmüller <markus.waldmueller@netways.de>
Claudio Kuenzler <ck@claudiokuenzler.com>
......@@ -29,3 +30,5 @@ Claudio Kuenzler <ck@claudiokuenzler.com>
<lennart.betz@icinga.com> <lennart.betz@netways.de>
<lars.engels@0x20.net> <lars@0x20.net>
Marianne Spiller <github@spiller.me>
Robin O'Brien <robin@labs.epiuse.com> <robinjohnobrien@gmail.com>
<noah.hilverling@icinga.com> <noah@hilverling.com>
......@@ -10,6 +10,8 @@ Andrew Meyer <ameyer+secure@nodnetwork.org>
Andy Grunwald <andygrunwald@gmail.com>
Arnd Hannemann <arnd@arndnet.de>
Assaf Flatto <assaf@aikilinux.com>
Bård Dahlmo-Lerbæk <bard.dahlmo-lerbaek@skatteetaten.no>
bascarsija <bascarsija.dev@gmail.com>
Bastian Guse <bguse@nocopy.de>
Benedikt Heine <bebe@bebehei.de>
Bernd Erk <bernd.erk@icinga.com>
......@@ -19,10 +21,10 @@ Brendan Jurd <direvus@gmail.com>
Brian De Wolf <git@bldewolf.com>
Brian Dockter <specus@gmail.com>
Bruno Lingner <mail@hugo.ro>
Bård Dahlmo-Lerbæk <bard.dahlmo-lerbaek@skatteetaten.no>
Carlos Cesario <carloscesario@gmail.com>
Carsten Köbke <carsten.koebke@gmx.de>
Christian Birk <mail@birkc.de>
Christian Gut <christian.gut@trendswm.de>
Christian Harke <ch.harke@gmail.com>
Christian Jonak <christian@jonak.org>
Christian Lehmann <christian_lehmann@gmx.de>
......@@ -31,6 +33,8 @@ Christian Schmidt <github@chsc.dk>
Claudio Bilotta <bilottalove@gmail.com>
Claudio Kuenzler <ck@claudiokuenzler.com>
Conrad Clement <cclement@printeron.com>
cstegm <cstegm@users.noreply.github.com>
ctrlaltca <ctrlaltca@gmail.com>
Daniel Helgenberger <daniel.helgenberger@m-box.de>
Daniel Kesselberg <mail@danielkesselberg.de>
Daniil Yaroslavtsev <dyaroslavtsev@confyrm.com>
......@@ -38,18 +42,24 @@ David Beck <techiscool@gmail.com>
Denis <zaharden@gmail.com>
Dinesh Majrekar <dinesh.majrekar@serverchoice.com>
Dirk Goetz <dirk.goetz@icinga.com>
Dirk Melchers <dirk@dirk-melchers.de>
Dolf Schimmel <dolf@transip.nl>
Edgar Fuß <ef@math.uni-bonn.de>
Eduard Güldner <eduard.gueldner@gmail.com>
Edvin Seferovic <edvin@seferovic.net>
Élie Bouttier <elie@bouttier.eu>
Eric Lippmann <eric.lippmann@icinga.com>
Evgeni Golov <evgeni@golov.de>
Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl>
Federico Cuello <federico.cuello@sociomantic.com>
Ferdi Gueran <ferdi.gueran@nextevolution.de>
Francesco Colista <fcolista@alpinelinux.org>
Gaël Beaudoin <gaboo@gaboo.org>
Georg Faerber <georg@riseup.net>
Georg Haas <hax404foogit@hax404.de>
Gerd von Egidy <gerd@egidy.de>
Gerhardt Roman <roman.gerhardt@cbc-x.com>
gitmopp <mopp@gmx.net>
Glauco Vinicius <gl4uc0@gmail.com>
Gunnar Beutner <gunnar.beutner@icinga.com>
Hannes Happle <info@h2-it.de>
......@@ -58,35 +68,39 @@ Heike Jurzik <icinga@huhnix.org>
Hendrik Röder <hendrik.biz@gmail.com>
Ian Kelling <ian@iankelling.org>
Ildar Hizbulin <hizel@vyborg.ru>
Irina Kaprizkina <ikapriz@gmail.com>
James Pharaoh <james@pharaoh.uk>
Jan Andres <jan.andres@berenberg.de>
Jan Beich <jbeich@FreeBSD.org>
Jan Wagner <waja@cyconet.org>
Jason Young <jason.young@velaspan.com>
Jean Flach <jean-marcel.flach@icinga.com>
Jean-Louis Dupond <jean-louis@dupond.be>
Jean-Marcel Flach <jean-marcel.flach@icinga.com>
Jens Schanz <mail@jensschanz.de>
Jeremy Armstrong <lepubel@gmail.com>
Jérôme Drouet <jerome.drouet@gmail.com>
Jesse Morgan <morgajel@gmail.com>
Jo Goossens <jo.goossens@hosted-power.com>
Johannes Meyer <johannes.meyer@icinga.com>
Jonas Meurer <jonas@freesources.org>
Joseph L. Casale <jcasale@activenetwerx.com>
Julian Brost <julian@0x4a42.net>
Jérôme Drouet <jerome.drouet@gmail.com>
Kai Goller <kai.goller@netways.de>
Konstantin Kelemen <konstantin@kel.mn>
Kálmán Szalai - KAMI <kami911@gmail.com>
Konstantin Kelemen <konstantin@kel.mn>
krishna <gskrishna44@gmail.com>
Lars Engels <lars.engels@0x20.net>
Lars Krüger <krueger-lars@web.de>
Lee Clemens <java@leeclemens.net>
Lennart Betz <lennart.betz@icinga.com>
lihan <tclh123@gmail.com>
Louis Sautier <sautier.louis@gmail.com>
Luca Lesinigo <luca@lm-net.it>
Lucas Fairchild-Madar <lucas.madar@gmail.com>
Malte Rabenseifner <mail@malte-rabenseifner.de>
Manuel Reiter <reiter@csc.uni-frankfurt.de>
Marcus van Dam <marcus@marcusvandam.nl>
MarcusCaepio <MarcusCaepio@users.noreply.github.com>
Marcus van Dam <marcus@marcusvandam.nl>
Marianne Spiller <github@spiller.me>
Marius Bergmann <marius@yeai.de>
Marius Sturm <marius@graylog.com>
......@@ -97,20 +111,28 @@ Mathieu Arnold <mat@mat.cc>
Mathieu Lutfy <mathieu@bidon.ca>
Matthaus Owens <matthaus@puppetlabs.com>
Matthias Schales <black-dragon131@web.de>
Maurice Meyer <morre@mor.re>
Max Rosin <git@hackrid.de>
Max Zhang <zhenzhan@tibco.com>
Mhd Sulhan <ms@kilabit.info>
Micha Ahrweiler <me@schnitzi.net>
Michael <mcktr55@gmail.com>
Michael Friedrich <michael.friedrich@icinga.com>
Michael I <mcktr55@gmail.com>
Michael Insel <mcktr55@gmail.com>
Michael Insel <michael@insel.email>
Michael Kraus <michael.kraus@consol.de>
Michael Newton <miken32@gmail.com>
Mikesch-mp <mikesch-mp@koebbes.de>
Mirco Bauer <meebey@meebey.net>
Mirko Nardin <mirko.nardin@gmx.net>
mocruz <mocruz@theworkshop.com>
Nicolai <nbuchwitz@users.noreply.github.com>
Nicolas Limage <github@xephon.org>
Nicole Lang <nicole.lang@icinga.com>
Niflou <dubuscyr@gmail.com>
Noah Hilverling <noah.hilverling@icinga.com>
noobahoi <20069422+noobahoi@users.noreply.github.com>
Pall Sigurdsson <palli-github@minor.is>
Paolo Schiro <paolo.schiro@kpnqwest.it>
Patrick Huy <frz@frz.cc>
Paul Richards <paul@minimoo.org>
Pawel Szafer <pszafer@gmail.com>
......@@ -119,12 +141,16 @@ Peter Eckel <pe-icinga2@hindenburgring.com>
Petr Ruzicka <petr.ruzicka@gmail.com>
Phil Hutchinson <phil@volumedia.co.uk>
Philipp Dallig <philipp.dallig@gmail.com>
pv2b <pvz@pvz.pp.se>
Ralph Breier <ralph.breier@roedl.com>
Reto Zeder <reto.zeder@arcade.ch>
Ricardo Bartels <ricardo@bitchbrothers.com>
Robin O'Brien <robin@labs.epiuse.com>
Roland Hopferwieser <rhopfer@ica.jku.at>
Roman Gerhardt <roman.gerhardt@cbc-x.com>
Rudy Gevaert <rudy.gevaert@ugent.be>
Rune Darrud <theflyingcorpse@gmail.com>
ryanohnemus <ryan.ohnemus@tradingtechnologies.com>
Sam Kottler <shk@linux.com>
Sebastian Brückner <mail@invlid.com>
Sebastian Chrostek <sebastian@chrostek.net>
......@@ -133,15 +159,19 @@ Simon Murray <spjmurray@yahoo.co.uk>
Simon Ruderich <simon@ruderich.org>
Siyalrach Anton Thomas <sat@level8.dk>
Stefan Triep <stefan@triep.net>
Stefar77 <Stefar77@users.noreply.github.com>
Stephan Platz <github@paalsteek.de>
Stephan Tesch <stephan@tesch.cx>
Steve McMaster <mcmaster@hurricanelabs.com>
Strajan Sebastian Ioan <strajan.sebastian@yahoo.com>
Strix <660956+MrStrix@users.noreply.github.com>
Sven Nierlein <sven@nierlein.de>
Thomas Gelf <thomas@gelf.net>
Thomas Niedermeier <tniedermeier@thomas-krenn.com>
Thomas Widhalm <thomas.widhalm@icinga.com>
Tim Hardeck <thardeck@suse.de>
Tim Weippert <weiti@weiti.eu>
Timo Buhrmester <van.fstd@gmail.com>
Tim Weippert <weiti@weiti.eu>
Tobias Birnbaum <osterd@gmx.de>
Tobias von der Krone <tobias.vonderkrone@profitbricks.com>
Tom Geissler <Tom@d7031.de>
......@@ -155,8 +185,3 @@ Yannick Charton <tontonitch-pro@yahoo.fr>
Yohan Jarosz <yohanjarosz@yahoo.fr>
Zachary McGibbon <zachary.mcgibbon@gmail.com>
Zoltan Nagy <abesto@abesto.net>
gitmopp <mopp@gmx.net>
krishna <gskrishna44@gmail.com>
mcktr <mcktr55@gmail.com>
mocruz <mocruz@theworkshop.com>
Élie Bouttier <elie@bouttier.eu>
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -40,7 +40,7 @@ option(ICINGA2_WITH_PERFDATA "Build the perfdata module" ON)
option(ICINGA2_WITH_STUDIO "Build the Icinga Studio application" OFF)
option(ICINGA2_WITH_TESTS "Run unit tests" ON)
file(STRINGS icinga2.spec VERSION_LINE REGEX "^Version: ")
file(STRINGS VERSION VERSION_LINE REGEX "^Version: ")
string(REPLACE "Version: " "" ICINGA2_VERSION ${VERSION_LINE})
include(GNUInstallDirs)
......@@ -55,6 +55,11 @@ set(ICINGA2_GIT_VERSION_INFO ON CACHE BOOL "Whether to use git describe")
set(ICINGA2_UNITY_BUILD ON CACHE BOOL "Whether to perform a unity build")
set(ICINGA2_LTO_BUILD OFF CACHE BOOL "Whether to use LTO")
if(NOT WIN32)
set(ICINGA2_SYSCONFIGFILE "${CMAKE_INSTALL_FULL_SYSCONFDIR}/sysconfig/icinga2" CACHE PATH "where to store configuation for the init system, defaults to /etc/sysconfig/icinga2")
endif()
site_name(ICINGA2_BUILD_HOST_NAME)
set(ICINGA2_BUILD_COMPILER_NAME "${CMAKE_CXX_COMPILER_ID}")
......@@ -70,7 +75,7 @@ file(READ "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.Exceptions" ICINGA2_LICENSE_ADDIT
set(ICINGA2_LICENSE "${ICINGA2_LICENSE_GPL}\n\n---\n\n${ICINGA2_LICENSE_ADDITIONS}")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt" ${ICINGA2_LICENSE})
file(STRINGS icinga2.spec SPEC_VERSION REGEX "^Version:")
file(STRINGS VERSION SPEC_VERSION REGEX "^Version:")
string(LENGTH "${SPEC_VERSION}" SPEC_VERSION_LENGTH)
math(EXPR SPEC_VERSION_LENGTH "${SPEC_VERSION_LENGTH} - 9")
string(SUBSTRING ${SPEC_VERSION} 9 ${SPEC_VERSION_LENGTH} SPEC_VERSION)
......@@ -83,10 +88,10 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/icinga-version.h.force)
configure_file(icinga-version.h.force ${CMAKE_CURRENT_BINARY_DIR}/icinga-version.h COPYONLY)
else()
if(NOT ICINGA2_GIT_VERSION_INFO OR GIT_VERSION MATCHES "-NOTFOUND$")
file(STRINGS icinga2.spec SPEC_REVISION REGEX "^%define revision ")
file(STRINGS VERSION SPEC_REVISION REGEX "^Revision: ")
string(LENGTH "${SPEC_REVISION}" SPEC_REVISION_LENGTH)
math(EXPR SPEC_REVISION_LENGTH "${SPEC_REVISION_LENGTH} - 17")
string(SUBSTRING ${SPEC_REVISION} 17 ${SPEC_REVISION_LENGTH} SPEC_REVISION)
math(EXPR SPEC_REVISION_LENGTH "${SPEC_REVISION_LENGTH} - 10")
string(SUBSTRING ${SPEC_REVISION} 10 ${SPEC_REVISION_LENGTH} SPEC_REVISION)
set(GIT_VERSION "r${SPEC_VERSION}-${SPEC_REVISION}")
endif()
......@@ -148,6 +153,13 @@ set(CMAKE_MACOSX_RPATH 1)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qunused-arguments -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -g")
# Clang on Fedora requires -pthread, Apple Clang does not
# AppleClang is available since CMake 3.0.0
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
endif()
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "SunPro")
......@@ -311,7 +323,8 @@ set(CPACK_WIX_UI_DIALOG "${CMAKE_CURRENT_SOURCE_DIR}/icinga-installer/dlgbmp.bmp
set(CPACK_WIX_PATCH_FILE "${CMAKE_CURRENT_BINARY_DIR}/icinga-installer/icinga2.wixpatch.Debug")
set(CPACK_WIX_PATCH_FILE "${CMAKE_CURRENT_BINARY_DIR}/icinga-installer/icinga2.wixpatch")
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION "sbin")
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
include(InstallRequiredSystemLibraries)
if(WIN32)
......@@ -345,8 +358,7 @@ if(WIN32)
endif()
install(
PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
${ICINGA2_OPENSSL_DLLS}
PROGRAMS ${ICINGA2_OPENSSL_DLLS}
DESTINATION ${CMAKE_INSTALL_SBINDIR}
)
endif()
......
......@@ -258,14 +258,14 @@ You can help test-drive the latest Icinga 2 snapshot packages inside the
Icinga 2 is written in C++ and uses the Boost libraries. We are also using the C++11 standard where applicable (please
note the minimum required compiler versions in the [INSTALL.md](INSTALL.md) file.
Icinga 2 can be built on Linux/Unix and Windows clients. In order to develop patches for Icinga 2,
Icinga 2 can be built on Linux/Unix nodes and Windows clients. In order to develop patches for Icinga 2,
you should prepare your own local build environment and know how to work with C++.
More tips:
* Requirements and source code installation is explained inside the [INSTALL.md](INSTALL.md) file.
* Requirements and source code installation for Linux/Unix is explained inside the [INSTALL.md](INSTALL.md) file.
* Debug requirements and GDB instructions can be found in the [documentation](https://github.com/Icinga/icinga2/blob/master/doc/20-development.md).
* If you are planning to debug a Windows client, setup a Windows environment with [Visual Studio](https://www.visualstudio.com/vs/community/). An example can be found in [this blogpost](https://blog.netways.de/2015/08/24/developing-icinga-2-on-windows-10-using-visual-studio-2015/).
* If you are planning to develop and debug the Windows client, setup a Windows environment with [Visual Studio](https://www.visualstudio.com/vs/community/). An example can be found in [this blogpost](https://blog.netways.de/2015/08/24/developing-icinga-2-on-windows-10-using-visual-studio-2015/).
## <a id="contributing-patches-documentation"></a> Documentation Patches
......@@ -403,7 +403,7 @@ Edit the documentation file in the `doc/` directory. More details on documentati
updates can be found [here](CONTRIBUTING.md#contributing-documentation).
```
vim doc/7-icinga-template-library.md
vim doc/10-icinga-template-library.md
```
The CheckCommand documentation should be located in the same chapter
......
......@@ -27,23 +27,23 @@ parentheses):
* cmake >= 2.6
* GNU make (make)
* C++ compiler which supports C++11 (gcc-c++ >= 4.7 on RHEL/SUSE, build-essential on Debian, alternatively clang++)
* C++ compiler which supports C++11 (gcc-c++ >= 4.7 on RHEL/SUSE, build-essential on Debian, alternatively clang++, build-base on Alpine)
* RedHat Developer Tools on RHEL5/6 (details on building below)
* pkg-config
* OpenSSL library and header files >= 0.9.8 (openssl-devel on RHEL, libopenssl1-devel on SLES11,
libopenssl-devel on SLES12, libssl-dev on Debian)
* Boost library and header files >= 1.48.0 (boost148-devel on EPEL for RHEL / CentOS, libboost-all-dev on Debian)
libopenssl-devel on SLES12, libssl-dev on Debian, libressl-dev on Alpine)
* Boost library and header files >= 1.48.0 (boost148-devel on EPEL for RHEL / CentOS, libboost-all-dev on Debian, boost-dev on Alpine)
* GNU bison (bison)
* GNU flex (flex) >= 2.5.35
* recommended: libexecinfo on FreeBSD (automatically used when Icinga 2 is
installed via port or package)
* optional: MySQL (mysql-devel on RHEL, libmysqlclient-devel on SUSE, libmysqlclient-dev on Debian);
* optional: MySQL (mysql-devel on RHEL, libmysqlclient-devel on SUSE, libmysqlclient-dev until Debian 8 jessie / default-libmysqlclient-dev from Debian 9 stretch, mariadb-dev on Alpine);
set CMake variable `ICINGA2_WITH_MYSQL` to `OFF` to disable this module
* optional: PostgreSQL (postgresql-devel on RHEL, libpq-dev on Debian); set CMake
* optional: PostgreSQL (postgresql-devel on RHEL, libpq-dev on Debian, postgresql-dev on Alpine); set CMake
variable `ICINGA2_WITH_PGSQL` to `OFF` to disable this module
* optional: YAJL (yajl-devel on RHEL, libyajl-dev on Debian)
* optional: YAJL (yajl-devel on RHEL, libyajl-dev on Debian, yajl-dev on Alpine)
* optional: libedit (libedit-devel on CentOS (RHEL requires rhel-7-server-optional-rpms
repository for el7 e.g.), libedit-dev on Debian)
repository for el7 e.g.), libedit-dev on Debian and Alpine)
* optional: Termcap (libtermcap-devel on RHEL, not necessary on Debian) - only
required if libedit doesn't already link against termcap/ncurses
* optional: libwxgtk2.8-dev or newer (wxGTK-devel and wxBase) - only required when building the Icinga 2 Studio
......@@ -65,6 +65,13 @@ using the `ICINGA2_USER`, `ICINGA2_GROUP` and `ICINGA2_COMMAND_GROUP` variables.
# groupadd icingacmd
# useradd -c "icinga" -s /sbin/nologin -G icingacmd -g icinga icinga
On Alpine (which uses ash busybox) you can run:
# addgroup -S icinga
# addgroup -S icingacmd
# adduser -S -D -H -h /var/spool/icinga2 -s /sbin/nologin -G icinga -g icinga icinga
# adduser icinga icingacmd
Add the web server user to the icingacmd group in order to grant it write
permissions to the external command pipe and livestatus socket:
......@@ -121,7 +128,7 @@ Defaults to `OFF`.
CMake determines the Icinga 2 version number using `git describe` if the
source directory is contained in a Git repository. Otherwise the version number
is extracted from the [icinga2.spec](icinga2.spec) file. This behavior can be
is extracted from the [VERSION](VERSION) file. This behavior can be
overridden by creating a file called `icinga-version.h.force` in the source
directory. Alternatively the `-DICINGA2_GIT_VERSION_INFO=OFF` option for CMake
can be used to disable the usage of `git describe`.
......@@ -157,7 +164,9 @@ Prepare the rpmbuild directory tree:
Copy the icinga2.spec file to `rpmbuild/SPEC` or fetch the latest version:
curl https://raw.githubusercontent.com/Icinga/icinga2/master/icinga2.spec -o $HOME/rpmbuild/SPECS/icinga2.spec
```
curl https://raw.githubusercontent.com/Icinga/rpm-icinga2/master/icinga2.spec -o $HOME/rpmbuild/SPECS/icinga2.spec
```
Copy the tarball to `rpmbuild/SOURCES` e.g. by using the `spectool` binary
provided with `rpmdevtools`:
......@@ -234,6 +243,18 @@ into your source tree and run the following command:
$ dpkg-buildpackage -uc -us
## Build Alpine Linux packages
A simple way to setup a build environment is installing Alpine in a chroot.
In this way, you can set up an Alpine build environment in a chroot under a
different Linux distro.
There is a script that simplifies these steps with just two commands, and
can be found [here](https://github.com/alpinelinux/alpine-chroot-install).
Once the build environment is installed, you can setup the system to build
the packages by following [this document](https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package).
## Build Post Install Tasks
After building Icinga 2 yourself, your package build system should at least run the following post
......@@ -253,15 +274,38 @@ components (e.g. for check execution, notifications, etc.):
[2016-12-08 16:44:25 +0100] information/ConfigItem: Committing config item(s).
...
### Init Script
Icinga 2 can be started as a daemon using the provided init script:
# /etc/init.d/icinga2
Usage: /etc/init.d/icinga2 {start|stop|restart|reload|checkconfig|status}
Or if your distribution uses systemd:
### Systemd
If your distribution uses Systemd:
# systemctl {start|stop|reload|status|enable|disable} icinga2
In case the distribution is running Systemd >227, you'll also
need to package and install the `etc/initsystem/icinga2.service.limits.conf`
file into `/etc/systemd/system/icinga2.service.d`.
### openrc
Or if your distribution uses openrc (like Alpine):
# rc-service icinga2
Usage: /etc/init.d/icinga2 {start|stop|restart|reload|checkconfig|status}
Note: the openrc's init.d is not shipped by default.
A working init.d with openrc can be found here: (https://git.alpinelinux.org/cgit/aports/plain/community/icinga2/icinga2.initd). If you have customized some path, edit the file and adjust it according with your setup.
Those few steps can be followed:
# wget https://git.alpinelinux.org/cgit/aports/plain/community/icinga2/icinga2.initd
# mv icinga2.initd /etc/init.d/icinga2
# chmod +x /etc/init.d/icinga2
Icinga 2 reads a single configuration file which is used to specify all
configuration settings (global settings, hosts, services, etc.). The
configuration format is explained in detail in the [doc/](doc/) directory.
......
......@@ -25,7 +25,7 @@ Icinga 2 as monitoring core works best with [Icinga Web 2](https://www.icinga.co
as web interface.
More information can be found at [www.icinga.com](https://www.icinga.com/products/icinga-2/)
and inside the [documentation](doc/1-about.md).
and inside the [documentation](https://www.icinga.com/docs/icinga2/latest/).
## License
......
......@@ -2,7 +2,9 @@
Specify the release version.
VERSION=2.7.0
```
VERSION=2.7.2
```
## Issues
......@@ -17,61 +19,98 @@ master branch which should be part of this release.
Update the [.mailmap](.mailmap) and [AUTHORS](AUTHORS) files:
$ git checkout master
$ git log --use-mailmap | grep ^Author: | cut -f2- -d' ' | sort | uniq > AUTHORS
```
git checkout master
git log --use-mailmap | grep '^Author:' | cut -f2- -d' ' | sort | uniq > AUTHORS
```
## Version
Update the version number in the following file:
Update the version in the spec file:
* [icinga2.spec]: Version: (.*)
Example:
wget -O icinga2.spec https://raw.githubusercontent.com/Icinga/icinga-packaging/rpm/snapshot/icinga2/icinga2.spec
gsed -i "s/Version: .*/Version: $VERSION/g" icinga2.spec
```
gsed -i "s/Version: .*/Version: $VERSION/g" VERSION
```
## Changelog
Update the [CHANGELOG.md](CHANGELOG.md) file.
Export these environment variables:
```
export ICINGA_GITHUB_AUTH_USERNAME='user'
export ICINGA_GITHUB_AUTH_TOKEN='token'
export ICINGA_GITHUB_PROJECT='icinga/icinga2'
```
Run the script which updates the [CHANGELOG.md](CHANGELOG.md) file.
```
./changelog.py
git diff
```
## Git Tag
Commit these changes to the "master" branch:
$ git commit -v -a -m "Release version $VERSION"
```
git commit -v -a -m "Release version $VERSION"
```
For minor releases: Cherry-pick this commit into the "support" branch:
For minor releases: Cherry-pick this commit into the "support" branch.
```
git checkout support/2.7
git cherry-pick master
```
Create a signed tag (tags/v<VERSION>) on the "master" branch (for major
releases) or the "support" branch (for minor releases).
GB:
$ git tag -u EE8E0720 -m "Version $VERSION" v$VERSION
```
git tag -u EE8E0720 -m "Version $VERSION" v$VERSION
```
MF:
$ git tag -u D14A1F16 -m "Version $VERSION" v$VERSION
```
git tag -u D14A1F16 -m "Version $VERSION" v$VERSION
```
NH:
Push the tag.
```
git tag -u 630F89D9 -m "Version $VERSION" v$VERSION
```
$ git push --tags
Push the tag:
```
git push --tags
```
For major releases: Create a new "support" branch:
$ git checkout master
$ git checkout -b support/2.7
$ git push -u origin support/2.7
```
git checkout master
git checkout -b support/2.7
git push -u origin support/2.7
```
For minor releases: Push the support branch, cherry-pick the release commit
into master and merge the support branch:
$ git push -u origin support/2.7
$ git checkout master
$ git cherry-pick support/2.7
$ git merge --strategy=ours support/2.7
$ git push origin master
```
git push -u origin support/2.7
git checkout master
git cherry-pick support/2.7
git merge --strategy=ours support/2.7
git push origin master
```
# External Dependencies
......@@ -92,14 +131,13 @@ into master and merge the support branch:
Example for CentOS7:
$ docker run -ti centos:latest bash
# yum -y install https://packages.icinga.com/epel/7/release/noarch/icinga-rpm-release-7-2.el7.centos.noarch.rpm
# yum -y install icinga2
# icinga2 daemon -C
```
docker run -ti centos:latest bash
# systemctl start icinga2
# tail -f /var/log/icinga2/icinga2.log
yum -y install https://packages.icinga.com/epel/icinga-rpm-release-7-latest.noarch.rpm
yum -y install icinga2
icinga2 daemon -C
```
## GitHub Release
......@@ -113,23 +151,25 @@ already has chocolatey installed. Pull/checkout the release.
Create the nupkg package:
```
cpack
```
Install the created icinga2 package locally:
```
choco install icinga2 -version 2.7.0 -fdv "%cd%" -source "'%cd%;https://chocolatey.org/api/v2/'"
```
Upload the package to [chocolatey](https://chocolatey.org/packages/upload).
## Online Documentation
SSH into the web box, navigate into `icinga2-latest/module/icinga2`
and pull the current support branch.
Ask @bobapple to update the documentation at docs.icinga.com.
## Announcement
* Create a new blog post on www.icinga.com/blog
* Send announcement mail to icinga-announce@lists.icinga.org
* Social media: [Twitter](https://twitter.com/icinga), [Facebook](https://www.facebook.com/icinga), [G+](https://plus.google.com/+icinga), [Xing](https://www.xing.com/communities/groups/icinga-da4b-1060043), [LinkedIn](https://www.linkedin.com/groups/Icinga-1921830/about)
* Update IRC channel topic
......
Version: 2.8.4
Revision: 1
......@@ -62,7 +62,6 @@
//
// txtHost
//
this.txtHost.Enabled = false;
this.txtHost.Location = new System.Drawing.Point(101, 103);
this.txtHost.Name = "txtHost";
this.txtHost.Size = new System.Drawing.Size(251, 20);
......@@ -70,7 +69,6 @@
//
// txtPort
//
this.txtPort.Enabled = false;
this.txtPort.Location = new System.Drawing.Point(101, 134);
this.txtPort.Name = "txtPort";
this.txtPort.Size = new System.Drawing.Size(100, 20);
......@@ -123,6 +121,8 @@
// chkConnect
//
this.chkConnect.AutoSize = true;
this.chkConnect.Checked = true;
this.chkConnect.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkConnect.Location = new System.Drawing.Point(18, 73);
this.chkConnect.Name = "chkConnect";
this.chkConnect.Size = new System.Drawing.Size(141, 17);
......
......@@ -54,14 +54,13 @@
this.lblListenerPort = new System.Windows.Forms.Label();
this.rdoListener = new System.Windows.Forms.RadioButton();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnEditEndpoint = new System.Windows.Forms.Button();
this.btnRemoveEndpoint = new System.Windows.Forms.Button();
this.btnAddEndpoint = new System.Windows.Forms.Button();
this.lvwEndpoints = new System.Windows.Forms.ListView();
this.colInstanceName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colHost = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.colPort = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.rdoNoMaster = new System.Windows.Forms.RadioButton();
this.rdoNewMaster = new System.Windows.Forms.RadioButton();
this.tbcPages = new System.Windows.Forms.TabControl();
this.tabRetrieveCertificate = new System.Windows.Forms.TabPage();
this.lblRetrieveCertificate = new System.Windows.Forms.Label();
......@@ -81,6 +80,7 @@
this.txtError = new System.Windows.Forms.TextBox();
this.lblError = new System.Windows.Forms.Label();
this.picBanner = new System.Windows.Forms.PictureBox();
this.introduction1 = new System.Windows.Forms.Label();
this.tabFinish.SuspendLayout();
this.tabConfigure.SuspendLayout();
this.tabParameters.SuspendLayout();
......@@ -143,9 +143,9 @@
this.lblSetupCompleted.AutoSize = true;
this.lblSetupCompleted.Location = new System.Drawing.Point(34, 35);
this.lblSetupCompleted.Name = "lblSetupCompleted";
this.lblSetupCompleted.Size = new System.Drawing.Size(214, 13);
this.lblSetupCompleted.Size = new System.Drawing.Size(259, 13);
this.lblSetupCompleted.TabIndex = 0;
this.lblSetupCompleted.Text = "The Icinga 2 agent was set up successfully.";
this.lblSetupCompleted.Text = "The Icinga 2 Windows client was set up successfully.";
//
// tabConfigure
//
......@@ -177,6 +177,7 @@
//
// tabParameters
//
this.tabParameters.Controls.Add(this.introduction1);
this.tabParameters.Controls.Add(this.groupBox3);
this.tabParameters.Controls.Add(this.txtTicket);
this.tabParameters.Controls.Add(this.lblTicket);
......@@ -199,9 +200,9 @@
this.groupBox3.Controls.Add(this.chkInstallNSCP);
this.groupBox3.Controls.Add(this.chkAcceptConfig);
this.groupBox3.Controls.Add(this.chkAcceptCommands);
this.groupBox3.Location = new System.Drawing.Point(308, 359);
this.groupBox3.Location = new System.Drawing.Point(308, 291);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(301, 135);
this.groupBox3.Size = new System.Drawing.Size(301, 188);
this.groupBox3.TabIndex = 5;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Advanced Options";
......@@ -209,31 +210,31 @@
// txtUser
//
this.txtUser.Enabled = false;
this.txtUser.Location = new System.Drawing.Point(28, 111);
this.txtUser.Location = new System.Drawing.Point(28, 88);
this.txtUser.Name = "txtUser";
this.txtUser.Size = new System.Drawing.Size(267, 20);
this.txtUser.Size = new System.Drawing.Size(178, 20);
this.txtUser.TabIndex = 8;
this.txtUser.Text = "NT AUTHORITY\\NetworkService";
//
// chkRunServiceAsThisUser
//
this.chkRunServiceAsThisUser.AutoSize = true;
this.chkRunServiceAsThisUser.Location = new System.Drawing.Point(9, 88);
this.chkRunServiceAsThisUser.Location = new System.Drawing.Point(9, 65);
this.chkRunServiceAsThisUser.Name = "chkRunServiceAsThisUser";
this.chkRunServiceAsThisUser.Size = new System.Drawing.Size(142, 17);
this.chkRunServiceAsThisUser.Size = new System.Drawing.Size(183, 17);
this.chkRunServiceAsThisUser.TabIndex = 7;
this.chkRunServiceAsThisUser.Text = "Run service as this user:";
this.chkRunServiceAsThisUser.Text = "Run Icinga 2 service as this user:";
this.chkRunServiceAsThisUser.UseVisualStyleBackColor = true;
this.chkRunServiceAsThisUser.CheckedChanged += new System.EventHandler(this.chkRunServiceAsThisUser_CheckedChanged);
//
// chkInstallNSCP
//
this.chkInstallNSCP.AutoSize = true;
this.chkInstallNSCP.Location = new System.Drawing.Point(9, 65);
this.chkInstallNSCP.Location = new System.Drawing.Point(9, 114);
this.chkInstallNSCP.Name = "chkInstallNSCP";
this.chkInstallNSCP.Size = new System.Drawing.Size(149, 17);
this.chkInstallNSCP.Size = new System.Drawing.Size(190, 17);
this.chkInstallNSCP.TabIndex = 6;
this.chkInstallNSCP.Text = "Install/Update NSClient++";
this.chkInstallNSCP.Text = "Install/Update bundled NSClient++";
this.chkInstallNSCP.UseVisualStyleBackColor = true;
//
// chkAcceptConfig
......@@ -241,9 +242,9 @@
this.chkAcceptConfig.AutoSize = true;
this.chkAcceptConfig.Location = new System.Drawing.Point(9, 42);
this.chkAcceptConfig.Name = "chkAcceptConfig";
this.chkAcceptConfig.Size = new System.Drawing.Size(190, 17);
this.chkAcceptConfig.Size = new System.Drawing.Size(284, 17);
this.chkAcceptConfig.TabIndex = 1;
this.chkAcceptConfig.Text = "Accept config updates from master";
this.chkAcceptConfig.Text = "Accept config updates from master/satellite instance(s)";
this.chkAcceptConfig.UseVisualStyleBackColor = true;
//
// chkAcceptCommands
......@@ -251,42 +252,42 @@
this.chkAcceptCommands.AutoSize = true;
this.chkAcceptCommands.Location = new System.Drawing.Point(9, 19);
this.chkAcceptCommands.Name = "chkAcceptCommands";
this.chkAcceptCommands.Size = new System.Drawing.Size(171, 17);
this.chkAcceptCommands.Size = new System.Drawing.Size(265, 17);
this.chkAcceptCommands.TabIndex = 0;
this.chkAcceptCommands.Text = "Accept commands from master";
this.chkAcceptCommands.Text = "Accept commands from master/satellite instance(s)";
this.chkAcceptCommands.UseVisualStyleBackColor = true;
//
// txtTicket
//
this.txtTicket.Location = new System.Drawing.Point(98, 45);
this.txtTicket.Location = new System.Drawing.Point(136, 56);
this.txtTicket.Name = "txtTicket";
this.txtTicket.Size = new System.Drawing.Size(340, 20);
this.txtTicket.Size = new System.Drawing.Size(378, 20);
this.txtTicket.TabIndex = 1;
//
// lblTicket
//
this.lblTicket.AutoSize = true;
this.lblTicket.Location = new System.Drawing.Point(9, 48);
this.lblTicket.Location = new System.Drawing.Point(9, 59);
this.lblTicket.Name = "lblTicket";
this.lblTicket.Size = new System.Drawing.Size(71, 13);
this.lblTicket.Size = new System.Drawing.Size(117, 13);
this.lblTicket.TabIndex = 4;
this.lblTicket.Text = "Setup Ticket:";
this.lblTicket.Text = "Setup Ticket (optional):";
//
// txtInstanceName
//
this.txtInstanceName.Location = new System.Drawing.Point(98, 16);
this.txtInstanceName.Location = new System.Drawing.Point(136, 27);
this.txtInstanceName.Name = "txtInstanceName";
this.txtInstanceName.Size = new System.Drawing.Size(340, 20);
this.txtInstanceName.Size = new System.Drawing.Size(378, 20);
this.txtInstanceName.TabIndex = 0;
//
// lblInstanceName
//
this.lblInstanceName.AutoSize = true;
this.lblInstanceName.Location = new System.Drawing.Point(9, 20);
this.lblInstanceName.Location = new System.Drawing.Point(11, 30);
this.lblInstanceName.Name = "lblInstanceName";
this.lblInstanceName.Size = new System.Drawing.Size(82, 13);
this.lblInstanceName.Size = new System.Drawing.Size(121, 13);
this.lblInstanceName.TabIndex = 3;
this.lblInstanceName.Text = "Instance Name:";
this.lblInstanceName.Text = "Instance Name (FQDN):";
//
// groupBox2
//
......@@ -294,9 +295,9 @@
this.groupBox2.Controls.Add(this.txtListenerPort);
this.groupBox2.Controls.Add(this.lblListenerPort);
this.groupBox2.Controls.Add(this.rdoListener);
this.groupBox2.Location = new System.Drawing.Point(8, 359);
this.groupBox2.Location = new System.Drawing.Point(8, 291);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(294, 135);
this.groupBox2.Size = new System.Drawing.Size(298, 188);
this.groupBox2.TabIndex = 2;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "TCP Listener";
......@@ -317,7 +318,7 @@
// txtListenerPort
//
this.txtListenerPort.Enabled = false;
this.txtListenerPort.Location = new System.Drawing.Point(132, 51);
this.txtListenerPort.Location = new System.Drawing.Point(66, 47);
this.txtListenerPort.Name = "txtListenerPort";
this.txtListenerPort.Size = new System.Drawing.Size(84, 20);
this.txtListenerPort.TabIndex = 8;
......@@ -326,7 +327,7 @@
// lblListenerPort
//
this.lblListenerPort.AutoSize = true;
this.lblListenerPort.Location = new System.Drawing.Point(43, 55);
this.lblListenerPort.Location = new System.Drawing.Point(31, 51);
this.lblListenerPort.Name = "lblListenerPort";
this.lblListenerPort.Size = new System.Drawing.Size(29, 13);
this.lblListenerPort.TabIndex = 1;
......@@ -337,30 +338,40 @@
this.rdoListener.AutoSize = true;
this.rdoListener.Location = new System.Drawing.Point(11, 24);
this.rdoListener.Name = "rdoListener";
this.rdoListener.Size = new System.Drawing.Size(250, 17);
this.rdoListener.Size = new System.Drawing.Size(283, 17);
this.rdoListener.TabIndex = 7;
this.rdoListener.Text = "Listen for connections from the master instance:";
this.rdoListener.Text = "Listen for connections from master/satellite instance(s):";
this.rdoListener.UseVisualStyleBackColor = true;
this.rdoListener.CheckedChanged += new System.EventHandler(this.RadioListener_CheckedChanged);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.btnEditEndpoint);
this.groupBox1.Controls.Add(this.btnRemoveEndpoint);
this.groupBox1.Controls.Add(this.btnAddEndpoint);
this.groupBox1.Controls.Add(this.lvwEndpoints);
this.groupBox1.Controls.Add(this.rdoNoMaster);
this.groupBox1.Controls.Add(this.rdoNewMaster);
this.groupBox1.Location = new System.Drawing.Point(8, 77);
this.groupBox1.Location = new System.Drawing.Point(8, 94);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(601, 276);
this.groupBox1.Size = new System.Drawing.Size(601, 191);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Master Instance";
this.groupBox1.Text = "Parent master/satellite instance(s) for this client";
//
// btnEditEndpoint
//
this.btnEditEndpoint.Enabled = false;
this.btnEditEndpoint.Location = new System.Drawing.Point(520, 48);
this.btnEditEndpoint.Name = "btnEditEndpoint";
this.btnEditEndpoint.Size = new System.Drawing.Size(75, 23);
this.btnEditEndpoint.TabIndex = 7;
this.btnEditEndpoint.Text = "Edit";
this.btnEditEndpoint.UseVisualStyleBackColor = true;
this.btnEditEndpoint.Click += new System.EventHandler(this.btnEditEndpoint_Click);
//
// btnRemoveEndpoint
//
this.btnRemoveEndpoint.Enabled = false;
this.btnRemoveEndpoint.Location = new System.Drawing.Point(520, 112);
this.btnRemoveEndpoint.Location = new System.Drawing.Point(520, 77);
this.btnRemoveEndpoint.Name = "btnRemoveEndpoint";
this.btnRemoveEndpoint.Size = new System.Drawing.Size(75, 23);
this.btnRemoveEndpoint.TabIndex = 6;
......@@ -370,7 +381,7 @@
//
// btnAddEndpoint
//
this.btnAddEndpoint.Location = new System.Drawing.Point(520, 83);
this.btnAddEndpoint.Location = new System.Drawing.Point(520, 19);
this.btnAddEndpoint.Name = "btnAddEndpoint";
this.btnAddEndpoint.Size = new System.Drawing.Size(75, 23);
this.btnAddEndpoint.TabIndex = 5;
......@@ -385,9 +396,9 @@
this.colHost,
this.colPort});
this.lvwEndpoints.FullRowSelect = true;
this.lvwEndpoints.Location = new System.Drawing.Point(11, 83);
this.lvwEndpoints.Location = new System.Drawing.Point(6, 19);
this.lvwEndpoints.Name = "lvwEndpoints";
this.lvwEndpoints.Size = new System.Drawing.Size(500, 176);
this.lvwEndpoints.Size = new System.Drawing.Size(500, 166);
this.lvwEndpoints.TabIndex = 4;
this.lvwEndpoints.UseCompatibleStateImageBehavior = false;
this.lvwEndpoints.View = System.Windows.Forms.View.Details;
......@@ -408,32 +419,6 @@
this.colPort.Text = "Port";
this.colPort.Width = 80;
//
// rdoNoMaster
//
this.rdoNoMaster.AutoSize = true;
this.rdoNoMaster.Checked = true;
this.rdoNoMaster.Location = new System.Drawing.Point(11, 50);
this.rdoNoMaster.Name = "rdoNoMaster";
this.rdoNoMaster.Size = new System.Drawing.Size(374, 17);
this.rdoNoMaster.TabIndex = 3;
this.rdoNoMaster.TabStop = true;
this.rdoNoMaster.Text = "This instance should report its check results to an existing Icinga 2 master:";
this.rdoNoMaster.UseVisualStyleBackColor = true;
this.rdoNoMaster.CheckedChanged += new System.EventHandler(this.RadioMaster_CheckedChanged);
//
// rdoNewMaster
//
this.rdoNewMaster.AutoSize = true;
this.rdoNewMaster.Enabled = false;
this.rdoNewMaster.Location = new System.Drawing.Point(11, 22);
this.rdoNewMaster.Name = "rdoNewMaster";
this.rdoNewMaster.Size = new System.Drawing.Size(167, 17);
this.rdoNewMaster.TabIndex = 2;
this.rdoNewMaster.TabStop = true;
this.rdoNewMaster.Text = "This is a new master instance.";
this.rdoNewMaster.UseVisualStyleBackColor = true;
this.rdoNewMaster.CheckedChanged += new System.EventHandler(this.RadioMaster_CheckedChanged);
//
// tbcPages
//
this.tbcPages.Appearance = System.Windows.Forms.TabAppearance.FlatButtons;
......@@ -583,7 +568,7 @@
this.lblX509Prompt.Name = "lblX509Prompt";
this.lblX509Prompt.Size = new System.Drawing.Size(201, 13);
this.lblX509Prompt.TabIndex = 0;
this.lblX509Prompt.Text = "Please verify the master\'s SSL certificate:";
this.lblX509Prompt.Text = "Please verify the master/satellite\'s SSL certificate:";
//
// tabError
//
......@@ -626,6 +611,15 @@
this.picBanner.TabIndex = 1;
this.picBanner.TabStop = false;
//
// introduction1
//
this.introduction1.AutoSize = true;
this.introduction1.Location = new System.Drawing.Point(11, 3);
this.introduction1.Name = "introduction1";
this.introduction1.Size = new System.Drawing.Size(269, 13);
this.introduction1.TabIndex = 6;
this.introduction1.Text = "Welcome to the Icinga 2 Windows Client Setup Wizard!";
//
// SetupWizard
//
this.AcceptButton = this.btnNext;
......@@ -654,7 +648,6 @@
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.tbcPages.ResumeLayout(false);
this.tabRetrieveCertificate.ResumeLayout(false);
this.tabRetrieveCertificate.PerformLayout();
......@@ -694,8 +687,6 @@
private System.Windows.Forms.ListView lvwEndpoints;
private System.Windows.Forms.ColumnHeader colHost;
private System.Windows.Forms.ColumnHeader colPort;
private System.Windows.Forms.RadioButton rdoNoMaster;
private System.Windows.Forms.RadioButton rdoNewMaster;
private System.Windows.Forms.TabControl tbcPages;
private System.Windows.Forms.TabPage tabVerifyCertificate;
private System.Windows.Forms.Label lblX509Prompt;
......@@ -723,6 +714,8 @@
private System.Windows.Forms.CheckBox chkInstallNSCP;
private System.Windows.Forms.TextBox txtUser;
private System.Windows.Forms.CheckBox chkRunServiceAsThisUser;
private System.Windows.Forms.Button btnEditEndpoint;
private System.Windows.Forms.Label introduction1;
}
}
......@@ -54,8 +54,8 @@ namespace Icinga
{
foreach (ListViewItem lvi in lvwEndpoints.Items) {
if (lvi.SubItems.Count > 1) {
host = lvi.SubItems[1].Text;
port = lvi.SubItems[2].Text;
host = lvi.SubItems[1].Text.Trim();
port = lvi.SubItems[2].Text.Trim();
return true;
}
}
......@@ -189,26 +189,26 @@ namespace Icinga
string args = "";
if (rdoNewMaster.Checked)
args += " --master";
Invoke((MethodInvoker)delegate
{
string master_host, master_port;
GetMasterHostPort(out master_host, out master_port);
args += " --master_host " + master_host + "," + master_port;
args += " --master_host " + master_host
+ "," + master_port;
foreach (ListViewItem lvi in lvwEndpoints.Items) {
args += " --endpoint " + lvi.SubItems[0].Text;
args += " --endpoint " + lvi.SubItems[0].Text.Trim();
if (lvi.SubItems.Count > 1)
args += "," + lvi.SubItems[1].Text + "," + lvi.SubItems[2].Text;
if (lvi.SubItems.Count > 1) {
args += "," + lvi.SubItems[1].Text.Trim()
+ "," + lvi.SubItems[2].Text.Trim();
}
}
});
if (rdoListener.Checked)
args += " --listen ::," + txtListenerPort.Text;
args += " --listen ::," + txtListenerPort.Text.Trim();
if (chkAcceptConfig.Checked)
args += " --accept-config";
......@@ -216,10 +216,14 @@ namespace Icinga
if (chkAcceptCommands.Checked)
args += " --accept-commands";
args += " --ticket \"" + txtTicket.Text + "\"";
string ticket = txtTicket.Text.Trim();
if (ticket.Length > 0)
args += " --ticket \"" + ticket + "\"";
args += " --trustedcert \"" + _TrustedFile + "\"";
args += " --cn \"" + txtInstanceName.Text + "\"";
args += " --zone \"" + txtInstanceName.Text + "\"";
args += " --cn \"" + txtInstanceName.Text.Trim() + "\"";
args += " --zone \"" + txtInstanceName.Text.Trim() + "\"";
if (!RunProcess(Program.Icinga2InstallDir + "\\sbin\\icinga2.exe",
"node setup" + args,
......@@ -229,16 +233,19 @@ namespace Icinga
}
SetConfigureStatus(50, "Setting ACLs for the Icinga 2 directory...");
string serviceUser = txtUser.Text.Trim();
DirectoryInfo di = new DirectoryInfo(Program.Icinga2InstallDir);
DirectorySecurity ds = di.GetAccessControl();
FileSystemAccessRule rule = new FileSystemAccessRule(txtUser.Text,
FileSystemAccessRule rule = new FileSystemAccessRule(serviceUser,
FileSystemRights.Modify,
InheritanceFlags.ObjectInherit | InheritanceFlags.ContainerInherit, PropagationFlags.None, AccessControlType.Allow);
try {
ds.AddAccessRule(rule);
di.SetAccessControl(ds);
} catch (System.Security.Principal.IdentityNotMappedException) {
ShowErrorText("Could not set ACLs for \"" + txtUser.Text + "\". Identitiy is not mapped.\n");
ShowErrorText("Could not set ACLs for user \"" + serviceUser + "\". Identitiy is not mapped.\n");
return;
}
......@@ -256,10 +263,10 @@ namespace Icinga
}
if (!RunProcess(Program.Icinga2InstallDir + "\\sbin\\icinga2.exe",
"--scm-install --scm-user \"" + txtUser.Text + "\" daemon",
"--scm-install --scm-user \"" + serviceUser + "\" daemon",
out output)) {
ShowErrorText("\nRunning command 'icinga2.exe --scm-install --scm-user \"" +
txtUser.Text + "\" daemon' produced the following output:\n" + output);
serviceUser + "\" daemon' produced the following output:\n" + output);
return;
}
......@@ -275,6 +282,14 @@ namespace Icinga
SetConfigureStatus(100, "Finished.");
// Override the completed text
lblSetupCompleted.Text = "The Icinga 2 Windows client was set up successfully.";
// Add a note for the user for ticket-less signing
if (ticket.Length == 0) {
lblSetupCompleted.Text += "\n\nTicket was not specified. Please sign the certificate request on the Icinga 2 master node (requires v2.8+).";
}
FinishConfigure();
}
......@@ -311,14 +326,8 @@ namespace Icinga
return;
}
if (txtTicket.Text.Length == 0) {
Warning("Please enter an agent ticket.");
return;
}
if (rdoNoMaster.Checked) {
if (lvwEndpoints.Items.Count == 0) {
Warning("You need to add at least one master endpoint.");
Warning("You need to add at least one master/satellite endpoint.");
return;
}
......@@ -327,7 +336,6 @@ namespace Icinga
Warning("Please enter a remote host and port for at least one of your endpoints.");
return;
}
}
if (rdoListener.Checked && (txtListenerPort.Text == "")) {
Warning("You need to specify a listener port.");
......@@ -335,7 +343,7 @@ namespace Icinga
}
if (txtUser.Text.Length == 0) {
Warning("Icinga2 user may not be empty.");
Warning("Icinga 2 service user may not be empty.");
return;
}
}
......@@ -373,35 +381,12 @@ namespace Icinga
thread.Start();
}
/*if (tbcPages.SelectedTab == tabParameters &&
!File.Exists(Icinga2DataDir + "\\etc\\icinga2\\pki\\agent\\agent.crt")) {
byte[] bytes = Convert.FromBase64String(txtBundle.Text);
MemoryStream ms = new MemoryStream(bytes);
GZipStream gz = new GZipStream(ms, CompressionMode.Decompress);
MemoryStream ms2 = new MemoryStream();
byte[] buffer = new byte[512];
int rc;
while ((rc = gz.Read(buffer, 0, buffer.Length)) > 0)
ms2.Write(buffer, 0, rc);
ms2.Position = 0;
TarReader tr = new TarReader(ms2);
tr.ReadToEnd(Icinga2DataDir + "\\etc\\icinga2\\pki\\agent");
}*/
if (tbcPages.SelectedTab == tabConfigure) {
Thread thread = new Thread(ConfigureService);
thread.Start();
}
}
private void RadioMaster_CheckedChanged(object sender, EventArgs e)
{
lvwEndpoints.Enabled = !rdoNewMaster.Checked;
btnAddEndpoint.Enabled = !rdoNewMaster.Checked;
btnRemoveEndpoint.Enabled = !rdoNewMaster.Checked && lvwEndpoints.SelectedItems.Count > 0;
}
private void RadioListener_CheckedChanged(object sender, EventArgs e)
{
txtListenerPort.Enabled = rdoListener.Checked;
......@@ -478,6 +463,7 @@ namespace Icinga
private void lvwEndpoints_SelectedIndexChanged(object sender, EventArgs e)
{
btnRemoveEndpoint.Enabled = lvwEndpoints.SelectedItems.Count > 0;
btnEditEndpoint.Enabled = lvwEndpoints.SelectedItems.Count > 0;
}
private void lvwX509Fields_SelectedIndexChanged(object sender, EventArgs e)
......@@ -487,7 +473,7 @@ namespace Icinga
ListViewItem lvi = lvwX509Fields.SelectedItems[0];
txtX509Field.Text = (string)lvi.Tag;
txtX509Field.Text = Convert.ToString(lvi.Tag);
}
private void btnRemoveEndpoint_Click(object sender, EventArgs e)
......@@ -503,5 +489,36 @@ namespace Icinga
if (!txtUser.Enabled)
txtUser.Text = Icinga2User;
}
private void btnEditEndpoint_Click(object sender, EventArgs e)
{
ListViewItem lvi = lvwEndpoints.SelectedItems[0];
EndpointInputBox eib = new EndpointInputBox();
eib.Text = "Edit Endpoint";
eib.txtInstanceName.Text = lvi.SubItems[0].Text;
if (lvi.SubItems.Count >= 2) {
eib.txtHost.Text = lvi.SubItems[1].Text;
eib.txtPort.Text = lvi.SubItems[2].Text;
eib.chkConnect.Checked = true;
}
if (eib.ShowDialog(this) == DialogResult.Cancel)
return;
lvwEndpoints.Items.Remove(lvi);
ListViewItem lvi2 = new ListViewItem();
lvi2.Text = eib.txtInstanceName.Text;
if (eib.chkConnect.Checked) {
lvi2.SubItems.Add(eib.txtHost.Text);
lvi2.SubItems.Add(eib.txtPort.Text);
}
lvwEndpoints.Items.Add(lvi2);
}
}
}
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import requests
import re
import pickle
import sys
import os
from datetime import datetime
from collections import defaultdict
from collections import OrderedDict
#################################
## Env Config
try:
github_auth_username = os.environ['ICINGA_GITHUB_AUTH_USERNAME']
except KeyError:
print "ERROR: Environment variable 'ICINGA_GITHUB_AUTH_USERNAME' is not set."
sys.exit(1)
try:
github_auth_token = os.environ['ICINGA_GITHUB_AUTH_TOKEN']
except:
print "ERROR: Environment variable 'ICINGA_GITHUB_AUTH_TOKEN' is not set."
sys.exit(1)
try:
project_name = os.environ['ICINGA_GITHUB_PROJECT']
except:
print "ERROR: Environment variable 'ICINGA_GITHUB_PROJECT' is not set."
sys.exit(1)
#################################
## Config
changelog_file = "CHANGELOG.md" # TODO: config param
debug = 1
# Keep this in sync with GitHub labels.
ignored_labels = [
"high-priority", "low-priority",
"bug", "enhancement",
"needs-feedback", "question", "duplicate", "invalid", "wontfix",
"backported", "build-fix"
]
# Selectively show and collect specific categories
#
# (category, list of case sensitive matching labels)
# The order is important!
# Keep this in sync with GitHub labels.
categories = OrderedDict(
[
("Enhancement", ["enhancement"]),
("Bug", ["bug", "crash"]),
("ITL", ["ITL"]),
("Documentation", ["Documentation"]),
("Support", ["code-quality", "Tests", "Packages", "Installation"])
]
)
#################################
## Helpers
def write_changelog(line):
clfp.write(line + "\n")
def log(level, msg):
if level <= debug:
print " " + msg
def fetch_github_resources(uri, params = {}):
resources = []
url = 'https://api.github.com/repos/' + project_name + uri + "?per_page=100" # 100 is the maximum
while True:
log(2, "Requesting URL: " + url)
resp = requests.get(url, auth=(github_auth_username, github_auth_token), params=params)
try:
resp.raise_for_status()
except requests.exceptions.HTTPError as e:
raise e
data = resp.json()
if len(data) == 0:
break
resources.extend(data)
# fetch the next page from headers, do not count pages
# http://engineering.hackerearth.com/2014/08/21/python-requests-module/
if "next" in resp.links:
url = resp.links['next']['url']
log(2, "Found next link for Github pagination: " + url)
else:
break # no link found, we are done
log(2, "No more pages to fetch, stop.")
return resources
def issue_type(issue):
issue_labels = [label["name"] for label in issue["labels"]]
# start with the least important first (e.g. "Support", "Documentation", "Bug", "Enhancement" as order)
for category in reversed(categories):
labels = categories[category]
for label in labels:
if label in issue_labels:
return category
return "Support"
def escape_markdown(text):
#tmp = text.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;')
tmp = text
tmp.replace('\\', '\\\\')
return re.sub("([<>*_()\[\]#])", r"\\\1", tmp)
def format_labels(issue):
labels = filter(lambda label: label not in ignored_labels, [label["name"] for label in issue["labels"]])
# Mark PRs as custom label
if "pull_request" in issue:
labels.append("PR")
if len(labels):
return " (" + ", ".join(labels) + ")"
else:
return ""
def format_title(title):
# Fix encoding
try:
issue_title = str(title.encode('ascii', 'ignore').encode('utf-8'))
except Error:
log(1, "Error: Cannot convert " + title + " to UTF-8")
# Remove dev.icinga.com tag
issue_title = re.sub('\[dev\.icinga\.com #\d+\] ', '', issue_title)
#log(1, "Issue title: " + issue_title + "Type: " + str(type(issue_title)))
return escape_markdown(issue_title)
#################################
## MAIN
milestones = {}
issues = defaultdict(lambda: defaultdict(list))
log(1, "Fetching data from GitHub API for project " + project_name)
try:
tickets = fetch_github_resources("/issues", { "state": "all" })
except requests.exceptions.HTTPError as e:
log(1, "ERROR " + str(e.response.status_code) + ": " + e.response.text)
sys.exit(1)
clfp = open(changelog_file, "w+")
with open('tickets.pickle', 'wb') as fp:
pickle.dump(tickets, fp)
with open('tickets.pickle', 'rb') as fp:
cached_issues = pickle.load(fp)
for issue in cached_issues: #fetch_github_resources("/issues", { "state": "all" }):
milestone = issue["milestone"]
if not milestone:
continue
ms_title = milestone["title"]
if not re.match('^\d+\.\d+\.\d+$', ms_title):
continue
if ms_title.split(".")[0] != "2":
continue
milestones[ms_title] = milestone
ms_tickets = issues[ms_title][issue_type(issue)]
ms_tickets.append(issue)
# TODO: Generic header based on project_name
write_changelog("# Icinga 2.x CHANGELOG")
write_changelog("")
for milestone in sorted(milestones.values(), key=lambda ms: (ms["due_on"], ms["title"]), reverse=True):
if milestone["state"] != "closed":
continue
if milestone["due_on"] == None:
print "Milestone", milestone["title"], "does not have a due date."
sys.exit(1)
ms_due_on = datetime.strptime(milestone["due_on"], "%Y-%m-%dT%H:%M:%SZ")
write_changelog("## %s (%s)" % (milestone["title"], ms_due_on.strftime("%Y-%m-%d")))
write_changelog("")
ms_description = milestone["description"]
ms_description = re.sub('\r\n', '\n', ms_description)
if len(ms_description) > 0:
write_changelog("### Notes\n\n" + ms_description + "\n") # Don't escape anything, we take care on Github for valid Markdown
for category, labels in categories.iteritems():
try:
ms_issues = issues[milestone["title"]][category]
except KeyError:
continue
if len(ms_issues) == 0:
continue
write_changelog("### " + category)
write_changelog("")
for issue in ms_issues:
write_changelog("* [#" + str(issue["number"]) + "](https://github.com/" + project_name
+ "/issues/" + str(issue["number"]) + ")" + format_labels(issue) + ": " + format_title(issue["title"]))
write_changelog("")
clfp.close()
log(1, "Finished writing " + changelog_file)
......@@ -20,7 +20,7 @@
#define ICINGA_INCLUDECONFDIR "${CMAKE_INSTALL_FULL_DATADIR}/icinga2/include"
#define ICINGA_USER "${ICINGA2_USER}"
#define ICINGA_GROUP "${ICINGA2_GROUP}"
#define ICINGA_SYSCONFIGFILE "${ICINGA2_SYSCONFIGFILE}"
#define ICINGA_BUILD_HOST_NAME "${ICINGA2_BUILD_HOST_NAME}"
#define ICINGA_BUILD_COMPILER_NAME "${ICINGA2_BUILD_COMPILER_NAME}"
#define ICINGA_BUILD_COMPILER_VERSION "${ICINGA2_BUILD_COMPILER_VERSION}"
......
......@@ -3,7 +3,7 @@
## What is Icinga 2? <a id="what-is-icinga2"></a>
Icinga 2 is an open source monitoring system which checks the availability of
your network resources, notifies users of outages, and generates performance
your network resources, notifies users of outages and generates performance
data for reporting.
Scalable and extensible, Icinga 2 can monitor large, complex environments across
......@@ -12,7 +12,7 @@ multiple locations.
## Licensing <a id="licensing"></a>
Icinga 2 and the Icinga 2 documentation are licensed under the terms of the GNU
General Public License Version 2, you will find a copy of this license in the
General Public License Version 2. You will find a copy of this license in the
LICENSE file included in the source package.
## Support <a id="support"></a>
......@@ -24,7 +24,7 @@ or ask an Icinga partner for [professional support](https://www.icinga.com/servi
## Contribute <a id="contribute"></a>
There are many ways to contribute to Icinga -- whether it be sending patches,
testing, reporting bugs, or reviewing and updating the documentation. Every
testing, reporting bugs or reviewing and updating the documentation. Every
contribution is appreciated!
Please continue reading in the [Contributing chapter](https://github.com/Icinga/icinga2/blob/master/CONTRIBUTING.md).
......
......@@ -4,6 +4,9 @@ This tutorial is a step-by-step introduction to installing [Icinga 2](02-getting
and [Icinga Web 2](02-getting-started.md#setting-up-icingaweb2).
It assumes that you are familiar with the operating system you're using to install Icinga 2.
In case you are upgrading an existing setup, please ensure to
follow the [upgrade documentation](16-upgrading-icinga-2.md#upgrading-icinga-2).
## Setting up Icinga 2 <a id="setting-up-icinga2"></a>
First off you have to install Icinga 2. The preferred way of doing this
......@@ -45,19 +48,19 @@ Ubuntu:
RHEL/CentOS 7:
yum install https://packages.icinga.com/epel/7/release/noarch/icinga-rpm-release-7-1.el7.centos.noarch.rpm
yum install https://packages.icinga.com/epel/icinga-rpm-release-7-latest.noarch.rpm
RHEL/CentOS 6:
yum install https://packages.icinga.com/epel/6/release/noarch/icinga-rpm-release-6-1.el6.noarch.rpm
yum install https://packages.icinga.com/epel/icinga-rpm-release-6-latest.noarch.rpm
Fedora 25:
Fedora 26:
dnf install https://packages.icinga.com/fedora/25/release/noarch/icinga-rpm-release-25-1.fc25.noarch.rpm
dnf install https://packages.icinga.com/fedora/icinga-rpm-release-26-latest.noarch.rpm
Fedora 24:
Fedora 25:
dnf install https://packages.icinga.com/fedora/24/release/noarch/icinga-rpm-release-24-1.fc24.noarch.rpm
dnf install https://packages.icinga.com/fedora/icinga-rpm-release-25-latest.noarch.rpm
SLES 11:
......@@ -75,6 +78,11 @@ openSUSE:
# zypper ref
Alpine Linux:
# echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
# apk update
#### RHEL/CentOS EPEL Repository <a id="package-repositories-rhel-epel"></a>
The packages for RHEL/CentOS depend on other packages which are distributed
......@@ -84,7 +92,7 @@ CentOS 7/6:
yum install epel-release
If you are using RHEL you need enable the `optional` repository and then install
If you are using RHEL you need to enable the `optional` repository and then install
the [EPEL rpm package](https://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F).
#### SLES Security Repository <a id="package-repositories-sles-security"></a>
......@@ -97,6 +105,13 @@ as part of the [SLES 11 Security Module](https://www.suse.com/communities/conver
Icinga 2 requires the `libboost_chrono1_54_0` package from the `SLES 12 SDK` repository. Refer to the SUSE Enterprise
Linux documentation for further information.
#### Alpine Linux Notes <a id="package-repositories-alpine-notes"></a>
The example provided assumes that you are running Alpine edge, which is the -dev branch and is a rolling release.
If you are using a stable version please "pin" the edge repository on the latest Icinga 2 package version.
In order to correctly manage your repository, please follow
[these instructions](https://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management)
### Installing Icinga 2 <a id="installing-icinga2"></a>
You can install Icinga 2 by using your distribution's package manager
......@@ -126,6 +141,11 @@ FreeBSD:
# pkg install icinga2
Alpine Linux:
# apk add icinga2
### Enabled Features during Installation <a id="installation-enabled-features"></a>
The default installation will enable three features required for a basic
......@@ -152,16 +172,17 @@ By default Icinga 2 uses the following files and directories:
----------------------------------------------|------------------------------------
/etc/icinga2 | Contains Icinga 2 configuration files.
/usr/lib/systemd/system/icinga2.service | The Icinga 2 Systemd service file on systems using Systemd.
/etc/init.d/icinga2 | The Icinga 2 init script on systems using SysVinit.
/etc/systemd/system/icinga2.service.d/limits.conf | On distributions with Systemd >227, additional service limits are required.
/etc/init.d/icinga2 | The Icinga 2 init script on systems using SysVinit or OpenRC.
/usr/sbin/icinga2 | Shell wrapper for the Icinga 2 binary.
/usr/lib\*/icinga2 | Libraries and the Icinga 2 binary (use `find /usr -type f -name icinga2` to locate the binary path).
/usr/share/doc/icinga2 | Documentation files that come with Icinga 2.
/usr/share/icinga2/include | The Icinga Template Library and plugin command configuration.
/var/lib/icinga2 | Icinga 2 state file, cluster log, master CA, node certificates and configuration files (cluster, api).
/var/run/icinga2 | PID file.
/var/run/icinga2/cmd | Command pipe and Livestatus socket.
/var/cache/icinga2 | status.dat/objects.cache, icinga2.debug files
/var/cache/icinga2 | status.dat/objects.cache, icinga2.debug files.
/var/spool/icinga2 | Used for performance data spool files.
/var/lib/icinga2 | Icinga 2 state file, cluster log, local CA and configuration files (cluster, api).
/var/log/icinga2 | Log file location and compat/ directory for the CompatLogger feature.
FreeBSD uses slightly different paths:
......@@ -176,11 +197,11 @@ By default Icinga 2 uses the following files and directories:
/usr/local/lib/icinga2 | Libraries and the Icinga 2 binary.
/usr/local/share/doc/icinga2 | Documentation files that come with Icinga 2.
/usr/local/share/icinga2/include | The Icinga Template Library and plugin command configuration.
/var/lib/icinga2 | Icinga 2 state file, cluster log, master CA, node certificates and configuration files (cluster, api).
/var/run/icinga2 | PID file.
/var/run/icinga2/cmd | Command pipe and Livestatus socket.
/var/cache/icinga2 | status.dat/objects.cache, icinga2.debug files
/var/cache/icinga2 | status.dat/objects.cache, icinga2.debug files.
/var/spool/icinga2 | Used for performance data spool files.
/var/lib/icinga2 | Icinga 2 state file, cluster log, local CA and configuration files (cluster, api).
/var/log/icinga2 | Log file location and compat/ directory for the CompatLogger feature.
## Setting up Check Plugins <a id="setting-up-check-plugins"></a>
......@@ -202,6 +223,7 @@ RHEL/CentOS | nagios-plugins-all | [EPEL](https://fedoraproject.org/w
SLES/OpenSUSE | monitoring-plugins | [server:monitoring](https://build.opensuse.org/project/repositories/server:monitoring) | /usr/lib/nagios/plugins
Debian/Ubuntu | monitoring-plugins | - | /usr/lib/nagios/plugins
FreeBSD | monitoring-plugins | - | /usr/local/libexec/nagios
Alpine Linux | monitoring-plugins | - | /usr/lib/monitoring-plugins
OS X | nagios-plugins | [MacPorts](https://www.macports.org), [Homebrew](https://brew.sh) | /opt/local/libexec or /usr/local/sbin
The recommended way of installing these standard plugins is to use your
......@@ -236,6 +258,13 @@ FreeBSD:
# pkg install monitoring-plugins
Alpine Linux:
# apk add monitoring-plugins
Note: For Alpine you don't need to explicitly add the `monitoring-plugins` package since it is a dependency of
`icinga2` and is pulled automatically.
Depending on which directory your plugins are installed into you may need to
update the global `PluginDir` constant in your [Icinga 2 configuration](04-configuring-icinga-2.md#constants-conf).
This constant is used by the check command definitions contained in the Icinga Template Library
......@@ -266,16 +295,16 @@ The init script supports the following actions:
checkconfig | The `checkconfig` action checks if the `/etc/icinga2/icinga2.conf` configuration file contains any errors.
status | The `status` action checks if Icinga 2 is running.
By default the Icinga 2 daemon is running as `icinga` user and group
By default, the Icinga 2 daemon is running as `icinga` user and group
using the init script. Using Debian packages the user and group are set to
`nagios` for historical reasons.
### systemd Service <a id="systemd-service"></a>
### Systemd Service <a id="systemd-service"></a>
Some distributions (e.g. Fedora, openSUSE and RHEL/CentOS 7) use systemd. The
Icinga 2 packages automatically install the necessary systemd unit files.
Some distributions (e.g. Fedora, openSUSE and RHEL/CentOS 7) use Systemd. The
Icinga 2 packages automatically install the necessary Systemd unit files.
The Icinga 2 systemd service can be (re-)started, reloaded, stopped and also
The Icinga 2 Systemd service can be (re-)started, reloaded, stopped and also
queried for its current status.
# systemctl status icinga2
......@@ -318,7 +347,30 @@ Examples:
If you're stuck with configuration errors, you can manually invoke the
[configuration validation](11-cli-commands.md#config-validation).
### FreeBSD
Usually Icinga 2 is a mission critical part of infrastructure and should be
online at all times. In case of a recoverable crash (e.g. OOM) you may want to
restart Icinga 2 automatically. With Systemd it is as easy as overriding some
settings of the Icinga 2 Systemd service by creating
`/etc/systemd/system/icinga2.service.d/override.conf` with the following
content:
[Service]
Restart=always
RestartSec=1
StartLimitInterval=10
StartLimitBurst=3
Run `systemctl daemon-reload && systemctl restart icinga2` to apply the changes.
Now Systemd will always try to restart Icinga 2 (except if you run
`systemctl stop icinga2`). After three failures in ten seconds it will stop
trying because you probably have a problem that requires manual intervention.
> **Tip**
>
> If you are running into fork errors with Systemd enabled distributions,
> please check the [troubleshooting chapter](15-troubleshooting.md#check-fork-errors).
### FreeBSD <a id="running-icinga2-freebsd"></a>
On FreeBSD you need to enable icinga2 in your rc.conf
......@@ -326,6 +378,31 @@ On FreeBSD you need to enable icinga2 in your rc.conf
# service icinga2 restart
### SELinux <a id="running-icinga2-selinux"></a>
SELinux is a mandatory access control (MAC) system on Linux which adds
a fine-grained permission system for access to all system resources such
as files, devices, networks and inter-process communication.
Icinga 2 provides its own SELinux policy. `icinga2-selinux` is a policy package
for Red Hat Enterprise Linux 7 and derivatives. The package runs the targeted policy
which confines Icinga 2 including enabled features and running commands.
RHEL/CentOS 7:
```
yum install icinga2-selinux
```
Fedora:
```
dnf install icinga2-selinux
```
Read more about SELinux in [this chapter](22-selinux.md#selinux).
## Configuration Syntax Highlighting <a id="configuration-syntax-highlighting"></a>
Icinga 2 ships configuration examples for syntax highlighting using the `vim` and `nano` editors.
......@@ -340,27 +417,31 @@ Install the package `vim-icinga2` with your distribution's package manager.
Debian/Ubuntu:
$ apt-get install vim-icinga2 vim-addon-manager
$ vim-addon-manager -w install icinga2
# apt-get install vim-icinga2 vim-addon-manager
# vim-addon-manager -w install icinga2
Info: installing removed addon 'icinga2' to /var/lib/vim/addons
RHEL/CentOS/Fedora:
$ yum install vim-icinga2
# yum install vim-icinga2
SLES/openSUSE:
$ zypper install vim-icinga2
# zypper install vim-icinga2
Alpine Linux:
# apk add icinga2-vim
Ensure that syntax highlighting is enabled e.g. by editing the user's `vimrc`
configuration file:
$ vim ~/.vimrc
# vim ~/.vimrc
syntax on
Test it:
$ vim /etc/icinga2/conf.d/templates.conf
# vim /etc/icinga2/conf.d/templates.conf
![Vim with syntax highlighting](images/getting-started/vim-syntax.png "Vim with Icinga 2 syntax highlighting")
......@@ -375,11 +456,11 @@ Debian/Ubuntu:
RHEL/CentOS/Fedora:
$ yum install nano-icinga2
# yum install nano-icinga2
SLES/openSUSE:
$ zypper install nano-icinga2
# zypper install nano-icinga2
Copy the `/etc/nanorc` sample file to your home directory.
......@@ -410,7 +491,7 @@ database is used by a number of projects including
or Icinga Web 1.x.
There is a separate module for each database backend. At present support for
both MySQL and PostgreSQL is implemented.
both MySQL and PostgreSQL has been implemented.
Please choose whether to install [MySQL](02-getting-started.md#configuring-db-ido-mysql) or
[PostgreSQL](02-getting-started.md#configuring-db-ido-postgresql).
......@@ -451,6 +532,13 @@ FreeBSD:
# service mysql-server restart
# mysql_secure_installation
Alpine Linux:
# apk add mariadb
# rc-service mariadb setup
# rc-update add mariadb default
# rc-service mariadb start
#### Installing the IDO modules for MySQL <a id="installing-database-mysql-modules"></a>
The next step is to install the `icinga2-ido-mysql` package using your
......@@ -473,6 +561,11 @@ FreeBSD:
On FreeBSD the IDO modules for MySQL are included with the icinga2 package
and located at /usr/local/share/icinga2-ido-mysql/schema/mysql.sql
Alpine Linux:
On Alpine Linux the IDO modules for MySQL are included with the `icinga2` package
and located at /usr/share/icinga2-ido-mysql/schema/mysql.sql
> **Note**
>
> The Debian/Ubuntu packages provide a database configuration wizard by
......@@ -516,18 +609,17 @@ You can enable the `ido-mysql` feature configuration file using
After enabling the ido-mysql feature you have to restart Icinga 2:
RHEL/CentOS 7/Fedora, SLES 12, Debian Jessie/Stretch, Ubuntu Xenial:
RHEL/CentOS 7/Fedora, SLES 12/openSUSE > 12.2, Debian Jessie/Stretch, Ubuntu Xenial:
# systemctl restart icinga2
Debian/Ubuntu, RHEL/CentOS 6 and SUSE 11:
Debian/Ubuntu, RHEL/CentOS 6, SLES 11/openSUSE < 12.3 and FreeBSD:
# service icinga2 restart
FreeBSD:
# service icinga2 restart
Alpine Linux:
# rc-service icinga2 restart
Continue with the [webserver setup](02-getting-started.md#icinga2-user-interface-webserver).
......@@ -543,6 +635,7 @@ RHEL/CentOS 6:
# yum install postgresql-server postgresql
# chkconfig postgresql on
# service postgresql initdb
# service postgresql start
RHEL/CentOS 7:
......@@ -556,14 +649,23 @@ SUSE:
# zypper install postgresql postgresql-server
# chkconfig postgresql on
# service postgresql initdb
# service postgresql start
FreeBSD:
# pkg install postgresql93-server
# sysrc postgresql_enable=yes
# service postgresql initdb
# service postgresql start
Alpine Linux:
# apk add postgresql
# rc-update add postgresql default
# rc-service postgresql setup
# rc-service postgresql start
#### Installing the IDO modules for PostgreSQL <a id="installing-database-postgresql-modules"></a>
The next step is to install the `icinga2-ido-pgsql` package using your
......@@ -586,6 +688,11 @@ FreeBSD:
On FreeBSD the IDO modules for PostgreSQL are included with the icinga2 package
and located at /usr/local/share/icinga2-ido-pgsql/schema/pgsql.sql
Alpine Linux:
On Alpine Linux the IDO modules for PostgreSQL are included with the `icinga2` package
and located at /usr/share/icinga2-ido-pgsql/schema/pgsql.sql
> **Note**
>
> Upstream Debian packages provide a database configuration wizard by default.
......@@ -654,17 +761,17 @@ You can enable the `ido-pgsql` feature configuration file using
After enabling the ido-pgsql feature you have to restart Icinga 2:
RHEL/CentOS 7/Fedora, SLES 12, Debian Jessie/Stretch, Ubuntu Xenial:
RHEL/CentOS 7/Fedora, SLES 12/openSUSE > 12.2, Debian Jessie/Stretch, Ubuntu Xenial:
# systemctl restart icinga2
Debian/Ubuntu, RHEL/CentOS 6, SUSE and FreeBSD:
Debian/Ubuntu, RHEL/CentOS 6, SLES 11/openSUSE < 12.3 and FreeBSD:
# service icinga2 restart
FreeBSD:
Alpine Linux:
# service icinga2 restart
# rc-service icinga2 restart
Continue with the [webserver setup](02-getting-started.md#icinga2-user-interface-webserver).
......@@ -704,6 +811,13 @@ FreeBSD (nginx, but you could also use the apache24 package):
# service php-fpm start
# service nginx start
Alpine Linux:
# apk add apache2 php7-apache2
# sed -i -e "s/^#LoadModule rewrite_module/LoadModule rewrite_module/" /etc/apache2/httpd.conf
# rc-update add apache2 default
# rc-service apache2 start
### Firewall Rules <a id="icinga2-user-interface-firewall-rules"></a>
Example:
......@@ -744,24 +858,24 @@ attribute with minimal permissions required by Icinga Web 2.
Make sure to restart Icinga 2 to activate the configuration.
RHEL/CentOS 7/Fedora, SLES 12, Debian Jessie/Stretch, Ubuntu Xenial:
RHEL/CentOS 7/Fedora, SLES 12/openSUSE > 12.2, Debian Jessie/Stretch, Ubuntu Xenial:
# systemctl restart icinga2
Debian/Ubuntu, RHEL/CentOS 6 and SUSE:
Debian/Ubuntu, RHEL/CentOS 6, SLES 11/openSUSE < 12.3 and FreeBSD:
# service icinga2 restart
FreeBSD:
Alpine Linux:
# service icinga2 restart
# rc-service icinga2 restart
### Installing Icinga Web 2 <a id="installing-icingaweb2"></a>
Please consult the [installation documentation](https://github.com/Icinga/icingaweb2/blob/master/doc/02-Installation.md)
Please consult the [installation documentation](https://www.icinga.com/docs/icingaweb2/latest/doc/02-Installation/)
for further instructions on how to install Icinga Web 2.
The Icinga 2 API can be defined as [command transport](https://github.com/Icinga/icingaweb2/blob/master/modules/monitoring/doc/commandtransports.md)
The Icinga 2 API can be defined as [command transport](https://www.icinga.com/docs/icingaweb2/latest/modules/monitoring/doc/05-Command-Transports/)
in Icinga Web 2 >= 2.4.
## Addons <a id="install-addons"></a>
......@@ -775,5 +889,6 @@ popular addons is available in the
Ensure to include the following in your backups:
* Configuration files in `/etc/icinga2`
* Runtime files in `/var/lib/icinga2` (the master's CA is stored here as well)
* Certificate files in `/var/lib/icinga2/ca` (Master CA key pair) and `/var/lib/icinga2/certs` (node certificates)
* Runtime files in `/var/lib/icinga2`
* Optional: IDO database backup
This diff is collapsed.
# Configuring Icinga 2: First Steps <a id="configuring-icinga2-first-steps"></a>
This chapter provides an introduction into best practices with your Icinga 2 configuration.
This chapter provides an introduction into best practices for your Icinga 2 configuration.
The configuration files which are automatically created when installing the Icinga 2 packages
are a good way to start with Icinga 2.
......@@ -159,21 +159,6 @@ This `include` directive takes care of including the configuration files for all
the features which have been enabled with `icinga2 feature enable`. See
[Enabling/Disabling Features](11-cli-commands.md#enable-features) for more details.
/**
* The repository.d directory contains all configuration objects
* managed by the 'icinga2 repository' CLI commands.
*/
include_recursive "repository.d"
This `include_recursive` directive is used for discovery of services on remote clients
and their generated configuration described in
[this chapter](06-distributed-monitoring.md#distributed-monitoring-bottom-up).
**Note**: This has been DEPRECATED in Icinga 2 v2.6 and is **not** required for
satellites and clients using the [top down approach](#06-distributed-monitoring.md#distributed-monitoring-top-down).
You can safely disable/remove it.
/**
* Although in theory you could define all your objects in this file
* the preferred way is to create separate directories and files in the conf.d
......@@ -192,7 +177,7 @@ By default, you need to make sure to set these constants:
* The `PluginDir` constant must be set to the path where the [Monitoring Project plugins](02-getting-started.md#setting-up-check-plugins) are installed.
This constant is used by a number of
[built-in check command definitions](10-icinga-template-library.md#plugin-check-commands).
[built-in check command definitions](10-icinga-template-library.md#icinga-template-library).
* The `NodeName` constant defines your local node name. Should be set to FQDN which is the default
if not set. This constant is required for local host configuration, monitoring remote clients and
cluster setup.
......@@ -265,7 +250,6 @@ Available configuration files which are installed by default:
* [templates.conf](04-configuring-icinga-2.md#templates-conf)
* [downtimes.conf](04-configuring-icinga-2.md#downtimes-conf)
* [timeperiods.conf](04-configuring-icinga-2.md#timeperiods-conf)
* [satellite.conf](04-configuring-icinga-2.md#satellite-conf)
* [api-users.conf](04-configuring-icinga-2.md#api-users-conf)
* [app.conf](04-configuring-icinga-2.md#app-conf)
......@@ -281,13 +265,13 @@ takes care of setting up the host check command to `hostalive`. If you
require a different check command, you can override it in the object definition.
The `vars` attribute can be used to define custom attributes which are available
for check and notification commands. Most of the [Plugin Check Commands](10-icinga-template-library.md#plugin-check-commands)
for check and notification commands. Most of the [Plugin Check Commands](10-icinga-template-library.md#icinga-template-library)
in the Icinga Template Library require an `address` attribute.
The custom attribute `os` is evaluated by the `linux-servers` group in
[groups.conf](04-configuring-icinga-2.md#groups-conf) making the local host a member.
The example host will show you how to
The example host will show you how to:
* define http vhost attributes for the `http` service apply rule defined
in [services.conf](04-configuring-icinga-2.md#services-conf).
......@@ -376,17 +360,17 @@ By default, the local host will be monitored by the following services
Service(s) | Applied on host(s)
--------------------------------------------|------------------------
`load`, `procs`, `swap`, `users`, `icinga` | The `NodeName` host only
`ping4`, `ping6` | All hosts with `address` resp. `address6` attribute
`load`, `procs`, `swap`, `users`, `icinga` | The `NodeName` host only.
`ping4`, `ping6` | All hosts with `address` resp. `address6` attribute.
`ssh` | All hosts with `address` and `vars.os` set to `Linux`
`http`, optional: `Icinga Web 2` | All hosts with custom attribute `http_vhosts` defined as dictionary
`disk`, `disk /` | All hosts with custom attribute `disks` defined as dictionary
`http`, optional: `Icinga Web 2` | All hosts with custom attribute `http_vhosts` defined as dictionary.
`disk`, `disk /` | All hosts with custom attribute `disks` defined as dictionary.
The Debian packages also include an additional `apt` service check applied to the local host.
The command object `icinga` for the embedded health check is provided by the
[Icinga Template Library (ITL)](10-icinga-template-library.md#icinga-template-library) while `http_ip`, `ssh`, `load`, `processes`,
`users` and `disk` are all provided by the [Plugin Check Commands](10-icinga-template-library.md#plugin-check-commands)
`users` and `disk` are all provided by the [Plugin Check Commands](10-icinga-template-library.md#icinga-template-library)
which we enabled earlier by including the `itl` and `plugins` configuration file.
......@@ -407,7 +391,7 @@ The `apply` keyword can be used to create new objects which are associated with
another group of objects. You can `import` existing templates, define (custom)
attributes.
The custom attribe `backup_downtime` is defined to a specific timerange string.
The custom attribute `backup_downtime` is defined to a specific timerange string.
This variable value will be used for applying a `ScheduledDowntime` object to
these services in [downtimes.conf](04-configuring-icinga-2.md#downtimes-conf).
......@@ -430,7 +414,7 @@ as shown in the `ssh` example:
In this example, the service `ssh` is applied to all hosts having the `address`
attribute defined `AND` having the custom attribute `os` set to the string
`Linux`.
You can modify this condition to match multiple expressions by combinding `AND`
You can modify this condition to match multiple expressions by combining `AND`
and `OR` using `&&` and `||` [operators](17-language-reference.md#expression-operators), for example
`assign where host.address && (vars.os == "Linux" || vars.os == "Windows")`.
......@@ -636,7 +620,7 @@ default:
}
The `hostalive` check command is part of the
[Plugin Check Commands](10-icinga-template-library.md#plugin-check-commands).
[Plugin Check Commands](10-icinga-template-library.md#icinga-template-library).
template Notification "mail-host-notification" {
......@@ -697,18 +681,6 @@ and `never`. TimePeriod objects are referenced by `*period`
objects such as hosts, services or notifications.
#### satellite.conf <a id="satellite-conf"></a>
Includes default templates and dependencies for
[monitoring remote clients](06-distributed-monitoring.md#distributed-monitoring)
using service discovery and
[config generation](06-distributed-monitoring.md#distributed-monitoring-bottom-up)
on the master. Can be ignored/removed on setups not using this feature.
Further details on the monitoring configuration can be found in the
[monitoring basics](03-monitoring-basics.md#monitoring-basics) chapter.
#### api-users.conf <a id="api-users-conf"></a>
Provides the default [ApiUser](09-object-types.md#objecttype-apiuser) object
......
......@@ -49,7 +49,7 @@ configuration which can be used in the [Service](09-object-types.md#objecttype-s
[Host](09-object-types.md#objecttype-host) object definition.
Please check if the Icinga 2 package already provides an
[existing CheckCommand definition](10-icinga-template-library.md#plugin-check-commands).
[existing CheckCommand definition](10-icinga-template-library.md#icinga-template-library).
If that's the case, throroughly check the required parameters and integrate the check command
into your host and service objects.
......
This diff is collapsed.