Commit Graph

53 Commits

Author SHA1 Message Date
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
Simon Murray c6add53152 Fix InfluxDB Writer Key Escaping
The escaping wasn't being performed on measuerments, keys or tag values.  The
escape function was returning the input and not the modified ouput, so this
has been fixed

refs #12047

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
2016-06-27 12:07:07 +02:00
Michael Friedrich 7077ca1a53 Add acknowledgement type to Graphite, InfluxDB, OpenTSDB metadata
fixes #12018
2016-06-23 13:04:23 +02:00
Simon Murray 2e8c8809ea Add service metadata to InfluxDB Writer
Adds a new configuration variable in keeping with the graphite writer
which defaults to false to save network bandwidth.  All metrics currently
supported by graphite are now available to InfluxDB.  I added in some
formatting functions, to handle integers and booleans as we know and
control their types, and the supporting regexes in the sanity checker.

Updating to InfluxDB 0.13.X started giving 400 errors due to the missing
Host header in HTTP/1.1 requests.  HttpRequest has been updated to auto-
magically add the host and port to these requests if not explicitly
stated by the client code.

The exception code has been cleaned up to break out of the function
early if such a condition is raised, this avoids unnecessarily executing
code which will ultimately fail.

fixes #11912

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
2016-06-08 13:23:52 +02:00
Simon Murray 899592c8ad Update InfluxDB line formatting
Fixes a couple issues to do with line formatting of influx DB data points.  All
keys and values need commas and white space escaping.  Values are also checked
for type.  If a numeric or scientific value is detected this is output as an
Influx floating point/scientific number.  Booleans are detected and output in
a canonical format.  All other values are strings, which have double quotes
escaped and the entire string is wrapped in double quotes.  The handling of
thresholds has changed before this becomes officially released.  These values
if available are passed to the accumulation function in a dictionary, said
dictionary builds a single data point with multiple fields, rather than the
existing 5 data points, thus saving bandwidth costs.

fixes #11904

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
2016-06-08 11:01:23 +02:00
Gunnar Beutner bb69540b32 Fix exception in PerfdataWriter::RotateFile
fixes #11801
2016-05-18 14:01:32 +02:00
Jason Young 7dbd66535a Throw exception if PerfdataWriter::RotateFile fails to rename from host_temp_path to host_perfdata_path (and same for service)
This can happen if the two paths are not on the same mount-point.

fixes #9236

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
2016-05-11 09:29:32 +02:00
Michael Friedrich ba82d2eb20 Move CalculateExecutionTime and CalculateLatency into the CheckResult class
fixes #11751
2016-05-10 12:16:49 +02:00
Simon Murray 79c1e883d1 Add InfluxDB Writer
Adds an Icinga2 object to directly interface with InfluxDB's native HTTP API.
This supports optional basic authorization, and TLS transport.  InfluxDB didn't
appear to like having the TLS stream kept open, so instead this object buffers
data points which are then flushed to InfluxDB as a batch write, either driven
by a configurable timeout or threshold.

As InfluxDB is a schema-less database the host and service templates are user
configurable allowing both the measurement field and tags to be set by the
end user via macro expansion.  This allows access to tag fields from arbitrary
data associated with host.vars or service.vars.  If a particular value is
unable to be resolved, the tag will be dropped and not transmitted to InfluxDB.

Also alters URL handling to omit array brackets when only a single value is
attached to a key, otherwise InfluxDB has a strop with non-standard syntax.

fixes #10480

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
2016-05-03 14:12:51 +02:00
Marius Sturm 15cb9c1c1a Use check_result timestamp for GELF log messages
fixes #9184

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
2016-04-11 14:48:16 +02:00
Gunnar Beutner 599929b0f6 Update copyright headers for 2016 2016-01-12 08:29:59 +01:00
Daniil Yaroslavtsev d739675799 GelfWriter: Add additional fields for 'CHECK RESULT' events
fixes #9858
2015-12-18 11:05:38 +01:00
Gunnar Beutner 050c520b2a Convert Comment/Downtime to config objects
fixes #9777
2015-10-28 17:56:29 +01:00
Gunnar Beutner b77c9edca0 Remove unnecessary default values
refs #9461
refs #8149
2015-10-20 08:06:25 +02:00
Jean-Marcel Flach 4ef9761fee Implement status api handler
Global statistics, features, etc.

fixes #10116
2015-09-23 16:59:07 +02:00
Tobias von der Krone da8613acf9 Add timestamp support for OpenTSDB
fixes #9183
2015-09-15 15:37:15 +02:00
Michael Friedrich b10cb8a2e7 Implement a better Graphite tree schema
This changes the entire tree, but with the prefix "icinga2"
not to conflict with existing installations. Includes
enable_legacy_mode and detailed documentation.

fixes #9461
fixes #8149
2015-09-06 11:10:49 +02:00
Michael Friedrich 50cd694142 Fix wrong calculation for host compat state UNREACHABLE
fixes #10058
2015-09-04 13:24:41 +02:00
Gunnar Beutner f45f6ccd82 Implement support for tracking dependencies between config objects
refs #9096
2015-08-25 13:54:05 +02:00
Gunnar Beutner d118b71a2a Fix compiler warnings
fixes #9929
2015-08-18 07:46:04 +02:00
Gunnar Beutner 071d2f18fb Rename DynamicObject/DynamicType to ConfigObject/ConfigType
fixes #9914
2015-08-15 20:40:41 +02:00
Michael Friedrich d7970f5bb1 Implement modified attributes v2
refs #9081
refs #9093
2015-08-15 20:07:10 +02:00
Tobias von der Krone 80d0d7dc7a Correct escaping of metric and tag names for OpenTSDB perfdata plugin
fixes #9665
2015-07-20 07:59:13 +02:00
Michael Friedrich dcc8704e2d Add timestamp support for PerfdataWriter
Change the default from $timet$ to ${host,service}.last_check$

fixes #9185
2015-04-27 15:06:48 +02:00
Gunnar Beutner 72a7b08480 Move implementation code from thpp files into separate files
fixes #8890
2015-03-28 11:08:12 +01:00
Gunnar Beutner ec7224e3ed Generate C++ code for type validators
fixes #7709
fixes #8867
2015-03-27 07:59:27 +01:00
Michael Friedrich 24852e05c7 Move ValidateMacroString into the MacroProcessor class
refs #7311
2015-02-11 16:14:59 +01:00
Gunnar Beutner cb6f1043e1 Replace if( with if ( 2015-02-11 15:47:45 +01:00
Michael Friedrich 8ca57cba03 Add macro config validator for command args, env, custom attr, perfdata templates
fixes #7311
2015-02-11 15:32:10 +01:00
Michael Friedrich ea2ac81003 Remove name and return value for stats functions
fixes #6171
2015-02-07 22:36:17 +01:00
Gunnar Beutner 20d999e275 Add timestamp support for Graphite
fixes #8374
2015-02-06 08:53:06 +01:00
Gunnar Beutner 1bff5eb706 Fix missing files in the Windows package
fixes #8200
2015-02-02 10:36:58 +01:00
Tobias von der Krone 201883ff70 Add OpenTSDB perfdata plugin
refs #7256

Signed-off-by: Gunnar Beutner <gunnar@beutner.name>
2015-01-28 12:39:01 +01:00
Gunnar Beutner a11cdbdc39 Replace spaces with tabs 2015-01-27 10:50:15 +01:00
Michael Friedrich 78bfd0204c Update copyright year 2015-01-22 12:00:23 +01:00
Gunnar Beutner cb7f93dc19 Implement CMake options for some of the modules
fixes #7794
fixes #7795
2014-12-19 09:46:41 +01:00
Gunnar Beutner 55b7f00382 Remove unnecessary includes 2014-12-15 10:16:06 +01:00
Gunnar Beutner 9dfa3d22d4 Implement support for arrays in command arguments
fixes #6709
2014-11-27 13:24:07 +01:00
Gunnar Beutner e05cd3144f Fix incorrect operators in GelfWriter::NotificationToUserHandler
fixes #7866
2014-11-27 09:40:27 +01:00
Michael Friedrich 43267d7759 GelfWriter: Change _state to human-readable string
refs #7619
2014-11-12 17:58:13 +01:00
Michael Friedrich 07c9701b83 GelfWriter: Add missing fields, fix notification state
refs #7619
2014-11-12 17:48:48 +01:00
Michael Friedrich 5ac03849d2 GelfWriter: Add 'source' configuration attribute
refs #7619
2014-11-11 14:16:48 +01:00
Michael Friedrich 3211756656 Rebase against master changes, fix indent
refs #7619
2014-11-11 14:16:48 +01:00
Michael Friedrich 721483e0b2 Add a type validafor for GelfWriter
refs #7619
2014-11-11 14:16:48 +01:00
Marius Sturm 6055cd194a Add GelfWriter
refs #7619
2014-11-11 14:16:48 +01:00
Gunnar Beutner 478f03b49a Replace boost::shared_ptr with boost::intrusive_ptr
refs #7622
2014-11-09 16:54:41 +01:00
Gunnar Beutner 170c5a59e4 Implement typeof() function 2014-11-03 00:45:14 +01:00
Gunnar Beutner 9368ff0e03 Update some more log messages 2014-10-20 10:09:57 +02:00
Gunnar Beutner 2d5e9514a5 Refactor logging code 2014-10-19 17:52:17 +02:00