projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'collectd-4.4'
[collectd.git]
/
src
/
swap.c
diff --git
a/src/swap.c
b/src/swap.c
index
4a414b7
..
4f0a0ba
100644
(file)
--- a/
src/swap.c
+++ b/
src/swap.c
@@
-36,6
+36,10
@@
# include <kvm.h>
#endif
# include <kvm.h>
#endif
+#if HAVE_STATGRAB_H
+# include <statgrab.h>
+#endif
+
#undef MAX
#define MAX(x,y) ((x) > (y) ? (x) : (y))
#undef MAX
#define MAX(x,y) ((x) > (y) ? (x) : (y))
@@
-122,9
+126,10
@@
static void swap_submit (const char *type_instance, double value)
vl.time = time (NULL);
strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "swap");
vl.time = time (NULL);
strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "swap");
- strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
+ strcpy (vl.type, "swap");
+ sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
- plugin_dispatch_values (
"swap",
&vl);
+ plugin_dispatch_values (&vl);
} /* void swap_submit */
static int swap_read (void)
} /* void swap_submit */
static int swap_read (void)
@@
-232,7
+237,7
@@
static int swap_read (void)
swap_submit ("used", swap_alloc);
swap_submit ("free", swap_avail);
swap_submit ("used", swap_alloc);
swap_submit ("free", swap_avail);
- swap_submit ("reserved", swap_resv
- swap_alloc
);
+ swap_submit ("reserved", swap_resv);
/* #endif HAVE_LIBKSTAT */
#elif defined(VM_SWAPUSAGE)
/* #endif HAVE_LIBKSTAT */
#elif defined(VM_SWAPUSAGE)