Commit Graph

230 Commits

Author SHA1 Message Date
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 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 2a6b122413 InfluxdbWriter: don't leak sockets
refs #6989
2019-03-01 14:30:49 +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
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 53acb8f2db PerfdataWriter: Reset the rotation timer on Pause() 2019-02-22 09:34:16 +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 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 7b2b45b503 Revert "InfluxdbWriter#Stop(): flush buffer"
This reverts commit 8470facfe2.
2019-02-19 14:54:28 +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 845c72f656
Merge pull request #6882 from Icinga/bugfix/influxdb-gaps-6841
InfluxdbWriter#Stop(): flush buffer
2019-02-11 17:32:05 +01:00
Alexander A. Klimov f0e12ff63c Deactivate perfdata writers after checker 2019-01-24 13:50:26 +01:00
Alexander A. Klimov 8470facfe2 InfluxdbWriter#Stop(): flush buffer
refs #6841
2019-01-08 18:15:32 +01:00
Michael Insel b0cf92fd17 Fix deadlock in GraphiteWriter
This fixes a deadlock in the GraphiteWriter feature, which is visible
during the reload process. The reload thread waits for the
GraphiteWriter to finish, but the GraphiteWriter can't finish because
it's stuck in `SendMetric()` waiting for a lock which is hold by the
reload thread.
2018-11-12 20:12:40 +01:00
Michael Friedrich 028946a1cc Implement HA functionality for Perfdata feature 2018-10-24 14:42:52 +02:00
Michael Friedrich 97c1296e99 Implement HA functionality for OpenTsdb feature 2018-10-24 14:42:46 +02:00
Michael Friedrich b905999f4b Implement HA functionality for Gelf feature 2018-10-24 13:50:10 +02:00
Michael Friedrich 5e241dc815 Implement HA functionality for InfluxDB feature 2018-10-24 13:44:56 +02:00
Michael Friedrich 37ccffc7e5 Implement HA functionality for Graphite feature 2018-10-24 13:44:52 +02:00
Michael Friedrich 59389f564c Implement HA functionality for Elasticsearch feature 2018-10-24 13:20:03 +02:00
Michael Friedrich 001ffda61c Revert code from icinga.com update 2018-10-24 12:34:23 +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
Noah Hilverling 3854ed683b Improve TLS handshake exception logging 2018-09-06 15:58:42 +02:00
Gunnar Beutner e678fa1aa5 Refactor Application::*Const() 2018-08-13 15:27:05 +02:00
Markus Frosch 9fbc40615a Improve path handling in cmake and daemon 2018-08-07 14:10:26 +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
jre3brg 2fd94073ba Fixed opentsdb metric name with colon chars 2018-05-08 09:40:13 +02:00
Jean Flach c54e042942 Add activation priorities for config object types
This patch ensures that specific configuration types
are pre-activated and post-activated. In general,
logging is first, then common configuration objects
like host/service, downtimes, etc.
In the end, all features are activated after to ensure
that notifications are only sent once downtimes are applied.
A similar thing happens for starting with checks too early.
The ApiListener feature runs first to allow cluster connections
at first glance.

fixes #6057
fixes #6231
2018-05-04 11:25:47 +02:00
Jean Flach 1e0f67d778 Fix ES 5 support 2018-04-17 09:17:20 +02:00
Jean Flach fd5d4c5974 Move _type into url 2018-04-17 09:17:20 +02:00
Michael Friedrich 975ac47f8e Fix Elastic 6 support
fixes #5905
2018-04-17 09:17:20 +02:00
Michael Friedrich d398eca581
Merge pull request #6196 from Icinga/fix/influxdb-escaping
Fix InfluxDB backslash escaping
2018-04-05 15:27:06 +02:00
Noah Hilverling 0e17632bc4 Fix InfluxDB backslash escaping
fixes #6182
2018-04-04 13:02:48 +02:00
Michael Friedrich ecbbc2fcc5
Merge pull request #6194 from Icinga/feature/metric-unit-elastic-gelf
Elasticsearch/GELF: Add metric unit to performance data fields
2018-04-03 17:12:29 +02:00
Michael Friedrich d384dee204
Merge pull request #6193 from Icinga/fix/gelfwriter-invalid-perfdata-crash
GelfWriter: Fix crash on invalid performance data metrics
2018-04-03 14:52:12 +02:00
Michael Friedrich 313f25163b Elasticsearch/GELF: Add metric unit to performance data fields
Seen this inside the InfluxDBWriter code, makes sense to store
this in Elasticsearch too.
2018-04-03 14:49:50 +02:00
Michael Friedrich 6609ec647f GelfWriter: Fix crash on invalid performance data metrics
Spotted while comparing the source code of several performance data
writer.

refs #6191
2018-04-03 14:43:48 +02:00
Michael Friedrich 85eba79f55 Elasticsearch: Fix crash with invalid performance data metrics
fixes #6191
2018-04-03 14:38:25 +02:00
Gunnar Beutner 94e6be1a65 Remove unused includes 2018-01-22 09:52:29 +01:00
Michael Friedrich 777d85cecc
Merge pull request #5964 from fedepires/fix/opentsdbwriter-host-tag-5963
OpenTSDB writer - Fix function for escaping host tag chars.
2018-01-20 12:17:25 +01:00
Jean Flach 1da6b2c883 Fix whitespaces in CMakeLists files
Uses 2 space indentation as standard
2018-01-19 09:19:40 +01:00
Gunnar Beutner 9d436605f0 Fix compatibility with CMake < 3.1 2018-01-18 15:12:46 +01:00
Gunnar Beutner 71a032579b
Merge pull request #5995 from Icinga/fix/influxdb-requests
Fix InfluxDB requests
2018-01-17 10:28:15 +01:00
Gunnar Beutner 9ad5def531
Merge pull request #5994 from Icinga/fix/influxdb-template
InfluxDBWriter: Fix macro in template
2018-01-17 10:27:55 +01:00
Noah Hilverling b83af363ef Add missing string escaping to InfluxDB-Writer
fixes #5987
2018-01-17 10:26:09 +01:00
Noah Hilverling 9768e03107 InfluxDBWriter: Fix macro in template 2018-01-17 09:23:48 +01:00
Gunnar Beutner 2a9dceb367 Use CMake object libraries for our libs 2018-01-17 04:28:21 +01:00
Gunnar Beutner c2fb9fe226 Use initializer lists for arrays and dictionaries 2018-01-16 12:27:44 +01:00
Michael Friedrich 5222f7d058 GelfWriter should write the host notification output
No idea why there was a hardcoded unreachable message inside.
2018-01-15 13:39:34 +01:00
Gunnar Beutner 21254fb610 Avoid accessing attributes for validators where not necessary 2018-01-11 08:20:16 +01:00
Federico Pires 5cdc7c03f2 Fix function for escaping host tag chars.
refs #5963
2018-01-10 11:07:11 -03:00
Gunnar Beutner 91c256261a Apply clang-tidy fix 'modernize-use-default-member-init' 2018-01-04 12:24:58 +01:00
Gunnar Beutner becfa85094 Apply clang-tidy fix 'modernize-use-emplace' 2018-01-04 12:24:57 +01:00
Gunnar Beutner e3ad0be769 Apply clang-tidy fix 'modernize-use-auto' 2018-01-04 12:24:57 +01:00
Gunnar Beutner d6062eefbf Apply clang-tidy fix 'modernize-raw-string-literal' 2018-01-04 12:24:57 +01:00
Gunnar Beutner 621eed3f13 Apply clang-tidy fix 'modernize-pass-by-value' 2018-01-04 12:24:57 +01:00
Gunnar Beutner 9ca682496c Apply clang-tidy fix 'modernize-use-override' 2018-01-04 12:24:57 +01:00
Gunnar Beutner ac155d1dda Apply clang-tidy fix 'modernize-redundant-void-arg' 2018-01-04 12:24:57 +01:00
Gunnar Beutner efe99a3e5e Add the final keyword to classes 2018-01-04 05:20:20 +00:00
Gunnar Beutner 75e2473616 Clean up source lists in the CMakeLists.txt files 2018-01-03 11:47:46 +01:00
Gunnar Beutner 90496b5456 Build libraries as static libraries 2018-01-02 23:29:48 +01:00
Michael Insel 158ae2188e Change copyright header for 2018 2018-01-02 12:08:55 +01:00
Jean Flach 2636e6a77a Whitespace fix
What does this change?
* Remove use of spaces for formatting
These could be found by using `grep -r -l -P '^\t+ +[^*]'
* Removal of training whitespaces
* A few lines longer than 120 chars
2017-12-20 14:53:52 +01:00
Gunnar Beutner 1ad83886ac Replace a few more NULLs with nullptr 2017-12-14 15:37:20 +01:00
Gunnar Beutner 40f9431413 Fix performance issues for InfluxdbWriter 2017-12-12 10:39:55 +01:00
Michael Friedrich f8e102c15a Fix newline terminator for bulk requests in ElasticsearchWriter
This enables compatibility with 6.x.

This commit also fixes an incorrect HTTP response parsing
which could lead into false positives.

Analysis and fix in https://github.com/Icinga/icinga2/issues/5795#issuecomment-349920587

fixes #5795
2017-12-07 11:11:03 +01:00
Michael Friedrich a238613fdc
Merge pull request #5825 from Icinga/feature/boost-assign
Replace boost::assign::list_of with initializer lists
2017-11-30 21:20:46 +01:00
Gunnar Beutner 83f17b5bfa Replace boost::assign::list_of with initializer lists 2017-11-30 18:09:38 +01:00
Gunnar Beutner 3c60fbf75d Use std::vector::emplace_back instead of std::vector::push_back 2017-11-30 17:47:09 +01:00
Gunnar Beutner df8266631d Replace boost::tuple with std::tuple 2017-11-30 17:41:02 +01:00
Gunnar Beutner 6d09efc907 Use std::shared_ptr instead of boost::shared_ptr 2017-11-30 17:41:00 +01:00
Gunnar Beutner 858873b940 Replace boost::bind/boost::function with std::bind/std::function 2017-11-27 15:15:11 +01:00
Gunnar Beutner 57e74372d3
Merge pull request #5675 from froehl/feature/influxdbwriter-perf-unit-5627
Add pdv unit to influxdbwriter if not empty + doc
2017-11-27 10:32:44 +01:00
Michael Friedrich 7c0a09cfb6 Rename ElasticWriter to ElasticsearchWriter
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.
2017-11-09 15:33:10 +01:00
Fabian Röhl 82794474e6 Add pdv unit to influxdbwriter if not empty + doc
refs #5627
2017-10-13 14:54:00 +02:00
Michael Friedrich b9cfd4d2e9 Fix unnecessary String() casts in InfluxdbWriter
fixes #5629
2017-09-29 16:33:08 +02:00
Jean Flach 4df1125114 Fix Windows build error
fixes #5584
2017-09-18 17:47:08 +02:00
Michael Friedrich d801aaa611 ElasticWriter: Implement support for TLS connections (HTTP proxy)
This commit also enhances the log messages.

refs #5538
2017-09-12 11:36:28 +02:00
Michael Friedrich 7c264673d4 ElasticWriter: Add basic auth support for Elasticsearch behind an HTTP proxy
refs #5538
2017-09-11 17:00:33 +02:00
Michael Friedrich 0457117d8e Drop obsolete code
refs #4054
2017-09-11 14:29:24 +02:00
Jean Flach 651379db6f Add ElasticWriter
fixes #5538
2017-09-11 14:27:04 +02:00
Michael Friedrich d075665d1b Merge pull request #5486 from Icinga/feature/remove-deprecated-graphite-legacy-mode
Graphite: Remove deprecated legacy schema mode
2017-08-17 20:06:47 +02:00
Simon Murray abc3652b00 Fix TLS Race Connecting to InfluxDB
Rather than leaving stale connections about we tried to poll for data coming in
from InfluxDB and timeout if it didn't repond in a timely manner.  This introduced
a race where the timeout triggers, a context switch occurs where data is actually
available and the TlsStream spins trying to asynchronously notify that data is
available, but which never gets read.  Not only does this use up 100% of a core,
but it also slowly starves the system of handler threads at which point metrics
stop being delivered.

This basically removes the poll and timeout, any TLS socket erros should be
detected by TCP keep-alives.

Fixes #5460 #5469
2017-08-14 16:20:49 +01:00
Michael Friedrich eb5e299c4b Graphite: Remove deprecated legacy schema mode
This commit includes some code cleanup too.

fixes #4992
2017-08-09 18:52:35 +02:00
Michael Friedrich 2a4359d7e8 Windows build fix for InfluxdbWriter
refs #5219
fixes #5334
2017-06-07 14:16:15 +02:00
Michael Friedrich 89ac5b2fff GelfWriter: Add 'check_command' to CHECK RESULT/* NOTIFICATION/STATE CHANGE messages
This allows for much more easy filtering in Graylog web
similar to Graphite or InfluxDB and their template dashboards.
2017-06-06 20:23:26 +02:00
Michael Friedrich 41a400f552 Merge pull request #5330 from Icinga/feature/graphite-stats
GraphiteWriter: Add 'connected' to stats; fix reconnect exceptions
2017-06-06 20:13:33 +02:00