#include "collectd.h"
-#include "common.h"
#include "plugin.h"
+#include "utils/common/common.h"
#if HAVE_STATGRAB_H
#include <statgrab.h>
#endif
static void users_submit(gauge_t value) {
- value_t values[1];
value_list_t vl = VALUE_LIST_INIT;
- values[0].gauge = value;
-
- vl.values = values;
+ vl.values = &(value_t){.gauge = value};
vl.values_len = 1;
- sstrncpy(vl.host, hostname_g, sizeof(vl.host));
sstrncpy(vl.plugin, "users", sizeof(vl.plugin));
sstrncpy(vl.type, "users", sizeof(vl.plugin));
us = sg_get_user_stats();
#endif
if (us == NULL)
- return (-1);
+ return -1;
users_submit((gauge_t)
#if HAVE_LIBSTATGRAB_0_90
#error "No applicable input method."
#endif
- return (0);
+ return 0;
} /* int users_read */
void module_register(void) {