X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fopenvpn.c;h=50670c5313f78148402770f5c6cdd749faec2705;hb=db8b1cda4841f45af22d149c6bfc575e79289f75;hp=81ffa89988f218edf6ef9b6538b90d43614f1808;hpb=e1bfa71aca1f37c2f293dc9adb44065c6e7a9ad9;p=collectd.git diff --git a/src/openvpn.c b/src/openvpn.c index 81ffa899..50670c53 100644 --- a/src/openvpn.c +++ b/src/openvpn.c @@ -103,7 +103,6 @@ static void numusers_submit (const char *pinst, const char *tinst, vl.values = &(value_t) { .gauge = value }; vl.values_len = 1; - sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "openvpn", sizeof (vl.plugin)); sstrncpy (vl.type, "users", sizeof (vl.type)); if (pinst != NULL) @@ -133,7 +132,6 @@ static void iostats_submit (const char *pinst, const char *tinst, vl.values = values; vl.values_len = STATIC_ARRAY_SIZE (values); - sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "openvpn", sizeof (vl.plugin)); if (pinst != NULL) sstrncpy (vl.plugin_instance, pinst, @@ -157,7 +155,6 @@ static void compression_submit (const char *pinst, const char *tinst, vl.values = values; vl.values_len = STATIC_ARRAY_SIZE (values); - sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "openvpn", sizeof (vl.plugin)); if (pinst != NULL) sstrncpy (vl.plugin_instance, pinst, @@ -522,6 +519,9 @@ static int openvpn_read (void) int read; read = 0; + + if (vpn_num == 0) + return (0); /* call the right read function for every status entry in the list */ for (int i = 0; i < vpn_num; i++) @@ -656,8 +656,8 @@ static int openvpn_config (const char *key, const char *value) if (status_version == 0) { - WARNING ("openvpn plugin: unable to detect status version, \ - discarding status file \"%s\".", value); + WARNING ("openvpn plugin: unable to detect status version, " + "discarding status file \"%s\".", value); return (1); }