X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fdf.c;h=3e173c5f466bc412aca110830176dfbfb25d8bfa;hb=ed3b4a8fe6377817e1dadfbc713c4cc5c0bc4444;hp=eda9f959e5f26982a8b41e4199eee8f5da029442;hpb=ce252e1003031e6fe7454d28bcdc6f8baa4e57fb;p=collectd.git diff --git a/src/df.c b/src/df.c index eda9f959..3e173c5f 100644 --- a/src/df.c +++ b/src/df.c @@ -33,22 +33,26 @@ # define DF_HAVE_READ 0 #endif -#if HAVE_STATFS -#define STATANYFS statfs -#define BLOCKSIZE(s) (s).f_bsize - -#elif HAVE_STATVFS -#define STATANYFS statvfs -#define BLOCKSIZE(s) ((s).f_frsize ? (s).f_frsize : (s).f_bsize) +#if HAVE_STATVFS +# if HAVE_SYS_STATVFS_H +# include +# endif +# define STATANYFS statvfs +# define BLOCKSIZE(s) ((s).f_frsize ? (s).f_frsize : (s).f_bsize) +#elif HAVE_STATFS +# if HAVE_SYS_STATFS_H +# include +# endif +# define STATANYFS statfs +# define BLOCKSIZE(s) (s).f_bsize #endif static char *filename_template = "df-%s.rrd"; -/* 104857600 == 100 MB */ static char *ds_def[] = { - "DS:used:GAUGE:25:0:U", - "DS:free:GAUGE:25:0:U", + "DS:used:GAUGE:"COLLECTD_HEARTBEAT":0:U", + "DS:free:GAUGE:"COLLECTD_HEARTBEAT":0:U", NULL }; static int ds_num = 2; @@ -90,7 +94,12 @@ static void df_submit (char *df_name, static void df_read (void) { - struct STATANYFS statbuf; +#if HAVE_STATVFS + struct statvfs statbuf; +#elif HAVE_STATFS + struct statfs statbuf; +#endif + /* struct STATANYFS statbuf; */ cu_mount_t *mnt_list; cu_mount_t *mnt_ptr;