Commit Graph

415 Commits

Author SHA1 Message Date
Julian Brost 23aa628665 Windows: automatically migrate from mainlog to windowseventlog 2021-06-21 15:15:54 +02:00
Julian Brost 6de9f58810 Add WindowsEventLogLogger 2021-06-21 15:15:54 +02:00
Benedikt Heine a71c105335 Run shellcheck over initscripts
Mainly quoting all variables
2020-12-27 16:57:23 +01:00
Benedikt Heine ebb2ec7e92 Use tabs for indentation
Except for the switch case, the script was written with tab indentation.
With tabstop of 4 spaces, the indentation in the switch case would make
sense, but I assume this is just a glitch of the editor.
2020-12-27 16:34:02 +01:00
Benedikt Heine d4251ea5ca Exit from script instead of subshell on missing user
When executing `false || (echo bad; exit 1)`, the call to `exit` won't
exit the script, it will only exit the subshell and the exit code will
be stored in the return code `$?`.

Since this is an error, we have to exit the script properly.
2020-12-27 16:29:37 +01:00
Alexander Aleksandrovič Klimov 12fd687e1a
Merge pull request #7915 from Icinga/bugfix/scripts-sh
etc/icinga2/scripts/*.sh: explicitly specify shell
2020-11-13 17:02:30 +01:00
Noah Hilverling b37aaa27e1
Merge pull request #8045 from Icinga/bugfix/prepare-dirs-chmod
prepare-dirs: combine mkdir and chmod
2020-06-09 13:59:33 +02:00
Alexander A. Klimov 2f0f2e8c35 prepare-dirs: combine mkdir and chmod 2020-06-08 15:14:29 +02:00
Alexander A. Klimov db400b3f19 etc/icinga2/scripts/*.sh: explicitly specify shell 2020-03-18 12:30:33 +01:00
Michael Insel c783448395 Revert "set correct utf8 email subject headers (RFC1342)"
This reverts commit 415552f355.
2019-12-09 19:36:35 +01:00
Michael Insel 98f656c266 Revert "service and host mail-notifications, add line-breaks to very long output strings"
This reverts commit c2b6f6b246.
2019-12-09 19:33:15 +01:00
vigiroux 52e09a287d Fix bash line continuation in mail-host-notification.sh 2019-12-06 15:00:42 -05:00
Michael Insel 901d25976d Fix notification scripts string comparison
fixes #7609
2019-11-21 20:01:55 +01:00
Noah Hilverling c8935bf14f IcingaDB: Update Redis port to use Icinga-Redis 2019-11-21 09:59:21 +01:00
Michael Friedrich 1a503b554b
Merge pull request #7357 from Ant1x/feature/opentsdb-tags
OpenTsdbWriter - Custom Tag Support
2019-11-15 14:52:49 +01:00
Michael Friedrich 09892a9cd5
Merge pull request #6822 from unki/change/add-line-breaks-to-service-output
service and host mail-notifications, add line-breaks to very long out…
2019-11-14 13:18:20 +01:00
Michael Friedrich 05971d401c
Merge pull request #6369 from islander/fix/utf8-headers
Set correct utf-8 email subject header (RFC1342)
2019-11-14 13:14:20 +01:00
Alexander Aleksandrovič Klimov 13ab7eb609 Rename redis to icingadb 2019-11-02 14:00:24 +01:00
Alexander Aleksandrovič Klimov f51454af65 git ls-files -z |xargs -0 perl -pi -e 's/RedisWriter/IcingaDB/g' 2019-11-02 14:00:24 +01:00
Gunnar Beutner b75e21a998 Redis support (WIP) 2019-11-02 14:00:23 +01:00
Ant1x 166e79fee1 Added OpenTSDB Metric prefix naming support
Added OpenTSDB Generic Metric functionality
2019-10-24 00:04:12 +11:00
Ant1x 9c5bbdfe10 Added OpenTSDB custom tagging documentation
Added OpenTSDB custom tagging configuration template
2019-10-24 00:04:12 +11:00
Michael Friedrich ac684ec128 Adjust zones.d/README and just point to the docs 2019-09-24 12:57:32 +02:00
Michael Friedrich b837b505e6 Update wrong information in example config for zones.d 2019-09-23 09:46:13 +02:00
kiba eef077a8a3
Merge branch 'master' into fix/utf8-headers 2019-09-20 09:52:55 +11:00
Michael Friedrich 5aa07b51a2 Docs: Rename 'custom attribute' to 'custom variable'
refs #6830
2019-07-19 14:38:59 +02:00
Michael Friedrich aabfcfef9e
Merge pull request #7065 from uubk/logrotate-fix
Fix logrotate "Operation not permitted"
2019-07-08 09:47:18 +02:00
Michael Friedrich f8a82b5e28
Merge pull request #7183 from hlsolutions/bugfix/systemv-returncode
Fix System-V return codes according to LSB
2019-06-06 13:31:41 +02:00
Michael Friedrich b7279597d9
Merge pull request #7118 from Icinga/bugfix/killmode
Systemd: don't kill any running check plugins
2019-06-06 12:55:01 +02:00
Robert Scheck bb503cce16 Strip '\r' in notification messages to avoid 'Content-Type: application/octet-stream'
Without this patch, an accidential `\r` in e.g. `$NOTIFICATIONCOMMENT`
leads to a `Content-Type: application/octet-stream` header in e-mails.
The accidential `\r` might slip in usually using Icinga/Nagios apps...
2019-05-16 12:44:29 +02:00
Sascha Westermann a761adad8a Fix System-V return codes according to LSB
- "status"-calls use different exit codes, refer to http://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/iniscrptact.html
- the "status"-call in "condrestart" returned an error if the daemon was not running: this has been fixed
2019-05-14 11:22:05 +02:00
Alexander A. Klimov fad2dc82ce Systemd: don't kill any running check plugins 2019-05-10 13:14:39 +02:00
Maximilian Falkenstein a205fd0887
Fix logrotate "Operation not permitted"
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.
2019-03-31 22:16:06 +02:00
Michael Friedrich 37b715baf1 Replace a few more copyright strings 2019-02-25 16:30:40 +01:00
Michael Friedrich 458f997a18 Replace Copyright header with a short version, part II 2019-02-25 15:09:36 +01:00
Andreas Unterkircher c2b6f6b246 service and host mail-notifications, add line-breaks to very long output strings 2018-12-05 07:53:04 +01:00
Martijn van Duren a763e74a50 Make mail-{host,service}-notification.sh as POSIX-compliant as possible. 2018-11-16 14:23:56 +01:00
Michael Friedrich 6a4c5e6bcb Imitialize ICINGA2_ERROR_LOG inside the Systemd environment
The initscript uses a local default, which is not here for Systemd.
2018-11-13 14:02:03 +01:00
Schanz, Jens 2754175c6e fixes #6758
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
2018-11-09 13:17:08 +01:00
Michael Friedrich 3cb2c1d143 icinga.com: Update everything else 2018-10-18 09:50:53 +02:00
Michael Friedrich dea5ec614e icinga.com: Update CMakeLists.txt 2018-10-18 09:35:18 +02:00
Jean Flach 72cc41d14e
Merge pull request #6356 from sourcejedi/fix/systemd
Fix logging under systemd
2018-09-04 15:24:43 +02:00
Michael Friedrich 64305b4466 Fix using full path in prepare-dirs/safe-reload scripts
This won't be visible with packages and overridden paths,
just source builds which invoke the scripts manually.

refs #6506
2018-09-03 16:47:38 +02:00
Alan Jenkins a21166dcf8 Fix logging under systemd
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 ...`.
2018-08-25 10:21:06 +01:00
Markus Frosch 9fbc40615a Improve path handling in cmake and daemon 2018-08-07 14:10:26 +02:00
Jean Flach 383ca5011c Load functions first
refs #6449
2018-07-18 13:36:37 +02:00
Jean Flach 92056c592e Use . instead of source
fixes #6450
2018-07-18 13:35:27 +02:00
Michael Friedrich c4c6f2064d Revert "Fix obsolete parameter in Systemd script"
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
2018-07-17 14:10:26 +02:00
Jean Flach 44fae88d43 Update sysconfig read 2018-06-18 10:27:35 +02:00
Jean Flach 2b5ea38217 Fix sysconfig not bein handled correctly by sysvinit 2018-06-15 17:04:28 +02:00