X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fusers.c;h=139c97659a974701c2f69051c4d8fb93e78fc833;hb=dcd0b4f3121d903070282ee013b2de939bc0fa49;hp=10de92b782f75db37c997de99fa027874bf50a90;hpb=4fcf23160e7d3fd034dc7e807cbf4047970dd218;p=collectd.git diff --git a/src/users.c b/src/users.c index 10de92b7..139c9765 100644 --- a/src/users.c +++ b/src/users.c @@ -21,7 +21,7 @@ * Authors: * Sebastian Harl * Niki W. Waibel - * Florian octo Forster + * Florian octo Forster * Oleg King **/ @@ -40,9 +40,6 @@ #elif HAVE_UTMP_H # include /* #endif HAVE_UTMP_H */ - -#else -# error "No applicable input method." #endif static void users_submit (gauge_t value) @@ -54,7 +51,6 @@ static void users_submit (gauge_t value) vl.values = values; vl.values_len = 1; - vl.time = time (NULL); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "users", sizeof (vl.plugin)); sstrncpy (vl.type, "users", sizeof (vl.plugin)); @@ -103,11 +99,21 @@ static int users_read (void) #elif HAVE_LIBSTATGRAB sg_user_stats *us; +# if HAVE_LIBSTATGRAB_0_90 + size_t num_entries; + us = sg_get_user_stats (&num_entries); +# else us = sg_get_user_stats (); +# endif if (us == NULL) return (-1); - users_submit ((gauge_t) us->num_entries); + users_submit ((gauge_t) +# if HAVE_LIBSTATGRAB_0_90 + num_entries); +# else + us->num_entries); +# endif /* #endif HAVE_LIBSTATGRAB */ #else