From: Marc Fournier Date: Wed, 20 Jan 2016 21:32:03 +0000 (+0100) Subject: drbd plugin: improve header lines identification X-Git-Tag: collectd-5.5.1~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=6eb5239cb5b9663722e0dabb036e7263696ed5aa;p=collectd.git drbd plugin: improve header lines identification Recent DRBD versions display more detailed build information in `/proc/drbd`, which caused the header identification to fail. Comparing the first part of each line against all known header prefixes will hopefully make this more robust. Fixes #1514 Signed-off-by: Florian Forster --- diff --git a/src/drbd.c b/src/drbd.c index cc306dcb..d46bb020 100644 --- a/src/drbd.c +++ b/src/drbd.c @@ -142,8 +142,12 @@ static int drbd_read (void) fields, STATIC_ARRAY_SIZE (fields)); /* ignore headers (first two iterations) */ - if (fields_num < 4) + if ((strcmp(fields[0], "version:") == 0) || + (strcmp(fields[0], "srcversion:") == 0) || + (strcmp(fields[0], "GIT-hash:") == 0)) + { continue; + } if (isdigit(fields[0][0])) {