Merge remote branch 'tokkee/sh/collectd-4.9' into collectd-4.9
[collectd.git] / src / openvpn.c
index 2d460d9..9c717dd 100644 (file)
@@ -263,15 +263,15 @@ static int multi1_read (char *name, FILE *fh)
 
                if (new_naming_schema)
                {
-                       iostats_submit (fields[0],          /* "Common Name" */
-                                       NULL,               /* unused when in multimode */
+                       iostats_submit (name,               /* vpn instance */
+                                       fields[0],          /* "Common Name" */
                                        atoll (fields[2]),  /* "Bytes Received" */
                                        atoll (fields[3])); /* "Bytes Sent" */
                }
                else
                {
-                       iostats_submit (name,               /* vpn instance */
-                                       fields[0],          /* "Common Name" */
+                       iostats_submit (fields[0],          /* "Common Name" */
+                                       NULL,               /* unused when in multimode */
                                        atoll (fields[2]),  /* "Bytes Received" */
                                        atoll (fields[3])); /* "Bytes Sent" */
                }
@@ -568,7 +568,7 @@ static int openvpn_config (const char *key, const char *value)
 
                DEBUG ("openvpn plugin: status file \"%s\" added", temp->file);
 
-       }
+       } /* if (strcasecmp ("StatusFile", key) == 0) */
        else if (strcasecmp ("Compression", key) == 0)
        {
                if (IS_TRUE (value))
@@ -578,7 +578,7 @@ static int openvpn_config (const char *key, const char *value)
                        store_compression = 0;
                        DEBUG ("openvpn plugin: no 'compression statistcs' collected");
                }
-       }
+       } /* if (strcasecmp ("Compression", key) == 0) */
        else if (strcasecmp ("ImprovedNamingSchema", key) == 0)
        {
                if (IS_TRUE (value))
@@ -590,7 +590,7 @@ static int openvpn_config (const char *key, const char *value)
                {
                        new_naming_schema = 0;
                }
-       }
+       } /* if (strcasecmp ("ImprovedNamingSchema", key) == 0) */
        else
        {
                return (-1);
@@ -622,3 +622,5 @@ void module_register (void)
        plugin_register_read ("openvpn", openvpn_read);
        plugin_register_shutdown ("openvpn", openvpn_shutdown);
 } /* void module_register */
+
+/* vim: set sw=2 ts=2 : */