Michael Friedrich
2ba2134eda
Merge pull request #7156 from Icinga/feature/itl-sleep
...
Implement sleep CheckCommand
2019-05-24 15:42:46 +02:00
Alexander Stoll
471dbc79a3
Remove double whitespaces for notifications log message
...
Add space to checkable debug message to unify timestamp format
2019-05-22 14:13:14 +02:00
Michael Friedrich
a0c8f41d58
Debug Console: Use our new I/O engine for HTTP requests
...
refs #7041
2019-05-22 12:51:23 +02:00
Michael Insel
bb70613ed1
Fix wrong facility in GelfWriter log message
...
This fixes a wrong facility in GelfWriter log message (paused message).
2019-05-16 19:50:40 +02:00
Michael Insel
bc0ab93e44
Use new I/O engine in GelfWriter
2019-05-16 19:39:06 +02:00
Michael Insel
90bb423226
Implement TLS support for the GelfWriter
...
This implements TLS support for the GelfWriter.
2019-05-16 17:48:47 +02:00
Michael Friedrich
6ba67487ea
CLI: 'ca list' now lists pending CSRs by default, add '--all' parameter
...
https://puppet.com/docs/puppet/5.5/man/cert.html
2019-05-10 15:41:00 +02:00
Michael Friedrich
aed88ca477
Revert "CLI: Return non-zero on unknown sub commands"
...
This reverts commit 00bc0b2303
.
2019-05-10 15:16:05 +02:00
Michael Friedrich
af42e2dfc0
Merge pull request #7178 from Icinga/bugfix/api-package-repair
...
API: Automatically repair broken _api package
2019-05-10 14:40:48 +02:00
Michael Friedrich
368383bedd
Merge pull request #7154 from Elias481/fix/serializer-object-locking-7003
...
Lock all kind of Objects during serialization
2019-05-10 14:39:27 +02:00
Michael Friedrich
6c9c65323e
Workaround for boost::filesystem and Visual Studio on Windows
2019-05-10 13:38:12 +02:00
Michael Friedrich
6cce9c0fdd
API: Automatically repair broken packages
...
This partially reverts #7150 and avoids exceptions
inside the flow. Each time an empty active stage
is detected, Icinga tries to repair it from the
the given directory tree.
Also, the code now takes into account that it should
create the package storage on startup, whether within
the API object, or if disabled, inside the application.
Caching the active stages for packages in memory
only is in effect with the API feature being enabled.
This is useful for other deployed config packages,
not only the internal one.
fixes #7173
refs #7150
refs #7119
fixes #6959
2019-05-10 12:48:34 +02:00
Elias Ohm
4c86c370bb
fixup errbuf length in the other files and avoid using the static buffer in one place (for thread safety and code consistency reasons)
2019-05-09 09:30:12 +02:00
Elias Ohm
e75f063552
bring some things in line
...
- account for documented buffer size openssl 1.1.x for error string (>=256 bytes)
- use nullptr instead of NULL
- fix/streamline null-checks
2019-05-09 00:22:24 +02:00
Jean Flach
9a0d894f10
Don't use deprecated RSA_generate_key
...
fixes #4635
2019-05-08 23:46:31 +02:00
Michael Friedrich
03324b2fb6
Config packages: Catch active stage exceptions in rare cases
...
Typically this already is detected on startup.
2019-05-08 16:43:27 +02:00
Michael Friedrich
704aabcb63
Avoid dead-lock with config packages and active stages
2019-05-08 16:06:46 +02:00
Michael Friedrich
736e0806d7
Merge pull request #7164 from Icinga/bugfix/notification-times-validate
...
Improve validation for times.{begin,end} in notification objects
2019-05-07 15:58:44 +02:00
Michael Friedrich
296fc06890
Merge pull request #7163 from Icinga/bugfix/db-ido-reachable
...
DB IDO: Use cached reachable state
2019-05-07 15:21:21 +02:00
Michael Friedrich
8ae206cd5d
Improve validation for times.{begin,end} in notification objects
...
fixes #6939
2019-05-07 15:20:06 +02:00
Michael Friedrich
5553438249
DB IDO: Use cached reachable state
...
fixes #6844
2019-05-07 13:47:09 +02:00
Michael Friedrich
00bc0b2303
CLI: Return non-zero on unknown sub commands
...
fixes #6585
2019-05-07 12:43:53 +02:00
Michael Friedrich
4197bc9bcd
CLI: Fix updates for NodeName/ZoneName constants
...
fixes #7117
2019-05-06 10:19:56 +02:00
Michael Friedrich
edaaaae1e8
Merge pull request #7155 from Elias481/bugfix/evaluatefilter-assign-this-scope-6874
...
use current frame scope for permission filter function calls
2019-05-03 16:53:40 +02:00
Michael Friedrich
78e24c53f1
DB IDO: Do not deactivate objects during application reload/restart
...
This follows the same principle as with the shutdown handler,
and was introduced with the changed reload handling with 2.9.
Previously IsShuttingDown() was sufficient which got set at one
location.
SigUsr2 as handler introduced a new location where m_ShuttingDown
is not necessarily set yet. Since this handler gets called when
l_Restarting is enabled, we'll use this flag to avoid config update
events resulting in object deactivation (object->IsActive() always
returns false).
refs #5996
refs #6691
refs #6970
fixes #7125
2019-05-03 15:40:48 +02:00
htriem
75df3879f2
Implement sleep CheckCommand in memory
...
Implements a check task with Utility::Sleep and custom var parameter sleep_time (default value: 1s)
refs #6964
2019-05-02 16:24:42 +02:00
Elias Ohm
c10ff9dd72
try without initialization of frame Locals which are not used for permissions filter and as far as I can see also not for query filters
2019-05-02 09:03:30 +02:00
Elias Ohm
53febdea81
use current frame scope for permission filter function calls
2019-05-02 07:35:19 +02:00
Elias Ohm
cdd843a998
another small adjustment by the way just to ensure the object on stack ist the same as the one serialized further in case the object does not implement locking on mutation (besides it's mor efficient to not fetch the same value twice)
2019-05-01 12:09:24 +02:00
Elias Ohm
44ac6cf1ec
add some object locking to the Dump method (which could theoreticylly suffer from same reace condition as serializer)
2019-05-01 11:49:07 +02:00
Michael Friedrich
759b090f81
Merge pull request #7150 from Icinga/bugfix/api-config-package-active-stage-name
...
Ensure that runtime created API objects survive a restart
2019-04-30 14:22:13 +02:00
Michael Friedrich
f206cba394
Merge pull request #7152 from Elias481/fix/mysql8-headers-compatibility
...
account for adjusted interface of mysql8
2019-04-30 14:20:18 +02:00
Michael Friedrich
502c43fb12
Active packages: Don't try to fix broken config packages which are not cached yet
2019-04-30 12:19:35 +02:00
Michael Friedrich
8a258de9bc
Merge pull request #6734 from leeclemens/remove-redundant-indexes
...
db ido: remove redundant mysql indexes
2019-04-29 09:13:22 +02:00
Elias Ohm
615f019c2e
account for adjusted interface of mysql8 (now utilizes c99 bools instead of my_bool labelled chars)
2019-04-29 00:18:15 +02:00
Elias Ohm
91296c2a25
Lock Objects during serialization
...
old behaviour was to only lock arrays, dictionaries and namespaces but not other objects
2019-04-28 22:13:19 +02:00
Michael Friedrich
2bca7a5bb5
Repair broken API config packages at runtime
...
This means a new timer which checks every 5m whether the
active-stage can be read, and if not, it overwrites the
file on disk with the details from memory.
2019-04-26 14:53:36 +02:00
Michael Friedrich
f92c134b0a
Cluster: Don't try to sync objects from broken _api package
2019-04-26 14:43:38 +02:00
Michael Friedrich
0d6d48fd59
Daemon: Deal with exceptions from broken _api package
2019-04-26 14:43:10 +02:00
Michael Friedrich
c821e73364
Cache the API package stage name with a active-stage fallback
...
This prevents reading the file everytime the stageName is required
for when creating a runtime object via REST API.
2019-04-26 13:40:27 +02:00
Michael Friedrich
1078a0a824
Add --cn parameter to 'api setup' CLI command allowing hostname overrides
...
fixes #6649
2019-04-26 10:52:05 +02:00
Michael Friedrich
3dc9927284
Merge pull request #7124 from Icinga/bugfix/namespace-thread-safe
...
Namespace: place ObjectLock in all methods
2019-04-26 08:26:59 +02:00
Michael Friedrich
37de1a919b
Merge pull request #7088 from Icinga/feature/asio-event-queue
...
Implement new event queue for ASIO consumers
2019-04-25 16:54:43 +02:00
Michael Friedrich
a7873da89d
Eventqueue: Remove unused code
2019-04-25 16:21:07 +02:00
Alexander A. Klimov
e86e3cc234
EventsFilter#Push(): ensure not to modify the global namespace
2019-04-25 15:56:38 +02:00
Alexander A. Klimov
c209cf830b
/v1/events: don't over-consume CPU-bound threads
2019-04-25 15:56:38 +02:00
Alexander A. Klimov
5e8b4280bc
New event queue: handle empty filter
2019-04-25 15:56:38 +02:00
Alexander A. Klimov
94db282fd1
/v1/events: remove anti-deadlock hack
2019-04-25 15:56:38 +02:00
Alexander A. Klimov
81713d0509
/v1/events: use new event queue
2019-04-25 15:56:38 +02:00
Alexander A. Klimov
90d9cd9257
Feed new event queue with events
2019-04-25 15:56:38 +02:00
Alexander A. Klimov
7688994601
Implement new event queue for ASIO consumers
2019-04-25 15:56:38 +02:00
Michael Friedrich
a630d0185f
Merge pull request #6722 from Icinga/feature/notification-result
...
Add notification result store/sync
2019-04-25 15:56:14 +02:00
Michael Friedrich
0438c866f8
Merge pull request #7102 from Icinga/feature/boost-fs-7101
...
Replace self-written filesystem ops with boost.filesystem
2019-04-25 15:53:55 +02:00
Alexander A. Klimov
5afef1015d
Replace unlink() with boost::filesystem::remove()
...
refs #7101
2019-04-25 09:53:02 +02:00
Alexander A. Klimov
5a17722c1f
Replace _unlink() + rename() with boost::filesystem::rename()
...
refs #7101
2019-04-25 09:53:02 +02:00
Alexander A. Klimov
f1f7d0c4d6
Work around boost::filesystem::path bug on VS
...
refs #7101
2019-04-25 09:53:01 +02:00
Alexander A. Klimov
af78cd6050
Use Boost.Filesystem
...
refs #7101
2019-04-25 09:53:01 +02:00
Michael Friedrich
0d9d39c64b
Fix preprocessor macro comment
2019-04-25 08:25:28 +02:00
Alexander A. Klimov
ba842403ce
Fix circular #include
...
refs #6985
2019-04-25 08:25:28 +02:00
Alexander A. Klimov
5151f6567e
ThreadPool: use the Boost ASIO thread pool under the hood
2019-04-25 08:25:28 +02:00
Michael Friedrich
56894bea17
Buildfix
...
Obviously tired.
fixes #7138
fixes #7139
2019-04-24 12:10:57 +02:00
Michael Friedrich
df25b183cb
Add log message for log rotate; update docs
...
refs #6737
2019-04-24 11:53:27 +02:00
Alexander A. Klimov
7a8f8fd734
Timer::TimerThreadProc(): use C++11 lambda instead of bind()
...
refs #6737
2019-04-24 11:51:17 +02:00
Alexander A. Klimov
622f684124
StreamLogger#BindStream(): set #m_FlushLogTimer only if needed
...
refs #6737
2019-04-24 11:47:02 +02:00
Elias Ohm
52e3db279a
Fix for double-free (and possibly other memory-corruption related) crashes at logrotate time
...
this is a direct fix of the issue revealing the problem that leads to crash
verification done with a patched icinga2 where the execution-order of the code lines of counter-parts involved in re-incrementing/decrementing Timer:Ptr is forced to be the one that leads to the obeserverd segfaults
refs #6737
2019-04-24 11:42:54 +02:00
Michael Friedrich
43e9ae5f8d
Merge pull request #7135 from Icinga/feature/boost-asio-elasticsearchwriter
...
Use new I/O engine in ElasticsearchWriter
2019-04-23 14:53:00 +02:00
Michael Friedrich
1ac693bf13
Merge pull request #7137 from Icinga/bugfix/disconnect-log-more-spam
...
JsonRpcConnection: reduce log spam on disconnect
2019-04-23 14:50:18 +02:00
Alexander A. Klimov
3f0066e33b
Use new I/O engine in ElasticsearchWriter
2019-04-23 14:33:19 +02:00
Michael Friedrich
856877d1fe
Merge pull request #7134 from Icinga/feature/boost-asio-influxdbwriter
...
Use new I/O engine in InfluxdbWriter
2019-04-23 14:31:42 +02:00
Michael Friedrich
0f804d126b
Merge pull request #7133 from Icinga/feature/boost-asio-pki
...
Use new I/O engine in PkiUtility::FetchCert() and PkiUtility::RequestCertificate()
2019-04-23 14:27:48 +02:00
Alexander A. Klimov
a6cd3e65cb
JsonRpcConnection: reduce log spam on disconnect
2019-04-23 14:09:07 +02:00
Michael Friedrich
20d51d21dc
Merge pull request #7127 from Icinga/bugfix/replay-log
...
ApiListener#RotateLogFile(): don't overwrite previous log
2019-04-23 12:08:12 +02:00
Michael Friedrich
5fb191bbeb
Merge pull request #7126 from Icinga/bugfix/replay-logs-6932
...
ApiListener#ApiTimerHandler(): delete all replayed logs
2019-04-23 12:07:02 +02:00
Alexander A. Klimov
14fdfff770
Use new I/O engine in InfluxdbWriter
2019-04-23 11:59:37 +02:00
Michael Friedrich
dee8fbf248
Merge pull request #7128 from Icinga/feature/re-write-objectlock-7123
...
Re-write ObjectLock's implementation details
2019-04-23 11:53:40 +02:00
Alexander A. Klimov
c1fa07899c
Introduce OptionalTlsStream
2019-04-23 11:25:26 +02:00
Alexander A. Klimov
407e77883c
ApiListener#ReplayLog(): read current log file too instead of rotating
2019-04-18 17:22:36 +02:00
Alexander A. Klimov
997d84bfa0
ApiListener#RotateLogFile(): don't overwrite previous log
2019-04-18 17:22:33 +02:00
Alexander A. Klimov
9b489cf9b9
ApiListener#ApiTimerHandler(): delete all replayed logs
...
refs #6932
2019-04-18 17:00:40 +02:00
Alexander A. Klimov
d8c9fdf1d4
Make Object#m_Mutex std::recursive_mutex
...
refs #7123
2019-04-17 18:26:29 +02:00
Alexander A. Klimov
7e6868bc99
Make Object#m_LockOwner std::atomic<std: 🧵 :id>
...
refs #7123
2019-04-17 18:26:23 +02:00
Alexander A. Klimov
f9f998334d
ObjectLock: deduplicate constructors
...
refs #7123
2019-04-17 16:47:41 +02:00
Alexander A. Klimov
f44e847717
Rotate replay log on shutdown, not on startup
2019-04-17 14:18:20 +02:00
Michael Friedrich
02db12ae02
Merge pull request #7050 from Icinga/feature/previous-state-change
...
Implement previous_state_change
2019-04-17 13:17:41 +02:00
Michael Friedrich
3665430005
Merge pull request #7112 from Icinga/bugfix/service-handled
...
Include host state in Service#handled and Service#severity
2019-04-17 13:16:23 +02:00
Michael Friedrich
64568f5966
Merge pull request #7121 from Icinga/bugfix/concurrent-checks
...
Fix that MaxConcurrentChecks constant is overridden from 'checker' feature
2019-04-17 13:14:32 +02:00
Michael Friedrich
ab97d606db
Merge pull request #7122 from Icinga/bugfix/evaluatefilter-change-globals
...
FilterUtility::EvaluateFilter(): ensure not to modify the global namespace
2019-04-16 17:40:20 +02:00
Alexander A. Klimov
5afda77943
Namespace: place ObjectLock in all methods
2019-04-16 17:38:58 +02:00
Michael Friedrich
ecbfdc2732
Merge pull request #7113 from Elias481/fix/incorrect-usage-of-global-namespace-6874-6785
...
use dedicated permissions namespace for scriptframe in filterutility
2019-04-16 16:02:16 +02:00
Alexander A. Klimov
bdadb53940
FilterUtility::EvaluateFilter(): ensure not to modify the global namespace
2019-04-16 15:53:44 +02:00
Michael Friedrich
b906714254
Fix that MaxConcurrentChecks constant is overridden from 'checker' feature
...
Note: This drops the deprecated concurrent_checks setting from the checker feature
entirely and refactors the underlaying code handling.
Also affects ReloadTimeout which is new for 2.11.
fixes #7111
2019-04-16 15:04:57 +02:00
Michael Friedrich
44d0c9013b
Ignore synced config zones where no config item exists
...
The culprit is that we're in compiling configuration stage here,
we don't have access to `Zone::GetByName()` as objects have not
been activated yet.
Our best guess is from a config item loaded before (e.g. from zones.conf)
since no-one can sync zones via cluster config sync either.
It may not be 100% correct since the zone object itself may be invalid.
Still, if the zone object validator fails later, the config breaks either way.
The problem with removal of these directories is dealt by the cluster
config sync with stages.
refs #6727
refs #6716
2019-04-15 17:38:43 +02:00
Michael Friedrich
e0d9814feb
Merge pull request #7116 from Icinga/feature/no-reachable
...
Drop Checkable#reachable in favor of #last_reachable
2019-04-15 13:40:06 +02:00
Alexander A. Klimov
d7b63143cf
Drop Checkable#reachable in favor of #last_reachable
2019-04-12 13:03:11 +02:00
Elias Ohm
1e7cd4afc8
* use dedicated permissions namespace for scriptframe in filterutility to allow proper parallel execution
...
* fixes issue https://github.com/Icinga/icinga2/issues/6785 where permission checks get wrong result because permissions checks are done within a shared namespaces without using only unique keys
* mitigates issue https://github.com/Icinga/icinga2/issues/6874 where segmentation faults occur because of concurrent access to non threadsafe parts of namespace (a fix for thread safety of namespaces which would be an alternative approach to get rid of these segfaults is out of scope of this fix as 6785 needs to be fixed anyway and this is the straight-forwards) way to fix that
* do the same for eventqueue (not certain whether events can be processed in parallel but I expect it is the case)
2019-04-12 08:10:57 +02:00
Alexander A. Klimov
66949dd018
Service: reduce severity while host is down
2019-04-11 11:36:23 +02:00
Alexander A. Klimov
ae18536b0f
Service: be handled while host is down
2019-04-11 11:25:45 +02:00
Michael Friedrich
973b03dcb2
Merge pull request #7109 from Icinga/feature/enhance-cluster-message-send-code-docs
...
Improve code docs for cluster message routing conditions
2019-04-11 11:20:46 +02:00
Michael Friedrich
b24a3be083
Improve code docs for cluster message routing conditions
...
refs #6781
2019-04-10 14:17:36 +02:00
Michael Friedrich
2b3511d8a6
Merge pull request #7097 from Icinga/bugfix/disconnect-log-spam
...
JsonRpcConnection: reduce log spam on disconnect
2019-04-09 16:57:31 +02:00
Alexander A. Klimov
de04bb13a8
JsonRpcConnection: reduce log spam on disconnect
2019-04-09 13:53:41 +02:00
Alexander A. Klimov
896d447e11
Add Checkable#problem and #handled
2019-04-09 11:34:59 +02:00
Alexander A. Klimov
d33cfdf3c0
Declare Checkable#IsStateOK() const
2019-04-09 11:26:34 +02:00
Alexander A. Klimov
acf28fb5b0
Expose Checkable#reachable
2019-04-09 11:09:02 +02:00
Michael Friedrich
f177d8786d
HttpServerConnection: Log the user agent field for new requests too
...
refs #7041
2019-04-05 15:08:09 +02:00
Michael Friedrich
b1042c3689
Merge pull request #7076 from Icinga/bugfix/eventqueue-leak
...
/v1/events: terminate on disconnect
2019-04-05 10:31:30 +02:00
Alexander A. Klimov
2e4e2e1a79
/v1/events: don't deadlock other coroutines
2019-04-05 09:22:42 +02:00
Michael Friedrich
cd325410ec
Merge pull request #7078 from Icinga/feature/deprecate-command-pipe-adjust-logs
...
Deprecate ExternalCommandListener feature ('command') and adjust log warnings to the roadmap
2019-04-03 14:59:36 +02:00
Michael Friedrich
c785a0678f
Deprecate ExternalCommandListener feature ('command') and adjust log warnings to the roadmap
...
They won't be removed with 2.11 thus far. Users should
be guided to the roadmap which holds all details instead
of hardcoding a version in the code.
2019-04-03 14:39:10 +02:00
Michael Friedrich
84019ba27a
Fix notification skip for local non-API enabled setups
...
W/o local endpoint, these reminder notifications would
have been skipped otherwise.
PR #6935 improved the logging and made this problem visible.
Thanks @nilmerg :)
2019-04-03 13:50:21 +02:00
Michael Friedrich
5c3a9b77d7
Always update object authority, even w/o API feature
...
Regression from #7062
Thanks @nilmerg :)
2019-04-03 13:48:24 +02:00
Alexander A. Klimov
2e5af2922b
/v1/events: terminate on disconnect
2019-04-03 09:59:45 +02:00
Alexander A. Klimov
4c5ee0dbbf
EventQueue#WaitForEvent(): re-add timeout
2019-04-03 09:53:45 +02:00
Michael Friedrich
c6eaee611c
Merge pull request #7074 from Icinga/feature/cli-run-as-icinga-not-root
...
Impersonate as Icinga user, not root
2019-04-03 09:52:08 +02:00
Alexander A. Klimov
28d46052b0
HttpServerConnection#StartStreaming(): auto-detect disconnection
2019-04-03 09:50:52 +02:00
Michael Friedrich
c2f180395a
Merge pull request #7000 from Icinga/bugfix/goto-loop
...
Don't abuse goto for building simple loops
2019-04-03 09:46:17 +02:00
Alexander A. Klimov
c284cf0b68
HttpServerConnection: encapsulate streaming start indicator
2019-04-02 17:37:29 +02:00
Michael Friedrich
7ca8c3ec2f
Impersonate as Icinga user, not root
...
This requires write permissions for
- etc/features-*
- etc/*.conf
- var/{lib,cache}/icinga2/*
Typically permissions are handled by prepare-dirs,
or the respective CLI commands are run as root either way.
fixes #4947
2019-04-02 17:05:48 +02:00
Alexander A. Klimov
09a2e04f4b
EventQueue#WaitForEvent(): don't lock I/O thread while locking mutex
2019-04-02 14:38:06 +02:00
Alexander A. Klimov
cfd0d86b9b
Use C++11 atomics for our intrusive pointers
2019-04-02 13:54:30 +02:00
Alexander A. Klimov
00d859234e
Use new I/O engine in PkiUtility::FetchCert() and PkiUtility::RequestCertificate()
2019-04-01 17:18:00 +02:00
Alexander A. Klimov
6e7932f157
Add non-async overloads for JsonRpc::ReadMessage() and JsonRpc::SendMessage()
2019-04-01 17:11:10 +02:00
Alexander A. Klimov
f4a78380e9
Add non-async overloads for NetString::ReadStringFromStream() and NetString::WriteStringToStream()
2019-04-01 17:11:10 +02:00
Alexander A. Klimov
d1e87bdc45
Connect(): add non-async overload
2019-04-01 17:11:09 +02:00
Alexander A. Klimov
f2d9d91e83
Introduce UnbufferedAsioTlsStream#GetPeerCertificate()
2019-04-01 17:11:09 +02:00
Michael Friedrich
5c2aaf6380
Improve error logging on connection failure (cluster)
2019-04-01 16:13:37 +02:00
Alexander A. Klimov
64b2ac4b30
ApiListener: drop unused thread pool
2019-04-01 15:06:17 +02:00
Alexander A. Klimov
3a6caa2800
Respect Accept:application/json where possible
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
24c9542b5b
HttpServerConnection: fix side effect of HTTP parser's default body limit
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
d428bdf384
Add missing includes
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
bf23e5392b
UnbufferedAsioTlsStream: don't rely on *this in decltype()s for methods' return types
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
7ec1e638a8
Turn shortcut UnbufferedAsioTlsStream::Parent into a base class
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
5b2c1f023d
Rename preventGc to keepAlive
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
5208448b76
Restore the previous performance of replaying logs
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
79e95d2355
Introduce JsonRpcConnection#SendMessageInternal()
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
e6d78bf361
Move some TCP/TLS logic out of ApiListener
...
... for re-using it
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
79220ee647
io-engine.hpp: fix missing namespace
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
8b3efe5759
Introduce AsioConditionVariable
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
d3392d1579
Rename AsioTlsStreamHack to UnbufferedAsioTlsStream
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
e129c561d5
HttpServerConnection: don't disconnect during sending response
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
b384f859c9
Make IoEngine::m_CpuBoundSemaphore signed
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
326bf66255
ApiListener: use setsockopt(), not tcp::acceptor#set_option()
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
b5fddaf3ce
ApiListener: log why bind(2) failed
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
e26774c7f8
IoEngine: adjust I/O threads
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
19625e62ef
ApiListener: fix self-made security hole
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
87b0c452db
HttpServerConnection: re-add automatic disconnect
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
f029fd4884
Re-add HttpServerConnection#Disconnect()
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
16913cb977
JsonRpcConnection: add missing CpuBoundWork
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
a451327b81
JsonRpcConnection: re-add num_json_rpc_work_queue_item_rate
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
a54bd9d5c4
JsonRpcConnection: re-add automatic disconnect
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
7aae8bd265
JsonRpcConnection: re-add heartbeats
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
84b411501b
Re-add JsonRpcConnection#Disconnect()
2019-04-01 13:31:16 +02:00
Alexander A. Klimov
2d16b02520
ApiListener#NewClientHandlerInternal(): shut down TLS stream
2019-04-01 13:30:42 +02:00
Alexander A. Klimov
c46157d552
ApiListener: fix self-made security hole
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
f9fff54da2
ApiListener: don't require a valid certificate for the TLS handshake to complete
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
6c86c127f1
Port JsonRpcConnection to Boost ASIO
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
c76947e8b9
JsonRpc::ReadMessage(): add Boost ASIO overload
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
b26808414c
NetString::ReadStringFromStream(): add Boost ASIO overload
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
48b5824e37
ApiListener: send icinga::Hello message
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
49ac7777e0
JsonRpc::SendMessage(): add Boost ASIO overload
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
43658de529
NetString::WriteStringToStream(): add Boost ASIO overload
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
832365195d
ApiListener: connect(2) via Boost ASIO
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
e9a64abd09
ApiListener#ListenerCoroutineProc(): catch more edge cases
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
a6813ec786
ApiListener: restore previous bind(2) behavior
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
282f8fd173
IoEngine: explicitly join I/O threads
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
493a97f4f3
EnsureAcceptHeader(): fix wrong condition
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
8c5d629d35
/v1/events: don't truncate any events
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
ac72ca4ae6
Don't warn that Boost.Coroutine v1 is deprecated
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
7681ec10a4
/v1/events: don't lock I/O thread
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
d7b465ce74
Implement IoBoundWorkSlot
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
fd239ba3fe
Adjust /v1/events, too
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
1941c1da28
Adjust all HTTP handlers (ex. /v1/events)
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
9ae1d732af
HttpServerConnection: actually handle requests
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
7fe0431ada
HttpServerConnection: verify requests via Boost ASIO + Beast
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
04a9879acc
Add HttpUtility::SendJsonError() overload for Boost/Beast
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
fc22cbaf09
Add HttpUtility::SendJsonBody() overload for Boost/Beast
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
2d7714802d
Allow CpuBoundWork to be done before end of scope
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
e21956e26e
ApiListener: detect protocol
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
539855bac1
ApiListener: verify peer
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
720c53ab77
ApiListener: perform TLS handshake
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
2615967e7f
Make ApiListener#m_SSLContext a Boost ASIO SSL context
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
e4f3422b3a
ApiListener: listen(2) via Boost ASIO
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
c547e9a863
Implement basic I/O engine
2019-04-01 11:40:14 +02:00
Alexander A. Klimov
7c7c5e28f5
Implement LazyInit<T>
2019-04-01 11:40:14 +02:00
Michael Friedrich
2913291a17
ido Check: Add last failover timestamp to output when HA enabled IDO is running
2019-04-01 09:31:03 +02:00
Michael Friedrich
4a26a48778
Code Quality: Move authority.cpp into the ApiListener class scope
2019-04-01 08:51:18 +02:00
Michael Friedrich
149f640fd8
Improve DB IDO HA failover behaviour
...
- Decrease Object Authority updates to 10s (was 30s)
- Decrease failover timeout to 30s (was 60s)
- Decrease cold startup (after (re)start) with no OA updates to 30s (was 60s)
- Immediately connect on Resume()
- Fix query priority which got broken with #6970
- Add more logging when a failover is in progress
```
[2019-03-29 16:13:53 +0100] information/IdoMysqlConnection: Last update by endpoint 'master1' was 8.33246s ago (< failover timeout of 30s). Retrying.
[2019-03-29 16:14:23 +0100] information/IdoMysqlConnection: Last update by endpoint 'master1' was 38.3288s ago. Taking over 'ido-mysql' in HA zone 'master'.
```
- Add more logging for reconnect and disconnect handling
- Add 'last_failover' attribute to IDO*Connection objects
refs #6970
2019-04-01 08:50:00 +02:00
Michael Friedrich
48b3d25ce2
Fix license headers
2019-03-28 11:47:47 +01:00
Michael Friedrich
566e59bbfa
Make NotificationResult available for events: Cluster and Features
2019-03-28 11:42:28 +01:00
Michael Friedrich
1706b297a5
Implement last_notification_result handling for Notification objects
2019-03-28 10:43:35 +01:00
Michael Friedrich
ac483f2a8a
Add OnNewNotificationResult signal and ProcessNotificationResult handler
2019-03-28 10:42:04 +01:00
Michael Friedrich
9621fd2e4b
Add NotificationResult class
2019-03-28 10:42:04 +01:00
Michael Friedrich
c2bf4cca9f
Disable feature HA by default (InfluxDB, Graphite, Gelf, Elasticsearch, OpenTSDB, Perfdata)
2019-03-27 15:29:47 +01:00
Michael Friedrich
93030709f5
Implement previous_state_change
2019-03-27 11:43:14 +01:00
Michael Friedrich
06eacd13ab
Also apply buffer flush fix for Elasticsearch feature
2019-03-27 11:35:41 +01:00
Michael Friedrich
cb3729bc6a
InfluxDB: Flush only if there's data in the buffer
...
Regression from 2.10.4
2019-03-27 11:26:00 +01:00
Michael Friedrich
27a41804fc
Elasticsearch: Change Content-Type header to 'application/x-ndjson' for bulk streams
...
fixes #6609
2019-03-20 10:13:38 +01:00
Michael Friedrich
424929e66a
Improve logging of OpenTsdbWriter
2019-03-19 09:39:14 +01:00
Michael Friedrich
acf62d487e
Improve logging of GelfWriter
2019-03-19 09:39:14 +01:00
Michael Friedrich
783a4c832c
Improve logging of ElasticsearchWriter
2019-03-19 09:39:14 +01:00
Michael Friedrich
aa93c382e1
Improve logging of InfluxdbWriter
2019-03-19 09:39:14 +01:00
Michael Friedrich
82dcb3965b
Improve logging of GraphiteWriter
2019-03-19 09:39:09 +01:00
Michael Friedrich
9f91ab98b8
Merge pull request #7027 from Icinga/feature/es-improve-error-handling
...
Elasticsearch: Improve error handling/logging
2019-03-19 08:35:16 +01:00
Michael Friedrich
6ace8001d8
Merge pull request #7019 from Icinga/feature/new-json-library
...
Replace YAJL with nlohmann::json
2019-03-18 17:26:57 +01:00
Michael Friedrich
816a935b3d
Elasticsearch: Improve error handling/logging
...
- Missing content-type
- Wrong content-type shouldn't hide the error message
- Error message should include more details (request URL, etc.)
2019-03-18 16:41:01 +01:00
Alexander A. Klimov
b2e2b587da
ElasticsearchWriter: don't leak sockets
...
refs #7018
2019-03-18 15:09:07 +01:00
Alexander A. Klimov
0cf10c6306
Make buildable with VS 2017
2019-03-18 15:07:57 +01:00
Alexander A. Klimov
2a05b46431
Auto-sanitize data before en-/decoding JSON
2019-03-18 15:07:57 +01:00
Alexander A. Klimov
9daca0b216
Get rid of YAJL
2019-03-18 15:07:57 +01:00
Alexander A. Klimov
5882594b43
JsonEncode(): use nlohmann::json
2019-03-18 15:07:57 +01:00
Alexander A. Klimov
1b0367b740
JsonDecode(): use nlohmann::json::sax_parse()
2019-03-18 15:07:57 +01:00
Michael Friedrich
724b34c6f2
Integrate nlohmann_json into CMake
...
Better integration into base/json.cpp
Signed-off-by: Alexander A. Klimov <alexander.klimov@icinga.com>
2019-03-18 15:07:50 +01:00
Michael Friedrich
2de8bac588
Merge pull request #6990 from Icinga/bugfix/influxdbwriter-oom-6989
...
InfluxdbWriter: don't leak sockets
2019-03-18 14:38:04 +01:00
Michael Friedrich
ea80d93efc
Merge pull request #7014 from Icinga/feature/utf8cpp
...
Utility::ValidateUTF8(): use UTF8-CPP
2019-03-18 10:57:03 +01:00
Michael Friedrich
804c00ece5
Merge pull request #6999 from Icinga/bugfix/compiler-warnings
...
Suppress or fix compiler warnings
2019-03-18 08:44:30 +01:00
Alexander A. Klimov
a72f4db5c9
Utility::ValidateUTF8(): use UTF8-CPP
2019-03-15 13:34:20 +01:00
Michael Friedrich
026ed837ac
Merge pull request #6976 from Icinga/bugfix/so_reuseport-missing
...
Don't require OS headers to provide SO_REUSEPORT
2019-03-13 10:30:08 +01:00
Alexander A. Klimov
ac354f9e80
Don't abuse goto for building simple loops
2019-03-08 14:59:01 +01:00
Alexander A. Klimov
bf92e32496
Suppress or fix compiler warnings
2019-03-08 14:07:29 +01:00
Alexander A. Klimov
37b044ecda
PkiUtility::NewCa(): just warn if the CA files already exist
2019-03-01 14:37:45 +01:00
Alexander A. Klimov
2a6b122413
InfluxdbWriter: don't leak sockets
...
refs #6989
2019-03-01 14:30:49 +01:00
Alexander A. Klimov
a9841a9197
Defer: ensure not to throw any exceptions out of a destructor
...
refs #6989
2019-03-01 14:29:35 +01:00
Michael Friedrich
e2df11520e
Merge pull request #6970 from Icinga/bugfix/perfdata-gaps
...
Improve reload handling for features (metric & queue flush, activation priority)
2019-02-26 15:38:15 +01:00
Alexander A. Klimov
bf0c68757f
Don't require OS headers to provide SO_REUSEPORT
2019-02-26 11:25:44 +01: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
Michael Friedrich
d14a88235d
Replace Copyright header with a short version, part I
...
CLion -> replace in path
2019-02-25 14:48:22 +01:00
Michael Friedrich
ab7a799369
Implement ReloadTimeout constant and wait for enqueued checks on Stop()
2019-02-25 09:03:47 +01:00
Alexander A. Klimov
9558ebc0f4
Secure ApiUser::GetByAuthHeader() against timing attacks
2019-02-22 16:59:36 +01:00
Michael Friedrich
89634c2eb6
Re-add Defer functionality
2019-02-22 15:27:34 +01:00
Michael Friedrich
53acb8f2db
PerfdataWriter: Reset the rotation timer on Pause()
2019-02-22 09:34:16 +01:00
Michael Friedrich
30d98b49eb
Merge pull request #6896 from Icinga/bugfix/notification-delay-5561
...
Notification#BeginExecuteNotification(): SetNextNotification() correctly
2019-02-22 09:27:59 +01:00
Michael Friedrich
68e7027c93
GelfWriter: Ensure to join queue and execute queries on Pause/Shutdown/Reload
2019-02-20 17:18:24 +01:00
Michael Friedrich
24c3572b03
OpenTsdbWriter: Ensure to reset reconnect timer on Pause()
2019-02-20 17:17:45 +01:00
Michael Friedrich
301c48e9bc
ElasticWriter: Ensure to flush buffers on Pause/Shutdown/Reload
2019-02-20 17:11:39 +01:00
Michael Friedrich
1bfe756cb1
DB IDO: Improve queue handling on Pause/Shutdown/Reload
2019-02-20 17:10:46 +01:00
Michael Friedrich
d4bdebc795
InfluxdbWriter: Ensure to flush buffers after emptying the metrics queue on Pause/Shutdown/Reload
...
Patch taken from @al2klimov but moved into Pause()
2019-02-20 16:30:13 +01:00
Michael Friedrich
d79390083d
GraphiteWriter: Improve Pause/Shutdown/Reload handling for metrics
2019-02-20 14:54:23 +01:00
Michael Friedrich
388999a86f
PerfdataWriter: Rotate and close files on Pause/Shutdown/Reload
...
Refactored the code into a local mutex and added
some more debug logging while at it.
2019-02-20 14:20:53 +01:00
Michael Friedrich
7936a147ba
Activate downtimes before any checkable object
2019-02-20 13:56:15 +01:00
Michael Friedrich
a4f97c1246
Stop the IcingaApplication at the latest point, before any loggers
2019-02-20 13:55:34 +01:00
Michael Friedrich
a25e2b1038
Stop object in reversed activation priority order
...
This stops the checker component first, then notifications, then
features, then config objects, then the API feature and logger(s).
Patch taken from @al2klimov
2019-02-20 12:38:57 +01:00
Michael Friedrich
9d5dc4afc1
Start the checker component at the latest point possible
2019-02-20 12:37:48 +01:00
Michael Friedrich
cc8dd42c0a
Start the notification component after general features
2019-02-20 12:11:59 +01:00
Michael Friedrich
819594e7b4
Merge pull request #6953 from Icinga/bugfix/style
...
Fix indent in configcompiler.cpp
2019-02-20 11:32:29 +01:00
Michael Friedrich
7b2b45b503
Revert "InfluxdbWriter#Stop(): flush buffer"
...
This reverts commit 8470facfe2
.
2019-02-19 14:54:28 +01:00
Michael Friedrich
5da1cbd096
Revert "Respect activation priority also on deactivation"
...
This reverts commit 8ad1717055
.
2019-02-19 14:30:44 +01:00
Michael Friedrich
4edd3ece66
Revert "Deactivate perfdata writers after checker"
...
This reverts commit f0e12ff63c
.
2019-02-19 14:06:15 +01:00
Michael Friedrich
d2e049d575
Revert "CheckerComponent#Stop(): log after actually being stopped"
...
This reverts commit b81aa6af3a
.
2019-02-19 14:05:07 +01:00
Michael Friedrich
a2f5b7a02c
Revert "CheckerComponent#Stop(): wait for all running checks"
...
This reverts commit 1eaad0637b
.
2019-02-19 14:05:00 +01:00