summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cf191cf)
raw | patch | inline | side by side (parent: cf191cf)
author | Florian Forster <octo@huhu.verplant.org> | |
Mon, 7 Dec 2009 10:50:02 +0000 (11:50 +0100) | ||
committer | Florian Forster <sifnfors@informatik.stud.uni-erlangen.de> | |
Mon, 7 Dec 2009 10:50:02 +0000 (11:50 +0100) |
src/openvpn.c | patch | blob | history |
diff --git a/src/openvpn.c b/src/openvpn.c
index c71071c09ab7096aa4061d22957b87589cfbb57b..2d460d96a1a925943ee1af19737c71ea0ce0e031 100644 (file)
--- a/src/openvpn.c
+++ b/src/openvpn.c
* with more or less fields.
*/
if (fields_num != 8)
- {
continue;
+
+ if (strcmp (fields[0], "CLIENT_LIST") != 0)
+ continue;
+
+ if (new_naming_schema)
+ {
+ /* plugin inst = file name, type inst = fields[1] */
+ iostats_submit (name, /* vpn instance */
+ fields[1], /* "Common Name" */
+ atoll (fields[4]), /* "Bytes Received" */
+ atoll (fields[5])); /* "Bytes Sent" */
}
else
{
- if (strcmp (fields[0], "CLIENT_LIST") == 0)
- {
- if (new_naming_schema)
- {
- iostats_submit (name, /* vpn instance */
- fields[1], /* "Common Name" */
- atoll (fields[4]), /* "Bytes Received" */
- atoll (fields[5])); /* "Bytes Sent" */
- }
- else
- {
- iostats_submit (fields[1], /* "Common Name" */
- NULL, /* unused when in multimode */
- atoll (fields[4]), /* "Bytes Received" */
- atoll (fields[5])); /* "Bytes Sent" */
- }
-
- read = 1;
- }
+ /* plugin inst = fields[1], type inst = "" */
+ iostats_submit (fields[1], /* "Common Name" */
+ NULL, /* unused when in multimode */
+ atoll (fields[4]), /* "Bytes Received" */
+ atoll (fields[5])); /* "Bytes Sent" */
}
+
+ read = 1;
}
return (read);
}
else
{
- if (strcmp (fields[0], "CLIENT_LIST") == 0)
+ if (strcmp (fields[0], "CLIENT_LIST") != 0)
+ continue;
+
+ if (new_naming_schema)
+ {
+ iostats_submit (name, /* vpn instance */
+ fields[1], /* "Common Name" */
+ atoll (fields[4]), /* "Bytes Received" */
+ atoll (fields[5])); /* "Bytes Sent" */
+ }
+ else
{
- if (new_naming_schema)
- {
- iostats_submit (name, /* vpn instance */
- fields[1], /* "Common Name" */
- atoll (fields[4]), /* "Bytes Received" */
- atoll (fields[5])); /* "Bytes Sent" */
- }
- else
- {
- iostats_submit (fields[1], /* "Common Name" */
- NULL, /* unused when in multimode */
- atoll (fields[4]), /* "Bytes Received" */
- atoll (fields[5])); /* "Bytes Sent" */
- }
-
- read = 1;
+ iostats_submit (fields[1], /* "Common Name" */
+ NULL, /* unused when in multimode */
+ atoll (fields[4]), /* "Bytes Received" */
+ atoll (fields[5])); /* "Bytes Sent" */
}
+
+ read = 1;
}
}