plugin_load="yes"
plugin_memory="yes"
plugin_swap="yes"
+ plugin_users="yes"
fi
if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"
pkglib_LTLIBRARIES += users.la
users_la_SOURCES = users.c
users_la_LDFLAGS = -module -avoid-version
+if BUILD_WITH_LIBSTATGRAB
+users_la_CFLAGS = $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
+users_la_LIBADD = $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
+endif
collectd_LDADD += "-dlopen" users.la
collectd_DEPENDENCIES += users.la
endif
#include "common.h"
#include "plugin.h"
+#if HAVE_STATGRAB_H
+# include <statgrab.h>
+#endif /* HAVE_STATGRAB_H */
+
#if HAVE_UTMPX_H
# include <utmpx.h>
/* #endif HAVE_UTMPX_H */
users_submit (users);
/* #endif HAVE_GETUTENT */
+#elif HAVE_LIBSTATGRAB
+ sg_user_stats *us;
+
+ us = sg_get_user_stats ();
+ if (us == NULL)
+ return (-1);
+
+ users_submit ((gauge_t) us->num_entries);
+/* #endif HAVE_LIBSTATGRAB */
+
#else
# error "No applicable input method."
#endif