X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fceph.c;h=5ea90499ae2090a35d646a2d4284768e4a80fc43;hp=3accbd3f80d20a8d9b3c5c8e28af961c2d613aa9;hb=da11ce02eb202b3e01d3e2d1b40f248a84430973;hpb=6f30c750cc555fb016db827cd5ff6e1e1c2cc87e diff --git a/src/ceph.c b/src/ceph.c index 3accbd3f..5ea90499 100644 --- a/src/ceph.c +++ b/src/ceph.c @@ -280,8 +280,10 @@ static int ceph_cb_number(void *ctx, const char *number_val, * 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) && + 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");