summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9aa9916)
raw | patch | inline | side by side (parent: 9aa9916)
author | Florian Forster <octo@huhu.verplant.org> | |
Wed, 30 Apr 2008 08:25:15 +0000 (10:25 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Wed, 30 Apr 2008 08:25:15 +0000 (10:25 +0200) |
The libstatgrab specific CFLAGS are only passed to these plugins, so that other
plugins may fail if libstatgrab is in a non-standard path.
plugins may fail if libstatgrab is in a non-standard path.
src/collectd.c | patch | blob | history | |
src/collectd.h | patch | blob | history | |
src/interface.c | patch | blob | history | |
src/load.c | patch | blob | history | |
src/memory.c | patch | blob | history | |
src/swap.c | patch | blob | history |
diff --git a/src/collectd.c b/src/collectd.c
index 4e18fd6e2280edcce9b1190777c846bdfa11dd3f..ab9c89d2e29819d000242dd0d3d0060da3c165c6 100644 (file)
--- a/src/collectd.c
+++ b/src/collectd.c
#include "configfile.h"
#include "types_list.h"
+#if HAVE_STATGRAB_H
+# include <statgrab.h>
+#endif
+
/*
* Global variables
*/
diff --git a/src/collectd.h b/src/collectd.h
index 59dc5d20a10e5e1d02b288c200f81925b44fe204..80d86ba8e698ac0c039122b22e9f452945cd7070 100644 (file)
--- a/src/collectd.h
+++ b/src/collectd.h
#if HAVE_PTH_H
# include <pth.h>
#endif
-#if HAVE_STATGRAB_H
-# include <statgrab.h>
-#endif
#if HAVE_SENSORS_SENSORS_H
# include <sensors/sensors.h>
#endif
diff --git a/src/interface.c b/src/interface.c
index 741ff764bd576f4ee45f5ea2d5ffb0cea14c8477..33736b678905ed30a699ca7cf262e014feafa1cc 100644 (file)
--- a/src/interface.c
+++ b/src/interface.c
# include <ifaddrs.h>
#endif
+#if HAVE_STATGRAB_H
+# include <statgrab.h>
+#endif
+
/*
* Various people have reported problems with `getifaddrs' and varying versions
* of `glibc'. That's why it's disabled by default. Since more statistics are
diff --git a/src/load.c b/src/load.c
index c9f130b7864609bf31b68aad4dfc4b4508a7e2e6..db3bf4b8b88c96debc7bfabf66c33ca680d00e31 100644 (file)
--- a/src/load.c
+++ b/src/load.c
#include <sys/loadavg.h>
#endif
+#if HAVE_STATGRAB_H
+# include <statgrab.h>
+#endif
+
#ifdef HAVE_GETLOADAVG
#if !defined(LOADAVG_1MIN) || !defined(LOADAVG_5MIN) || !defined(LOADAVG_15MIN)
#define LOADAVG_1MIN 0
diff --git a/src/memory.c b/src/memory.c
index 3fbd33fb0c1da1a90cb666e1e6df044a711a2f64..fe3a16ebc17745ebcafe893e855daf0df67ba6ee 100644 (file)
--- a/src/memory.c
+++ b/src/memory.c
# include <mach/vm_statistics.h>
#endif
+#if HAVE_STATGRAB_H
+# include <statgrab.h>
+#endif
+
/* vm_statistics_data_t */
#if HAVE_HOST_STATISTICS
static mach_port_t port_host;
static kstat_t *ksp;
/* #endif HAVE_LIBKSTAT */
+#elif HAVE_LIBSTATGRAB
+/* no global variables */
+/* endif HAVE_LIBSTATGRAB */
+
#else
# error "No applicable input method."
#endif
memory_submit ("cache", sysctl_vals[6]);
/* #endif HAVE_SYSCTLBYNAME */
-#elif defined(KERNEL_LINUX)
+#elif KERNEL_LINUX
FILE *fh;
char buffer[1024];
memory_submit ("cached", mem_cached);
memory_submit ("free", mem_free);
}
-/* #endif defined(KERNEL_LINUX) */
+/* #endif KERNEL_LINUX */
-#elif defined(HAVE_LIBKSTAT)
+#elif HAVE_LIBKSTAT
long long mem_used;
long long mem_free;
long long mem_lock;
memory_submit ("used", mem_used);
memory_submit ("free", mem_free);
memory_submit ("locked", mem_lock);
-/* #endif defined(HAVE_LIBKSTAT) */
+/* #endif HAVE_LIBKSTAT */
-#elif defined(HAVE_LIBSTATGRAB)
+#elif HAVE_LIBSTATGRAB
sg_mem_stats *ios;
if ((ios = sg_get_mem_stats ()) != NULL)
diff --git a/src/swap.c b/src/swap.c
index 1cf707797f1057b4fb6124c763a46e057b2753ee..e91ebefd916ae1439738661c336915ee5980a5ac 100644 (file)
--- a/src/swap.c
+++ b/src/swap.c
# include <kvm.h>
#endif
+#if HAVE_STATGRAB_H
+# include <statgrab.h>
+#endif
+
#undef MAX
#define MAX(x,y) ((x) > (y) ? (x) : (y))