drbd plugin: improve header lines identification
[collectd.git] / src / drbd.c
index cc306dc..d46bb02 100644 (file)
@@ -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]))
                {