mirror of https://github.com/Icinga/icinga2.git
Merge pull request #5675 from froehl/feature/influxdbwriter-perf-unit-5627
Add pdv unit to influxdbwriter if not empty + doc
This commit is contained in:
commit
57e74372d3
|
@ -269,7 +269,7 @@ expects the InfluxDB daemon to listen at `127.0.0.1` on port `8086`.
|
||||||
|
|
||||||
Measurement names and tags are fully configurable by the end user. The InfluxdbWriter
|
Measurement names and tags are fully configurable by the end user. The InfluxdbWriter
|
||||||
object will automatically add a `metric` tag to each data point. This correlates to the
|
object will automatically add a `metric` tag to each data point. This correlates to the
|
||||||
perfdata label. Fields (value, warn, crit, min, max) are created from data if available
|
perfdata label. Fields (value, warn, crit, min, max, unit) are created from data if available
|
||||||
and the configuration allows it. If a value associated with a tag is not able to be
|
and the configuration allows it. If a value associated with a tag is not able to be
|
||||||
resolved, it will be dropped and not sent to the target host.
|
resolved, it will be dropped and not sent to the target host.
|
||||||
|
|
||||||
|
|
|
@ -264,6 +264,9 @@ void InfluxdbWriter::SendPerfdata(const Dictionary::Ptr& tmpl, const Checkable::
|
||||||
if (pdv->GetMax())
|
if (pdv->GetMax())
|
||||||
fields->Set("max", pdv->GetMax());
|
fields->Set("max", pdv->GetMax());
|
||||||
}
|
}
|
||||||
|
if (!pdv->GetUnit().IsEmpty()) {
|
||||||
|
fields->Set("unit", pdv->GetUnit());
|
||||||
|
}
|
||||||
|
|
||||||
SendMetric(tmpl, pdv->GetLabel(), fields, ts);
|
SendMetric(tmpl, pdv->GetLabel(), fields, ts);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue