Commit Graph

4491 Commits

Author SHA1 Message Date
Michael Friedrich 3cb2c1d143 icinga.com: Update everything else 2018-10-18 09:50:53 +02:00
Michael Friedrich a2cb542a2e icinga.com: Update '*.sql' 2018-10-18 09:41:54 +02:00
Michael Friedrich eabea68c56 icinga.com: Update config files (ITL, etc.) 2018-10-18 09:37:59 +02:00
Michael Friedrich dea5ec614e icinga.com: Update CMakeLists.txt 2018-10-18 09:35:18 +02:00
Michael Friedrich 44c3b83769 icinga.com: Update '*.ti' 2018-10-18 09:30:00 +02:00
Michael Friedrich dab53448bc icinga.com: Update *.{h,c}pp 2018-10-18 09:27:04 +02:00
Michael Friedrich af6c8a1f50 Add missing shutdown/program state dumps for SIGUSR2 reload handler
Credits to @west0rmann finding the issue and providing the initial fix.

fixes #6689
fixes #6592
2018-10-16 12:36:43 +02:00
Michael Friedrich 34de8104b8 Fix regression with API permission filters and namespaces in v2.10
fixes #6682
2018-10-15 15:47:11 +02:00
Michael Friedrich 43a571e013 Don't throw an error when namespace indexers don't find a valid key
Examples:

```
globals["abc"]
globals.def
```

The patch for the Icinga Director unfortunately only solves the
master, and as discussed with @lippserd we need to ensure that
satellites and clients with 2.10 can be restarted without any errors
from deployed configuration.

refs #6509
refs icinga/icingaweb2-module-director#1654
2018-10-11 12:42:56 +02:00
Michael Friedrich 4be9f418a9 Revert "Initialize Socket Event Engine on application startup"
This reverts commit c8dcd1297f.

We cannot do this during application startup, since Daemonize()
kills the threads again.

refs #6514
refs #6630
2018-10-09 19:38:29 +02:00
Michael Friedrich 85e161ea1e Silence config compiler logging for runtime created objects
This is especially problematic with many single creation requests,
e.g. many downtimes created via Icinga Web 2 & the REST API.

In addition to the config compiler messages, apply rule matches are
also in there which are removed by this patch.
2018-10-09 16:41:17 +02:00
Michael Friedrich 83a428c1ba Keep the HTTP server connection open until the stream is EOF
fixes #4968
2018-10-09 16:01:43 +02:00
Michael Friedrich e6eb703b36
Merge pull request #6661 from Icinga/bugfix/cache-http-peer-address
Cache the peer address in the HTTP server
2018-10-09 16:00:27 +02:00
Michael Friedrich 5c32a5a7dc Cache the peer address in the HTTP server
Later socket calls are expensive and might lead
into a race condition on close when logging it.

refs #6655
2018-10-09 15:40:16 +02:00
Michael Friedrich 58cfc3955d
Merge pull request #6658 from Icinga/bugfix/api-connection-close-req-by-client
Ensure that HTTP/1.0 or 'Connection: close' headers are properly disconnecting the client
2018-10-09 13:49:22 +02:00
Michael Friedrich 9352f4bfb3
Merge pull request #6657 from Icinga/feature/api-debug-log-request-body
Enable the HTTP request body debug log entry for release builds
2018-10-09 13:29:00 +02:00
Michael Friedrich 13239c3172 Ensure that HTTP/1.0 or Connection: close headers are properly disconnecting the client
Test results: https://github.com/Icinga/icinga2/issues/6514#issuecomment-428155731

fixes #6514
2018-10-09 13:23:23 +02:00
Michael Friedrich 73263b7702 Enable the HTTP request body debug log entry for release builds
fixes #4282
2018-10-09 12:55:53 +02:00
Michael Friedrich 57081176de Improve logging for disconnected HTTP clients
Previously this was inside the debug log, with the
new socket printers we can enhance checking for proper
connects and disconnects.

refs #6514
2018-10-09 12:22:19 +02:00
Michael Friedrich 051b3ba9b7
Merge pull request #6503 from peteeckel/fix/reduce-loglevel-plugin-env-6460
Reduce the log level for missing env macros to debug
2018-10-08 14:09:18 +02:00
Alexander A. Klimov 6d114b16e4 node setup: always respect --accept-config and --accept-commands 2018-10-01 16:33:50 +02:00
Michael Friedrich 617925374b Fix that check_timeout was used for Event/Notification commands too
We may add specific timeouts for event/notification commands
later, for now the original timeout inside the EventCommand/NotificationCommand
is used.

fixes #6304
2018-09-28 14:32:57 +02:00
Michael Friedrich 7acf3689a7
Merge pull request #6642 from Icinga/bugfix/concurrent-checks-constant
Allow to override MaxConcurrentChecks constant
2018-09-28 09:34:53 +02:00
Michael Friedrich 82178e3b33 Don't inherit daemonize parameter from parent process 2018-09-27 20:30:19 +02:00
Thomas Forrer 816cae98fa Fix config validation problem (startup.log) during /v1/config/stages API call
copy all arguments of parent process in AsyncTryActivateStage
2018-09-27 20:27:09 +02:00
Michael Friedrich 96c0de9bea Allow to override MaxConcurrentChecks constant 2018-09-27 20:23:00 +02:00
Michael Friedrich 64e273afdd
Merge pull request #6639 from Icinga/fix/windows-api-log-rename
Ensure to _unlink before renaming replay log on Windows
2018-09-27 08:02:00 +02:00
Jordi van Scheijen bc1dc9c7a7 Fix issue 5022 2018-09-27 07:52:37 +02:00
Michael Friedrich c979f86e4e
Merge pull request #6632 from Icinga/feature/cluster-faster-reconnect
Increase the cluster reconnect frequency to 10s
2018-09-25 17:07:01 +02:00
Michael Friedrich cbde35ff22 Use a dynamic thread pool for API connections
The full analysis is located in #6517.

fixes #6517
2018-09-25 12:43:10 +02:00
Michael Friedrich cd819f74f4 Increase the cluster reconnect frequency to 10s
This is blocked by #6517.

refs #6234
2018-09-25 12:36:30 +02:00
Michael Friedrich c8dcd1297f Initialize Socket Event Engine on application startup
Previously this happened inside the TlsStream constructor
during the first connection attempt.
2018-09-24 15:50:59 +02:00
Michael Friedrich eee4426dcb
Merge pull request #6622 from Icinga/bugfix/ido-pgsql-cleanup-timestamp-utc
Ensure to use UTC timestamps for IDO PgSQL cleanup queries
2018-09-17 11:20:49 +02:00
Michael Friedrich 3038b150a9
Merge pull request #6616 from Icinga/feature/tls-handshake-timeout-config
Add ApiListener#tls_handshake_timeout option
2018-09-17 11:20:12 +02:00
Michael Friedrich 05f7e0dae8
Merge pull request #6621 from Icinga/bugfix/ido-remove-unused-timestamp-function
Remove unused timestamp function in DB IDO
2018-09-17 11:16:47 +02:00
Michael Friedrich 5d36546a99 Ensure to use UTC timestamps for IDO PgSQL cleanup queries
refs #6584
2018-09-17 11:06:54 +02:00
Michael Friedrich c0c17fc340 Remove unused timestamp function in DB IDO
refs #6584
2018-09-17 10:06:30 +02:00
Michael Friedrich b81ac972b9 Silence compiler warning for nice() 2018-09-14 14:29:52 +02:00
Michael Friedrich 29701b4db5 Add ApiListener#tls_handshake_timeout option
This allows to specify the previously hardcoded
timeout of 10s.

refs #6517
2018-09-14 09:20:09 +02:00
Michael Friedrich c8d4e785a1
Merge pull request #6519 from Icinga/fix/erroneous-console-exit
Reset terminal on erroneous console exit
2018-09-13 13:34:58 +02:00
Michael Friedrich af1f2e0c55 Only check for Problem types in user filers for Recovery/Acknowledgement notifications
refs #6047
2018-09-12 17:09:15 +02:00
Noah Hilverling 834e37d3e2 Still notify on acknowledgement and recovery if user does not get problem notifications at all
refs #6047
2018-09-12 14:54:45 +02:00
Noah Hilverling bfe7d46a68 Only send acknowledgement notification if user received a problem notification
refs #6047
2018-09-12 14:54:45 +02:00
Michael Friedrich dd59964702
Merge pull request #6596 from Icinga/bugfix/gcc-8-f28-hardening-crash
Fix crash on API queries with Fedora 28 hardening and GCC 8
2018-09-11 20:44:12 +02:00
Michael Friedrich f297881e23 Call SSL_shutdown() at least twice 2018-09-10 16:10:16 +02:00
Noah Hilverling 3854ed683b Improve TLS handshake exception logging 2018-09-06 15:58:42 +02:00
Michael Friedrich 1f4f6282c7 Fix crash on API queries with Fedora 28 hardening and GCC 8
The actual fix is to handle nullptr references differently
for an empty filter expression. The other changes include
oob checks not necesarily involved.

fixes #6533
2018-09-06 09:56:04 +02:00
Michael Friedrich 9a75f47fc5 Allow to configure anonymous clients limit inside the ApiListener object
Previously this was hardcoded, and for security reasons users might want
to adjust this value. This affects CSR signing requests as well as
clients which have not yet been configured as endpoints on the current
node.

refs #6566
2018-09-05 17:45:35 +02:00
Michael Friedrich a1ec919f5b Raise the message size for anonymous client and pki request calls to 1MB
If one sends the full certificate chain, this previous limit of 64KB
could be hit.
2018-09-05 17:44:05 +02:00
Michael Insel cc417ca176 Fix CI builds 2018-09-04 18:56:54 +02:00
Michael Insel 46163700b4 Include api user configuration file during api setup
refs #6557
2018-09-04 18:38:38 +02:00
Michael Friedrich 1c2a59bf63
Merge pull request #6591 from Icinga/bugfix/lto-builds-static-initialize-namespaces
Fix static initializer priority for namespaces in LTO builds
2018-09-04 16:54:30 +02:00
Michael Friedrich 19993df380 Fix static initializer priority for namespaces in LTO builds
fixes #6575
2018-09-04 16:36:22 +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
Jean Flach 8fe490f945 Update variable names 2018-09-04 11:45:35 +02:00
Markus Frosch 13a8fa20f9 Ensure that config object types are committed in dependent load order 2018-09-04 11:45:35 +02:00
Jean Flach c721c302cd Shuffle items before config validation 2018-09-04 11:10:27 +02:00
Michael Friedrich bc844aca06 Fix non-unity builds on CentOS 7 with std::shared_ptr
refs #6509
2018-09-03 15:32:28 +02:00
Gunnar Beutner 17c7131177 Move new downtime constants into the Icinga namespace 2018-08-25 19:35:01 +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
Alan Jenkins 50463a6a10 Daemonize(): use one error convention, not three
Standardize on exit() / _exit() (this depends whether we are considered
to be the "main" fork, which should run anything registered with atexit()).
Exclude `return false` and throwing exceptions.

This fixes the error path for fork().  Daemonize() would return false, but
the `return false` error convention was not tested in the caller.

It also fixes the error message for fork() to show the error code.
Everyone loves `strace`, but sysadmins should not have to rerun their
daemons under it just to see an error code.

Also in case an exception is thrown, show its diagnostic information
instead of dropping it on the floor.  In the log message, I mention why we
are uninitializing and then initializing the app at this point.

For the reader, it pushes all the weirdness into the error convention of
Daemonize().  This comes back to the exit() / _exit() distinction.  Once
we have forked, we technically don't want to allow the parent process to
exit(), so we don't want to return to the caller.
2018-08-25 10:07:02 +01:00
Alan Jenkins a0fb0bbfe3 fix "Console" log to flush
It's called "Console", which would be line-buffered anyway.  But, it's
implemented as std::cout.  This might be piped to a logger, as in
daemontools or systemd.  In this case it will not be a TTY, and log lines
should be flushed without too much delay.  Let's just flush each message.

Let's not introduce a static instance of StreamLogger (flushed by interval
timer).  That's too stressful to read, because static instances are really
annoying to order.  Example citation: "Yay, our static destructors are
pretty much beyond repair at this point." -- application.cpp.

I don't know if there will be any need to optimize logging syscalls.  The
init script uses `--daemonize`.  I think the systemd service should also
avoid using the "Console" log after startup (see next commit).  The
documentation does not warn that the syslog feature is less efficient
in system calls than mainlog; deferred flusing does not seem to be a highly
prominent feature.  There's no cool comment in the code about how much the
syscalls were slowing down some use case (or qualifying that this
optimization can only eliminate syscalls on platforms with both mutexes and
clocks that can work without syscalls).
2018-08-25 09:54:55 +01:00
Noah Hilverling 01fea22c77 Add child_options to ScheduledDowntime
refs #3935
2018-08-24 14:29:39 +02:00
Michael Friedrich 237fd520db
Merge pull request #6509 from gunnarbeutner/feature/real-constants
Implement support for namespaces
2018-08-24 12:10:10 +02:00
Michael Friedrich 7a22113f86
Merge pull request #6570 from Icinga/bugfix/tls-anonymous-clients-limit
Increase limit for simultaneously connected anonymous TLS clients
2018-08-23 17:13:41 +02:00
Michael Friedrich 0dd168fe80 Increase limit for simultaneously connected anonymous TLS clients 2018-08-23 17:10:51 +02:00
Michael Friedrich 6a71b75f63 ApiListener: Dump the state file port detail as number
refs #6511
2018-08-22 12:57:47 +02:00
Gunnar Beutner e678fa1aa5 Refactor Application::*Const() 2018-08-13 15:27:05 +02:00
Gunnar Beutner 1a0311a49f Implement namespace support for the keys() function 2018-08-13 13:44:31 +02:00
Gunnar Beutner 8fda8d72ac Implement support for the namespace and using keywords 2018-08-13 13:44:31 +02:00
Gunnar Beutner 10d6f70a85 Move constants and functions into different namespaces 2018-08-13 13:44:31 +02:00
Gunnar Beutner 1a8692d972 Implement support for namespaces 2018-08-13 13:44:31 +02:00
Gunnar Beutner 9d513d8f05 Implement support for modifying frozen attributes 2018-08-13 13:44:31 +02:00
Gunnar Beutner d9c0b6f806 Refactor REGISTER_SCRIPTFUNCTION_* macros 2018-08-13 13:44:31 +02:00
Michael Friedrich 060a1ebbd9
Merge pull request #6512 from Icinga/feature/sni-environment
Refactor environment for API connections
2018-08-10 13:15:48 +02:00
Michael Friedrich 2ee6dfaf93 Re-add environment to IcingaApplication feature stats 2018-08-10 13:01:53 +02:00
Michael Friedrich 97513965e6 Introduce IcingaApplication#environment
Precedence as follows:

- DEnvironment=...
- const Environment = ...
- object IcingaApplication "app" { environment = "..." }

The wrapped script constant handling is required
since we cannot directly link from libremote (SNI handling)
to libicinga where the object resides. Instead we'll
use the Application class helpers for hiding the ScriptGlobal
calls.
2018-08-10 12:49:48 +02:00
Michael Friedrich a4c689e5cf Build fix for CentOS 7 and non-unity builds 2018-08-09 16:23:24 +02:00
Michael Friedrich b350512b11 Rename to Environment constant 2018-08-09 13:19:33 +02:00
Markus Frosch eb02d9041d Refactor environment for API connections
* Const renamed to `ApiEnvironment`
* Handling moved to ApiListener
* Now a property of ApiListener
2018-08-09 13:19:33 +02:00
Michael Friedrich f1e7e635a2
Merge pull request #6531 from Icinga/feature/zone-all_parents
Expose Zone#all_parents via API
2018-08-09 13:11:23 +02:00
Michael Friedrich 3cc8bd2fcc
Merge pull request #6511 from Icinga/feature/apilistener-dynamic-port
ApiListener: Add support for dynamic port handling
2018-08-09 12:09:23 +02:00
Michael Friedrich ecb73e08ed Implement ApiListener status file removal on shutdown 2018-08-09 11:54:34 +02:00
Noah Hilverling 7b977b2c52 Do not send 'finished reconnecting...' if failed 2018-08-09 08:29:27 +02:00
Markus Frosch 20269a89d0 ApiListener: Add support for dynamic port handling 2018-08-08 17:42:57 +02:00
Michael Friedrich ba21a54443
Merge pull request #6530 from Icinga/bugfix/query-was-empty
IDO/MySQL: avoid empty queries
2018-08-08 14:41:57 +02:00
Alexander A. Klimov ea5614f7df Expose Zone#all_parents via API 2018-08-08 14:38:02 +02:00
Alexander A. Klimov 7bcbd9b497 Rename Zone#GetAllParents() to Zone#GetAllParentsRaw() 2018-08-08 14:38:02 +02:00
Alexander A. Klimov 7a31cd4fe7 IDO/MySQL: avoid empty queries 2018-08-08 12:11:37 +02:00
Michael Friedrich 9be3ee1a1a Update output for `--version`
This moves the system and build information before
the application paths which are normally not that important.
2018-08-07 18:46:18 +02:00
Michael Friedrich a2a1f5c8d2 Take a note why the explicit configDir variable is needed on Windows 2018-08-07 18:33:59 +02:00
Markus Frosch 9fbc40615a Improve path handling in cmake and daemon 2018-08-07 14:10:26 +02:00
Michael Friedrich 8bac1dc99e
Merge pull request #6521 from gunnarbeutner/feature/references
Implement references
2018-08-07 12:00:19 +02:00
Gunnar Beutner 24de1963b1
Merge pull request #6526 from Icinga/bugfix/wpessimizing-move-6524
icinga::PackObject(): shorten conversion to string
2018-08-07 10:05:18 +02:00
Alexander A. Klimov 137f5363c4 icinga::PackObject(): shorten conversion to string
refs #6524
2018-08-07 09:57:08 +02:00
Gunnar Beutner 8bfd419702 Implement references 2018-08-07 07:44:48 +02:00
Michael Insel eea42c6807 Fix windows build 2018-08-05 20:17:43 +02:00
Michael Insel 51b900b307 Reset terminal on erroneous console exit
This ensures that the terminal is resetted on an erroneous exit when using the Icinga 2 console.

refs #6382
2018-08-05 16:30:36 +02:00
Michael Friedrich 33492420f3
Merge pull request #6427 from gunnarbeutner/fix/recursive-serialize
Improve error message for serializing objects with recursive references
2018-08-03 11:03:42 +02:00
Gunnar Beutner 56cf64f590 Improve error message for serializing objects with recursive references 2018-08-02 11:06:24 +02:00
Jean Flach 065bc23d9a
Merge pull request #6508 from gunnarbeutner/feature/dictionary-clear
Implement the Dictionary#clear script function
2018-08-02 10:30:08 +02:00
Gunnar Beutner a5a0119799 Implement the Dictionary#clear script function 2018-08-02 08:45:19 +02:00
Christopher Schirner b870e84904 Only check lag if connected 2018-07-31 10:41:14 +02:00
Christopher Schirner 35038f72d6 Invert connected check 2018-07-31 10:40:54 +02:00
Peter Eckel b5a7af126d Fixed indentation 2018-07-29 15:39:02 +02:00
Peter Eckel f788795415 Reduce the log level for missing env macros to debug
refs #6460
2018-07-29 15:17:50 +02:00
Jean Flach 2e3a1ff0c6
Merge pull request #6498 from Icinga/bugfix/match-regex-match-any-regression
Fix regression with MatchAny false conditions on match/regex/cidr_match
2018-07-27 17:28:13 +02:00
Jean Flach a5afaf5b40
Merge pull request #6497 from Icinga/bugfix/match-dictionary-error-handling
Improve error logging for match/regex/cidr_match functions and unsupported dictionary usage
2018-07-27 17:26:12 +02:00
Michael Friedrich 72c0f07661 Fix regression with MatchAny false conditions on match/regex/cidr_match
fixes #6496
2018-07-27 16:55:37 +02:00
Michael Friedrich 8e682ce9b1 Improve error logging for match/regex/cidr_match functions and unsupported dictionary usage
fixes #6442
2018-07-27 16:34:50 +02:00
Michael Friedrich 1d22b6e176
Merge pull request #6410 from Icinga/remove-dead-code
Remove unused code
2018-07-27 15:56:52 +02:00
Michael Friedrich b16d96d197
Merge pull request #6489 from Icinga/feature/object-packer
Implement object packer for consistent hashing
2018-07-27 12:49:28 +02:00
Alexander A. Klimov dd8cb42969 Implement object packer for consistent hashing 2018-07-26 17:36:48 +02:00
Markus Frosch ddc5b951b3
Revert "Implement support for the --env command-line argument" 2018-07-26 17:09:06 +02:00
Michael Friedrich 46e71a83dc
Merge pull request #6414 from Icinga/feature/icinga-envs
Implement support for the --env command-line argument
2018-07-26 10:09:42 +02:00
Michael Friedrich e519d6bbc6
Merge pull request #6110 from gunnarbeutner/feature/for-loop-var
Implement support for optionally specifying the 'var' keyword in 'for' loops
2018-07-26 10:05:17 +02:00
Michael Friedrich 272176e2d0
Merge pull request #6475 from dh-harald/master
lib->compat->statusdatawriter: fix notifications_enabled
2018-07-26 10:03:57 +02:00
Michael Friedrich 3fc3d86fbb
Merge pull request #6386 from Icinga/fix/timeperiods-do-not-clear-after-restart
Fix that TimePeriod segments are not cleared on restart
2018-07-26 10:02:46 +02:00
Michael Friedrich 020bd86b4c
Merge pull request #6408 from Icinga/bugfix/objectlock-unlock-m_lockowner
ObjectLock#Unlock(): don't reset m_Object->m_LockOwner too early
2018-07-26 10:02:26 +02:00
Michael Friedrich 038b2fb94c
Merge pull request #6379 from Icinga/global-zone-validation
Throw config error when using global zones as parent
2018-07-26 10:01:46 +02:00
Michael Friedrich fcc32957cb
Merge pull request #6455 from Icinga/feature/filelogger-started
Log something when the Filelogger has been started
2018-07-26 10:01:06 +02:00
Michael Friedrich 62e91e1891
Merge pull request #6430 from Icinga/fix/workqueue-log-message
Fix negative 'empty in' value in WorkQueue log message
2018-07-26 09:59:53 +02:00
Michael Friedrich 89d42fee72
Merge pull request #6440 from Icinga/bugfix/typo
Fix typo
2018-07-26 09:59:20 +02:00
Michael Friedrich b1adad0a42
Merge pull request #6456 from Icinga/feature/logger-flush-dev
Keep notes for immediately log flushing
2018-07-26 09:58:59 +02:00
Michael Friedrich 45a0518c78
Merge pull request #6458 from Icinga/bugfix/configitem-debug-log
Fix debug build log entry for ConfigItem activation priority
2018-07-26 09:57:19 +02:00
Michael Friedrich 5a8e98213c
Merge pull request #6487 from Icinga/bugfix/discard-warning-6485
Fix "Discard" message being warning
2018-07-26 09:52:33 +02:00
Jean Flach 2b44eff8da Fix "Discard" message being warning 2018-07-26 09:39:03 +02:00
dh.harald d9d701a05c
lib->compat->statusdatawriter: fix notifications_enabled 2018-07-23 22:28:09 +01:00
Michael Friedrich 14d88d90a0
Merge pull request #6470 from sebastic/spelling-errors
Fix spelling errors.
2018-07-23 17:59:45 +02:00
Bas Couwenberg 0891380789 Fix spelling errors.
* occured -> occurred
 * dosen't -> doesn't
2018-07-21 10:38:09 +02:00
Alexander A. Klimov f71bad96d5 Start and stop the timer thread lazily
refs #6461
2018-07-20 15:36:15 +02:00
Michael Friedrich 7519d23892 Add debug logging for daemonize/timers
The previous commit is 1:1 the same I've implemented
here already. Great teamwork with Alex :)

refs #6445
2018-07-19 13:34:12 +02:00
Alexander A. Klimov d15e1006f3 Re-introduce Timer::Initialize()
refs #6445
2018-07-19 13:22:37 +02:00
Michael Friedrich fc2da5047c Fix debug build log entry for ConfigItem activation priority
This is not visible in release builds, minor fix.
2018-07-19 12:53:28 +02:00
Michael Friedrich fd381ff5e0 Keep notes for immediately log flushing
Disabled, but kept for future debugging sessions.
Helps with things like #6455
2018-07-19 12:51:30 +02:00
Michael Friedrich 7c2e999f1f Log something when the Filelogger has been started
Helps to see whether the logger object is active,
spotted during #6445
2018-07-19 12:48:29 +02:00
Alexander A. Klimov 030afee8b0 Fix typo 2018-07-17 14:23:20 +02:00
Michael Insel 4170bd5205 Fix negative 'empty in' value in WorkQueue log message
This fixes a negative 'empty in' value in WorkQueue log messages.
2018-07-10 19:21:04 +02:00
Alexander A. Klimov ac6afadb5a Make HttpServerConnection#m_DataHandlerMutex a boost::recursive_mutex
refs #6428
2018-07-09 14:40:32 +02:00
Gunnar Beutner 2eb46f1203 Implement support for optionally specifying the 'var' keyword in 'for' loops 2018-07-03 11:03:22 +02:00
Michael Friedrich ab9a32d67d Fix missing next check update causing the scheduler to execute checks too often
Regression from #6217, only in git master.

fixes #6421
2018-07-02 16:17:53 +02:00
Michael Friedrich 601c54e44e Add more debug logging for check scheduling 2018-07-02 16:17:33 +02:00
Gunnar Beutner c577554073 Implement support for the --env command-line argument 2018-06-27 13:15:52 +02:00
Jean Flach 4159682cf8 Remove unused code
These methods and types were used only by the Icinga Studio
2018-06-25 10:09:30 +02:00
Alexander A. Klimov 02645c59ff ObjectLock#Unlock(): don't reset m_Object->m_LockOwner too early 2018-06-22 14:13:09 +02:00
Michael Friedrich ba680dc829
Merge pull request #6405 from Icinga/bugfix/windows-reload-behaviour-6378
TcpSocket#Bind(): reuse socket addresses on Windows, too
2018-06-22 12:25:28 +02:00
Michael Friedrich a1c2eb3d87 Ensure to _unlink before renaming replay log on Windows 2018-06-22 11:12:09 +02:00
Alexander A. Klimov 79878ea286 TcpSocket#Bind(): reuse socket addresses on Windows, too
refs #6378
2018-06-22 10:33:31 +02:00
Michael Friedrich 0ffb8af8e3 Conform to RFC for CRLF in HTTP requests
refs #6242
2018-06-21 16:53:44 +02:00
Michael Friedrich 1b2af3f0c4
Merge pull request #6402 from Icinga/fix/tls-stream-read-pending
Use SSL_pending() for remaining TLS stream data
2018-06-21 16:43:03 +02:00
Michael Friedrich 257ad12646 Use SSL_pending() for remaining TLS stream data
We've used this previously, and according to the OpenSSL
docs we should just use it. From our experience everything
done different to the API functions from OpenSSL causes
undefined behaviour in the worst case.

This commit also breaks the packet size limit into a more
readable version, including logs for development debug builds.

refs #6242
2018-06-21 15:58:05 +02:00
Michael Friedrich 9ea0650edc Fix connection error handling in Elasticsearch and InfluxDB features
Previously this would just throw the entire exception stack trace
which is not needed here.

fixes #6394
2018-06-21 15:41:40 +02:00
Michael Friedrich cc294e14d2
Merge pull request #6393 from Icinga/bugfix/elasticsearchwriter-not-writing-6354
Stream#ReadLine(): fix false positive buffer underflow indicator
2018-06-21 15:06:21 +02:00
Alexander A. Klimov 1c213877a4 Stream#ReadLine(): simplify algorithm
refs #6354
2018-06-20 17:28:52 +02:00
Alexander A. Klimov 3c7851107c TlsStream#IsEof(): fix false positive EOF indicator
refs #6242
2018-06-20 16:55:33 +02:00
Alexander A. Klimov 02d1f1cc57 Stream#ReadLine(): fix false positive buffer underflow indicator
refs #6354
2018-06-20 09:59:18 +02:00
Michael Friedrich cfd6c79a03
Merge pull request #6387 from Icinga/fix/remove-broken-api-user-hash
Remove ApiUser password_hash functionality
2018-06-19 14:26:32 +02:00
Michael Friedrich 2fd6709952 Remove ApiUser password_hash functionality
This affects and fixes

- Windows reload
- Config validation
- RHEL 7.5 OpenSSL memory corruption
- Hash algorithm, requested changes

refs #6378
refs #6279
refs #6278
2018-06-19 11:32:03 +02:00
Noah Hilverling ea08c85424 Fix that TimePeriod segments are not cleared on restart
refs #6282
2018-06-19 10:30:34 +02:00
Noah Hilverling 233d00d648
Merge pull request #6311 from Reamer/timeperiod_bugfix
refs #6282
2018-06-19 10:29:27 +02:00
Michael Friedrich 9b99c9d106 Remove leftover for sysconfig file parsing
refs #6255
2018-06-18 19:25:48 +02:00
Alexander A. Klimov a0fca599da HttpRequest#ParseBody(): indicate success on complete body
refs #6184
2018-06-18 16:02:22 +02:00
Michael Friedrich eb1f37905d
Merge pull request #6368 from Icinga/fix/program-options-parsing-6365
Fix program option parsing
2018-06-15 16:09:13 +02:00
Jean Flach ee9be90fa7 Throw config error when using global zones as parent 2018-06-15 14:40:09 +02:00
Michael Friedrich 8c3c4704d2
Merge pull request #6371 from Icinga/bugfix/socket-io-handling-with-http-json-rpc-6361
ApiListener#NewClientHandlerInternal(): Explicitly close the TLS stream on any failure
2018-06-15 14:35:48 +02:00
Michael Friedrich b9bfe70444 Fix missing name for workqueue while creating runtime objects via API
fixes #6364
2018-06-15 14:25:03 +02:00
Alexander A. Klimov 7741517df7 ApiListener#NewClientHandlerInternal(): Explicitly close the TLS stream on any failure
refs #6361
2018-06-14 15:03:04 +02:00
Michael Insel e885cf71c6 Fix program option parsing
This fixes the program option parsing.
2018-06-12 19:02:48 +02:00
Jean Flach 9a5d464448 Revert "Fix Windows reload"
This reverts commit 691e3cfd57.
2018-06-12 12:19:16 +02:00
Jean Flach 0fc5db82dd Fix ScheduledDowntimes replicating on restart
fixes #4272
2018-06-08 10:54:06 +02:00
Jean Flach ee37c8c68e
Merge pull request #6343 from Icinga/fix/checks-via-command_endpoint-are-not-executed-6337
Fix that checks with command_endpoint don't return any check results
2018-06-07 11:42:40 +02:00
Michael Friedrich 447dad91c0 Increase header size to 8KB for HTTP requests
This is the default for Tomcat and Apache too
and avoids problems with cookies and long URLs.

fixes #6355
2018-06-06 20:25:36 +02:00
Michael Friedrich bf0737ded5
Merge pull request #6328 from Icinga/sysconfig-env
Rework sysconfig file/startup environment
2018-06-05 13:27:36 +02:00
Noah Hilverling d8b400dc17 Fix that checks with command_endpoint don't return any check results
fixes #6337
2018-05-29 13:51:34 +02:00
Michael Insel d868780e6d Fix unnecessary blank in log message
This fixes an unnecessary blank in the updating configuraiton log message.

information/cli: Updating ' "conf.d"' include in '/etc/icinga2/icinga2.conf'.

Should be:

information/cli: Updating '"conf.d"' include in '/etc/icinga2/icinga2.conf'.
2018-05-24 19:35:52 +02:00
Jean Flach ed4e008e79 Rework sysconfig file
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
2018-05-23 15:18:42 +02:00
Michael Friedrich 4a6320d7f7 Update log message for skipped certificate renewal
Users kept asking about it, still it is just an "information"
that this isn't needed yet.
2018-05-23 15:18:38 +02:00
Michael Friedrich 653a2b4e7d
Merge pull request #6324 from Icinga/fix/6279-api-user-crash
Ensure that password hash generation from OpenSSL is atomic
2018-05-23 11:25:52 +02:00
Jean Flach 08a14cd136 Ensure that password hash generation from OpenSSL is atomic
This is supposed to solve a problem with segfaults caused by
race conditions withing the random byte generation of OpenSSL.

fixes #6279
2018-05-23 10:55:14 +02:00
Michael Friedrich 2d8158ec29
Merge pull request #6290 from jre3brg/opentsdb-metric-names
Fixed opentsdb metric name with colon chars
2018-05-22 15:46:04 +02:00
Michael Friedrich f788878f79 Update log message for skipped certificate renewal
Users kept asking about it, still it is just an "information"
that this isn't needed yet.
2018-05-18 17:04:03 +02:00
Michael Friedrich 4a68ed9a5f Ensure that icinga_min_version parameter is optional
Seen that here: https://github.com/Icinga/icinga2/issues/6319#issuecomment-390195058

refs #5960
refs #3998
2018-05-18 15:11:56 +02:00
Noah Hilverling a5a2194fa2
Merge pull request #6292 from Icinga/fix/flapping-reminder-notification
Fix problem with reminder notifications if the checkable is flapping
2018-05-17 13:52:29 +02:00
Philipp Dallig 8e124e2abe Do not add the old timeperiod segment, if we cut it in the middle 2018-05-16 12:04:38 +02:00
Michael Friedrich 120eb070d2
Merge pull request #6309 from Icinga/fix/compiler-warning-in-checkercomponent-ti
Fix compiler warning in checkercomponent.ti
2018-05-16 10:42:31 +02:00
Michael Friedrich 04af51b866
Merge pull request #6306 from Icinga/feature/checkresultreader-deprecated
Adjust message for CheckResultReader deprecation
2018-05-15 14:05:16 +02:00
Michael Friedrich 7f579db9af
Merge pull request #6305 from gunnarbeutner/feature/environment-variable
Introduce the 'Environment' variable
2018-05-15 14:04:50 +02:00
Gunnar Beutner 9c1e00eb94 Introduce the 'Environment' variable 2018-05-15 12:02:15 +02:00
Noah Hilverling ead1f262e6 Fix compiler warning
fixes #6081
2018-05-15 11:25:28 +02:00
Michael Friedrich ead3f0a227 Adjust message for CheckResultReader deprecation
refs #6031
2018-05-15 10:44:06 +02:00
Michael Friedrich 119965fe24 Adjust deprecation removal for compat features
As discussed with @lippserd :)

refs #6032
refs #6033
2018-05-14 15:55:30 +02:00
Michael Friedrich 5b19784b25 Change log level for failed event command execution
refs #5692
2018-05-11 15:24:37 +02:00
Michael Friedrich 2d87b667ab Execute event commands only on actively checked host/service objects in an HA zone
fixes #3431
2018-05-11 12:58:33 +02:00
Michael Friedrich 964a5ebd57 Deprecate compatlog feature
fixes #6032
2018-05-09 17:37:28 +02:00
Michael Friedrich f070d2136a Ensure that user input for groups is unique on API object creation
refs #4732
2018-05-09 17:26:10 +02:00
Michael Friedrich 88d99094bf Ensure that added group members are unique
refs #4732
2018-05-09 17:26:07 +02:00
Michael Friedrich 6660a45c41 Implement Array::Unique() and add unit tests
refs #4732
2018-05-09 17:25:55 +02:00
Michael Friedrich 16e8e3cf4b Fix problem with reminder notifications if the checkable is flapping 2018-05-09 09:54:48 +02:00
Michael Friedrich f0f0b47057 Fix style and logging from review; enhance output
refs #4508
2018-05-08 16:59:09 +02:00
Jean Flach b8fc3a3ffa Small changes to node wizard/command
refs #4508
2018-05-08 16:33:06 +02:00