diff -Nru collectd-5.7.2/debian/changelog collectd-5.7.2/debian/changelog --- collectd-5.7.2/debian/changelog 2018-01-14 09:03:27.000000000 -0500 +++ collectd-5.7.2/debian/changelog 2019-03-26 12:18:41.000000000 -0400 @@ -1,3 +1,13 @@ +collectd (5.7.2-2ubuntu1.1) bionic; urgency=medium + + * d/p/add-support-for-ceph-version-luminous.patch (LP: #1774032) + - This patch is not backward compatible with previous ceph versions. + + * d/p/ceph-plugin-Fix-2572.patch: + - ceph plugin causes collectd to segfault. + + -- Eric Desrochers Tue, 26 Mar 2019 12:18:41 -0400 + collectd (5.7.2-2ubuntu1) bionic; urgency=medium * d/p/fix-i2c-detection.patch fix i2c usage for 4.0 (LP: #1742691) diff -Nru collectd-5.7.2/debian/patches/add-support-for-ceph-version-luminous.patch collectd-5.7.2/debian/patches/add-support-for-ceph-version-luminous.patch --- collectd-5.7.2/debian/patches/add-support-for-ceph-version-luminous.patch 1969-12-31 19:00:00.000000000 -0500 +++ collectd-5.7.2/debian/patches/add-support-for-ceph-version-luminous.patch 2019-03-26 12:16:39.000000000 -0400 @@ -0,0 +1,68 @@ +Description: Add support for ceph version luminous + This patch is not backward compatible with previous ceph versions +Author: Aleksei Zakharov +Origin: upstream, https://github.com/collectd/collectd/commit/647ac31bf9db60b1685d6d8d25be65375ba85891 +Bug-Ubuntu: https://launchpad.net/bugs/1774032 +Index: collectd-5.7.2/src/ceph.c +=================================================================== +--- collectd-5.7.2.orig/src/ceph.c ++++ collectd-5.7.2/src/ceph.c +@@ -278,7 +278,8 @@ static int ceph_cb_number(void *ctx, con + + /* Special case for latency metrics. */ + if ((strcmp("avgcount", state->key) == 0) || +- (strcmp("sum", state->key) == 0)) { ++ (strcmp("sum", state->key) == 0) || ++ (strcmp("avgtime",state->key) == 0)) { + latency_type = 1; + + /* depth >= 2 => (stack[-1] != NULL && stack[-2] != NULL) */ +@@ -913,27 +914,34 @@ static int node_handler_fetch_data(void + // return after saving avgcount - don't dispatch value + // until latency calculation + return 0; +- } else { +- double sum, result; +- sscanf(val, "%lf", &sum); +- ++ } else if (vtmp->avgcount_exists == 0) { + if (vtmp->avgcount == 0) { + vtmp->avgcount = 1; + } +- +- /** User wants latency values as long run avg */ ++ vtmp->avgcount_exists = 1; ++ // user wants latency values as long run avg ++ // skip this step + if (long_run_latency_avg) { +- result = (sum / vtmp->avgcount); +- } else { +- result = get_last_avg(vtmp->d, ds_name, vtmp->latency_index, sum, +- vtmp->avgcount); +- if (result == -ENOMEM) { +- return -ENOMEM; +- } ++ return 0; ++ } ++ double sum, result; ++ sscanf(val, "%lf", &sum); ++ result = get_last_avg(vtmp->d, ds_name, vtmp->latency_index, sum, ++ vtmp->avgcount); ++ if (result == -ENOMEM) { ++ return -ENOMEM; + } +- + uv.gauge = result; ++ vtmp->latency_index = (vtmp->latency_index + 1); ++ } else if (vtmp->avgcount_exists == 1 ) { + vtmp->avgcount_exists = -1; ++ // skip this step if no need in long run latency ++ if (!long_run_latency_avg) { ++ return 0; ++ } ++ double result; ++ sscanf(val, "%lf", &result); ++ uv.gauge = result; + vtmp->latency_index = (vtmp->latency_index + 1); + } + break; diff -Nru collectd-5.7.2/debian/patches/ceph-plugin-Fix-2572.patch collectd-5.7.2/debian/patches/ceph-plugin-Fix-2572.patch --- collectd-5.7.2/debian/patches/ceph-plugin-Fix-2572.patch 1969-12-31 19:00:00.000000000 -0500 +++ collectd-5.7.2/debian/patches/ceph-plugin-Fix-2572.patch 2019-03-26 12:17:49.000000000 -0400 @@ -0,0 +1,19 @@ +Description: ceph plugin: Fix #2572 + ceph plugin causes collectd to segfault +Author: Florian Forster +Origin: upstream, https://github.com/collectd/collectd/commit/de05fb53fad6bc998f585b704ca0caeadc14a035 +Bug: https://github.com/collectd/collectd/issues/2572 +Bug-Ubuntu: https://launchpad.net/bugs/1774032 +Index: collectd-5.7.2/src/ceph.c +=================================================================== +--- collectd-5.7.2.orig/src/ceph.c ++++ collectd-5.7.2/src/ceph.c +@@ -293,7 +293,7 @@ static int ceph_cb_number(void *ctx, con + * the same type of other "Bytes". Instead of keeping an "average" or + * "rate", use the "sum" in the pair and assign that to the derive + * value. */ +- if (convert_special_metrics && (state->depth >= 2) && ++ if (convert_special_metrics && (state->depth > 2) && + (strcmp("filestore", state->stack[state->depth - 2]) == 0) && + (strcmp("journal_wr_bytes", state->stack[state->depth - 1]) == 0) && + (strcmp("avgcount", state->key) == 0)) { diff -Nru collectd-5.7.2/debian/patches/series collectd-5.7.2/debian/patches/series --- collectd-5.7.2/debian/patches/series 2018-01-14 09:03:27.000000000 -0500 +++ collectd-5.7.2/debian/patches/series 2019-03-26 12:16:56.000000000 -0400 @@ -8,3 +8,5 @@ write_mongodb.patch CVE-2017-16820-snmp-plugin-Fix-double-free-of-request-PDU.patch fix-i2c-detection.patch +add-support-for-ceph-version-luminous.patch +ceph-plugin-Fix-2572.patch