From 7077ca1a53a2d43331ea909e516dce3ec9709911 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Thu, 23 Jun 2016 13:04:23 +0200 Subject: [PATCH] Add acknowledgement type to Graphite, InfluxDB, OpenTSDB metadata fixes #12018 --- doc/15-features.md | 4 ++++ lib/perfdata/graphitewriter.cpp | 2 ++ lib/perfdata/influxdbwriter.cpp | 1 + lib/perfdata/opentsdbwriter.cpp | 1 + 4 files changed, 8 insertions(+) diff --git a/doc/15-features.md b/doc/15-features.md index 30ad407c1..f01c54d74 100644 --- a/doc/15-features.md +++ b/doc/15-features.md @@ -215,6 +215,7 @@ By enabling `enable_send_metadata` Icinga 2 automatically adds the following met .metadata.current_attempt .metadata.downtime_depth + .metadata.acknowledgement .metadata.execution_time .metadata.latency .metadata.max_check_attempts @@ -230,6 +231,7 @@ Metadata metric overview: max_check_attempts | maximum check attempts until the hard state is reached reachable | checked object is reachable downtime_depth | number of downtimes this object is in + acknowledgement | whether the object is acknowledged or not execution_time | check execution time latency | check latency state | current state of the checked object @@ -294,6 +296,7 @@ internal check statistic data to Graphite: max_check_attempts | maximum check attempts until the hard state is reached reachable | checked object is reachable downtime_depth | number of downtimes this object is in + acknowledgement | whether the object is acknowledged or not execution_time | check execution time latency | check latency state | current state of the checked object @@ -387,6 +390,7 @@ internal check statistic data to OpenTSDB: max_check_attempts | maximum check attempts until the hard state is reached reachable | checked object is reachable downtime_depth | number of downtimes this object is in + acknowledgement | whether the object is acknowledged or not execution_time | check execution time latency | check latency state | current state of the checked object diff --git a/lib/perfdata/graphitewriter.cpp b/lib/perfdata/graphitewriter.cpp index 3f59287e5..6b518a722 100644 --- a/lib/perfdata/graphitewriter.cpp +++ b/lib/perfdata/graphitewriter.cpp @@ -141,6 +141,7 @@ void GraphiteWriter::CheckResultHandler(const Checkable::Ptr& checkable, const C SendMetric(prefix_metadata, "state_type", checkable->GetStateType(), ts); SendMetric(prefix_metadata, "reachable", checkable->IsReachable(), ts); SendMetric(prefix_metadata, "downtime_depth", checkable->GetDowntimeDepth(), ts); + SendMetric(prefix_metadata, "acknowledgement", checkable->GetAcknowledgement(), ts); SendMetric(prefix_metadata, "latency", cr->CalculateLatency(), ts); SendMetric(prefix_metadata, "execution_time", cr->CalculateExecutionTime(), ts); } @@ -160,6 +161,7 @@ void GraphiteWriter::CheckResultHandler(const Checkable::Ptr& checkable, const C SendMetric(prefix, "state_type", checkable->GetStateType(), ts); SendMetric(prefix, "reachable", checkable->IsReachable(), ts); SendMetric(prefix, "downtime_depth", checkable->GetDowntimeDepth(), ts); + SendMetric(prefix, "acknowledgement", checkable->GetAcknowledgement(), ts); SendMetric(prefix, "latency", cr->CalculateLatency(), ts); SendMetric(prefix, "execution_time", cr->CalculateExecutionTime(), ts); SendPerfdata(prefix, cr, ts); diff --git a/lib/perfdata/influxdbwriter.cpp b/lib/perfdata/influxdbwriter.cpp index 10290ac45..1fdeca17e 100644 --- a/lib/perfdata/influxdbwriter.cpp +++ b/lib/perfdata/influxdbwriter.cpp @@ -222,6 +222,7 @@ void InfluxdbWriter::SendPerfdata(const Dictionary::Ptr& tmpl, const Checkable:: fields->Set(String("state_type"), FormatInteger(checkable->GetStateType())); fields->Set(String("reachable"), FormatBoolean(checkable->IsReachable())); fields->Set(String("downtime_depth"), FormatInteger(checkable->GetDowntimeDepth())); + fields->Set(String("acknowledgement"), FormatInteger(checkable->GetAcknowledgement())); fields->Set(String("latency"), cr->CalculateLatency()); fields->Set(String("execution_time"), cr->CalculateExecutionTime()); } diff --git a/lib/perfdata/opentsdbwriter.cpp b/lib/perfdata/opentsdbwriter.cpp index 1f9b3896a..494e62903 100644 --- a/lib/perfdata/opentsdbwriter.cpp +++ b/lib/perfdata/opentsdbwriter.cpp @@ -129,6 +129,7 @@ void OpenTsdbWriter::CheckResultHandler(const Checkable::Ptr& checkable, const C SendMetric(metric + ".state_type", tags, checkable->GetStateType(), ts); SendMetric(metric + ".reachable", tags, checkable->IsReachable(), ts); SendMetric(metric + ".downtime_depth", tags, checkable->GetDowntimeDepth(), ts); + SendMetric(metric + ".acknowledgement", tags, checkable->GetAcknowledgement(), ts); SendPerfdata(metric, tags, cr, ts); -- 2.40.0