From 6c577d65d2bd6ab87a9b5dc78078e61b40f5562b Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Thu, 17 Aug 2017 10:33:08 +0200 Subject: [PATCH] InfluxdbWriter: Log a warning about soon-to-be-removed socket_timeout attribute for 2.7.x refs #5460 refs #5469 refs #5504 --- lib/perfdata/influxdbwriter.cpp | 4 ++++ lib/perfdata/influxdbwriter.hpp | 1 + lib/perfdata/influxdbwriter.ti | 3 +++ 3 files changed, 8 insertions(+) diff --git a/lib/perfdata/influxdbwriter.cpp b/lib/perfdata/influxdbwriter.cpp index 0a7f506fd..191748c56 100644 --- a/lib/perfdata/influxdbwriter.cpp +++ b/lib/perfdata/influxdbwriter.cpp @@ -541,3 +541,7 @@ void InfluxdbWriter::ValidateServiceTemplate(const Dictionary::Ptr& value, const } } +void InfluxdbWriter::ValidateSocketTimeout(int, const ValidationUtils&) +{ + Log(LogWarning, "InfluxdbWriter", "'socket_timeout' option has no effect and will be removed in Icinga 2 v2.8"); +} diff --git a/lib/perfdata/influxdbwriter.hpp b/lib/perfdata/influxdbwriter.hpp index e0a149c3a..2d455c1f8 100644 --- a/lib/perfdata/influxdbwriter.hpp +++ b/lib/perfdata/influxdbwriter.hpp @@ -49,6 +49,7 @@ public: virtual void ValidateHostTemplate(const Dictionary::Ptr& value, const ValidationUtils& utils) override; virtual void ValidateServiceTemplate(const Dictionary::Ptr& value, const ValidationUtils& utils) override; + virtual void ValidateSocketTimeout(int value, const ValidationUtils& utils) override; protected: virtual void OnConfigLoaded(void) override; diff --git a/lib/perfdata/influxdbwriter.ti b/lib/perfdata/influxdbwriter.ti index a2bf19248..94188471f 100644 --- a/lib/perfdata/influxdbwriter.ti +++ b/lib/perfdata/influxdbwriter.ti @@ -90,6 +90,9 @@ class InfluxdbWriter : ConfigObject [config] int flush_threshold { default {{{ return 1024; }}} }; + [config] int socket_timeout { + default {{{ return 5; }}} + }; }; validator InfluxdbWriter {