Auto-Merge pull request #2941 from octo/backport/01cf776
authorcollectd bot <32910397+collectd-bot@users.noreply.github.com>
Tue, 9 Oct 2018 06:08:03 +0000 (08:08 +0200)
committerGitHub <noreply@github.com>
Tue, 9 Oct 2018 06:08:03 +0000 (08:08 +0200)
Automatically merged due to "Automerge" label

src/ceph.c

index 73140a5..5ea9049 100644 (file)
@@ -281,7 +281,9 @@ static int ceph_cb_number(void *ctx, const char *number_val,
    * "rate", use the "sum" in the pair and assign that to the derive
    * value. */
   if (convert_special_metrics && (state->depth > 2) &&
+      state->stack[state->depth - 2] &&
       (strcmp("filestore", state->stack[state->depth - 2]) == 0) &&
+      state->stack[state->depth - 1] &&
       (strcmp("journal_wr_bytes", state->stack[state->depth - 1]) == 0) &&
       (strcmp("avgcount", state->key) == 0)) {
     DEBUG("ceph plugin: Skipping avgcount for filestore.JournalWrBytes");