/* dispatches number of users */
static void numusers_submit(const char *pinst, const char *tinst,
gauge_t value) {
- value_t values[1];
value_list_t vl = VALUE_LIST_INIT;
- values[0].gauge = value;
-
- vl.values = values;
- vl.values_len = STATIC_ARRAY_SIZE(values);
- sstrncpy(vl.host, hostname_g, sizeof(vl.host));
+ vl.values = &(value_t){.gauge = value};
+ vl.values_len = 1;
sstrncpy(vl.plugin, "openvpn", sizeof(vl.plugin));
sstrncpy(vl.type, "users", sizeof(vl.type));
if (pinst != NULL)
* per single endpoint */
static void iostats_submit(const char *pinst, const char *tinst, derive_t rx,
derive_t tx) {
- value_t values[2];
value_list_t vl = VALUE_LIST_INIT;
-
- values[0].derive = rx;
- values[1].derive = tx;
+ value_t values[] = {
+ {.derive = rx}, {.derive = tx},
+ };
/* NOTE ON THE NEW NAMING SCHEMA:
* using plugin_instance to identify each vpn config (and
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, sizeof(vl.plugin_instance));
/* dispatches stats about data compression shown when in single mode */
static void compression_submit(const char *pinst, const char *tinst,
derive_t uncompressed, derive_t compressed) {
- value_t values[2];
value_list_t vl = VALUE_LIST_INIT;
-
- values[0].derive = uncompressed;
- values[1].derive = compressed;
+ value_t values[] = {
+ {.derive = uncompressed}, {.derive = compressed},
+ };
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, sizeof(vl.plugin_instance));
config_keys_num);
plugin_register_init("openvpn", openvpn_init);
} /* void module_register */
-
-/* vim: set sw=2 ts=2 : */