X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fusers.c;h=08fc4fd74d349853be9510ebcc75a689d5623e74;hb=efe2a48f63ed4042c101f770d64e1c543fea70ad;hp=2739c2beec307bb17f9e55460f0f5ada5ae58b74;hpb=c1e47ad7b5e5e889fb86250f714b299e4bf8819f;p=collectd.git diff --git a/src/users.c b/src/users.c index 2739c2be..08fc4fd7 100644 --- a/src/users.c +++ b/src/users.c @@ -1,6 +1,6 @@ /** * collectd - src/users.c - * Copyright (C) 2005 Sebastian Harl + * Copyright (C) 2005,2006 Sebastian Harl * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -20,9 +20,9 @@ * Sebastian Harl **/ +#include "collectd.h" #include "common.h" #include "plugin.h" -#include "users.h" #if HAVE_UTMPX_H # include @@ -34,10 +34,16 @@ #define MODULE_NAME "users" +#if HAVE_GETUTXENT || HAVE_GETUTENT +# define USERS_HAVE_READ 1 +#else +# define USERS_HAVE_READ 0 +#endif + static char *rrd_file = "users.rrd"; static char *ds_def[] = { - "DS:users:GAUGE:25:0:65535", + "DS:users:GAUGE:"COLLECTD_HEARTBEAT":0:65535", NULL }; static int ds_num = 1; @@ -54,6 +60,7 @@ static void users_write (char *host, char *inst, char *val) return; } /* static void users_write(char *host, char *inst, char *val) */ +#if USERS_HAVE_READ /* I don't like this temporary macro definition - well it's used everywhere else in the collectd-sources, so I will just stick with it... */ #define BUFSIZE 256 @@ -112,6 +119,9 @@ static void users_read (void) return; } /* static void users_read(void) */ +#else +# define users_read NULL +#endif /* USERS_HAVE_READ */ void module_register (void) {