101 Commits

Author SHA1 Message Date
Michael Friedrich
836103ef57 Elasticsearch: Fix crash with invalid performance data metrics
fixes #6191

refs #6192
2018-04-17 16:33:17 +02:00
Noah Hilverling
9a6474f355 Fix InfluxDB backslash escaping
fixes #6182

refs #6196
2018-04-16 15:46:47 +02:00
Noah Hilverling
6dba6a0bfb Add missing string escaping
fixes #5987
2018-01-17 15:02:33 +01:00
Gunnar Beutner
7f92016e38 Fix performance issues for InfluxdbWriter 2018-01-17 15:02:33 +01:00
Michael Friedrich
b4a0495239 Revert "Fix performance issues for InfluxdbWriter"
This reverts commit eea451ee94be7310e63ab6b7e5e94924b295e974.

refs #5764
2018-01-16 10:45:20 +01:00
Michael Friedrich
1256fb3356 Revert "Fix newline terminator for bulk requests in ElasticsearchWriter"
This reverts commit 806eb0d2d2b077a9a4bac073bfbb27c2af369008.

refs #5840
2017-12-22 09:53:56 +01:00
Gunnar Beutner
eea451ee94 Fix performance issues for InfluxdbWriter 2017-12-12 10:36:45 +01:00
Michael Friedrich
806eb0d2d2 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

refs #5840
2017-12-07 17:07: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
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
Michael Friedrich
f42b820007 GraphiteWriter: Add 'connected' to stats; fix reconnect exceptions 2017-06-06 19:50:37 +02:00
Michael Friedrich
f10815efa2 GelfWriter: Use async work queue and add feature metric stats
fixes #4532
2017-06-06 19:48:23 +02:00
Gunnar Beutner
1fd2695e02 Fix compiler warnings
refs #5287
2017-05-29 09:13:19 +02:00
Michael Friedrich
dab2522acc InfluxDB: Optimize work queue event handling
refs #5219
2017-05-26 17:11:13 +02:00
Michael Friedrich
28395b32f0 GraphiteWriter: Use a workqueue for event processing
This also adds reconnect handling and exceptions.

refs #5132
refs #5133
refs #5280
2017-05-26 15:18:14 +02:00
Michael Friedrich
647d82094f InfluxDB: Remove obsolete logger, now implemented in WorkQueue class
refs #5280
refs #5133
2017-05-24 17:01:46 +02:00
Michael Friedrich
d366a63510 Add API & Cluster stats to /v1/status & icinga check performance metrics
refs #5133
2017-05-24 16:21:05 +02:00
Michael Friedrich
52d986d02b Revert "Add LogstashWriter feature"
This reverts commit f5a971f5b0a7ddcbfe20c993eec01c720f0d3dd9.

refs #4054
2017-05-23 12:05:01 +02:00
Michael Friedrich
4c7660190f Revert "Review LogstashWriter feature implementation"
This reverts commit bd5ff814f23a11093832e59f0716ff151f68eea5.

refs #4054
2017-05-23 12:04:08 +02:00
Michael Friedrich
79dcb789c2 Move PerfdataValue() class into base library
This is required for libremote and ApiListener stats in #5133
2017-05-15 16:32:29 +02:00
Michael Friedrich
2338db5f6a Fix performance data processing in GelfWriter feature
Includes fixes for possible crashes on empty check results.

fixes #4666
2017-05-15 13:46:43 +02:00
Simon Murray
fc2c2d9a29 Verbose InfluxDB Error Logging
On a non 204 response we parse the HTTP response until complete e.g. do the headers
and body, not just the header.  A new interface is added to the response to allow us
to determine the body size so that it may be read out and buffered.  The body is
parsed and any error message printed out.  In the event that the parsing fails the
raw body is dumped out; better than nothing!

fixes #4411

Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>
2017-05-11 12:13:41 +02:00
Gunnar Beutner
c611a31670 Fix code style issues
refs #5219
2017-05-09 09:01:08 +02:00
Gunnar Beutner
f9b34cca30 Fix compiler warning
refs #5219
2017-05-08 08:47:27 +02:00
Michael Friedrich
3649a5a0d7 InfluxdbWriter: Use a work queue for async message processing; add stats log/api 2017-05-05 17:56:51 +02:00
Michael Friedrich
bd5ff814f2 Review LogstashWriter feature implementation
refs #4054
2017-03-20 14:30:03 +01:00
Kai Goller
f5a971f5b0 Add LogstashWriter feature
This adds the UdpSocket class.

refs #4054
2017-03-20 14:30:03 +01:00
Michael Friedrich
3993276b74 Add a removal note for enable_legacy_mode for GraphiteWriter
refs #4992
2017-02-10 11:33:32 +01:00
Michael Friedrich
e5f5284838 Add logging for started/stopped features
fixes #3557
2017-02-08 15:40:27 +01:00
Simon Murray
041772fb28 PerfData: Server Timeouts for InfluxDB Writer
Exposes the TCP socket used to communicate with the InfluxDB server.  When we are
expecing a response we can now call poll() on the socket to wait for data to become
available.  If it doesn't in a user configurable timeout period we abort the request.

fixes #4927
fixes #4941

Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>
2017-02-07 17:06:46 +01:00
Michael Friedrich
b7caf0820d Ensure that *.icinga.com is used everywhere
fixes #13897
fixes #13277
2017-01-10 17:19:12 +01:00
Simon Murray
2c37a00daf InfluxDB: Always Write Out Metadata
Previously the logic would just bail out if no performance data was associated with a
check, the problem being that check metadata was skipped too.  This rearranges the code
to dump out performance metrics if they exist, then dump out metadata if requested.  This
also fixes an issue whereby metadata was being sent for every performance data in the
check result, rather than just once, so we save a bit of bandwidth as a result.

fixes #12276

Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>
2016-11-09 16:10:21 +01:00
Gunnar Beutner
30762e5330 Set versions for all internal libraries
fixes #12552
2016-08-25 17:56:18 +02:00
Gunnar Beutner
288413f046 Replace BOOST_FOREACH with range-based for loops
fixes #12538
2016-08-25 06:46:17 +02:00
Gunnar Beutner
429d11daa8 Fix compiler warnings
fixes #12534
2016-08-24 20:33:34 +02:00
Gunnar Beutner
ae1ab5f865 Implement unit tests for state changes
fixes #12530
2016-08-24 19:45:52 +02:00
Rune Darrud
5c0b3c58bd Do not escape backslashes and separators twice
fixes #12227

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
2016-08-17 06:10:41 +02:00
Marius Sturm
451cd73749 GelfWriter: Use raw CheckResult output for full_message attribute
fixes #10903

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
2016-08-09 09:51:17 +02:00
Simon Murray
84ea0065b2 Fix InfluxdbWriter Trailing Backslash
Backslashes escape spaces or commas (and evidently equals), given tags are
separated by commas, tag keys and values are separated by equals and tags
are separated from fields by a space we need to take action when these end
in a backslash e.g. 'C:\'.  Also discovered a bug whereby the metric tag was
missing out on escaping.

fixes #12227

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
2016-07-29 06:51:33 +02:00