PR 75 (commit afb6346) added support for the 'su' directive of
logrotate. However, when using 'su', we cannot chown to arbitrary file
owners anymore, which means that unless the file has already been
created with the same permissions we'll get an error.
Fix this by not using chown and su together.
Add target network-online.target as requirement.
Service Icinga2 won't start before target is finally reached.
This prevents Icinga2 from failing if no entry for hostname.domain
is set in /etc/hosts
icinga2.service used `-e ${ICINGA2_ERROR_LOG}`, but this is documented
as having no effect without `-d`. Furthermore, icinga2 under systemd
unconditionally logged everything to the system log (but without setting
the log level etc), which contradicted the documentation. (Issue #6339)
Stop icinga2 on systemd from logging to stdout - and hence the system log -
once it has finished starting up. Just like when you start icinga2 from a
terminal using `-d`. And just like -d, we stop logging fatal errors to
stderr, and instead write to the log file passed with `-e`.
As per docs, mainlog (icinga2.log) is already enabled by default. And
pre-startup messages including config errors will still appear in the
system log.
This uses a new option --close-stdio, which has the same effect on logging as
--daemonize, but does not fork or call setsid().
For this purpose, I moved setsid() up and into Daemonize().
Consequence of that last point: if anyone is weird enough to specify a TTY
device file as the fatal error log (-e option), that will become icinga's
controlling terminal, which you generally don't want as a daemon. This
makes it consistent with the existing behaviour for icinga mainlog. For
this reason you're supposed to use O_NOCTTY in Linux daemons. But I wasn't
sure where icinga would want to put the ugly `#ifdef _WIN32 ... #else ...`.
This reverts commit 592fb22c7f.
We have the problem that Systemd doesn't expand shell variables
into our environment.
During the upgrade cycle this would maybe render a wrong PID file
location, thus resulting in wrong 'safe-reload' behaviour.
This is only for a clean upgrade path from 2.8.x to 2.9.0,
the proper fix is to ensure that the sysconfig file is empty
and keep our own defaults, or modified from the user.
refs #6434
The sysconfig file now only contains the defaults as comments, changes
made there are given to the init.d script, prepare-dirs, safe-reload and
Icinga 2 itself. If nothing is set in the sysconfig file (as is the
default as all lines are commented out) the defaults are used.
fixes#6255
This better reflects its purpose as otherwise it would imply
that you need Elastic Stack for it. Graylog also reads from
Elasticsearch instances, this could serve as additional integration
here.
Main focus: Object attributes and their value types. Originates from the
API Event Streams patch to document their value types. Now applied to
the entire configuration objects chapter.
The API chapter and their value types has been changed to capitalized
type identifiers.
Value types are now explicitly told about inside monitoring basics. This
has been adopted into the Icinga 2 training material a long time ago
and finds its way into the docs too.
The CheckResult and PerfdataValue value types have been moved into the
advanced topics chapter. mkdocs doesn't like multiple `#` headings in one file
and did just hide it.
Also moved the Influxdb details into the features documentation where it
belongs.
Many small references and URLs to other chapters added.
E.g. dedicated chapters for object accessor examples, to better link against
time dependent thresholds.
Can serve as patch basis and reference for ITL documentation where the
value types are missing too.
This commit also fixes the non-requirement of "legacy-timeperiod" which
also is a default template import since 2.6.
This also fixes the state mapping issue.
fixes#4015
This also disables setting a value by default.
Packaging should decide to install the config file:
`/etc/systemd/system/icinga2.service.d`
fixes#5611
Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>
This makes it easier for cluster and client setups with or
without the Icinga Director.
Note: Clients will still not receive synced configuration if
accept_config is not enabled (which is the default, and can be changed
during setup).
fixes#5106
Replace the previous notification scheme - now using getops in place of ENV
variables, giving the ability to integrate with the Icinga Director.
refs #5170
Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>
This helps a lot when configuring client checks as command endpoint
where the check command definitions are both used on the master
and the client.
fixes#10722
Adds an Icinga2 object to directly interface with InfluxDB's native HTTP API.
This supports optional basic authorization, and TLS transport. InfluxDB didn't
appear to like having the TLS stream kept open, so instead this object buffers
data points which are then flushed to InfluxDB as a batch write, either driven
by a configurable timeout or threshold.
As InfluxDB is a schema-less database the host and service templates are user
configurable allowing both the measurement field and tags to be set by the
end user via macro expansion. This allows access to tag fields from arbitrary
data associated with host.vars or service.vars. If a particular value is
unable to be resolved, the tag will be dropped and not transmitted to InfluxDB.
Also alters URL handling to omit array brackets when only a single value is
attached to a key, otherwise InfluxDB has a strop with non-standard syntax.
fixes#10480
Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
- try to detect a recent logrotate version which supports the 'su'
directive (added in 3.8.0, see
5be96cf182 (diff-e4eb329834da3d36278b1b7d943b3bc9R6))
- if logrotate can't be found, assume an old version is used
- allow the parameter to be forced by the user
fixes#9249
Signed-off-by: Gunnar Beutner <gunnar@beutner.name>
Icinga2 fails with 'Cannot bind TCP socket for host',
if other services requiring network.target are not installed.
Signed-off-by: Jean Flach <jean-marcel.flach@netways.de>
fixes#10968