diff --git a/src/swap.c b/src/swap.c
index 4d1f24de73ae40bf79a07621e6bfb945521669a3..8c09e35f2f0246b43877b5fefd3d3062e6cd512f 100644 (file)
--- a/src/swap.c
+++ b/src/swap.c
/* No global variables */
/* #endif defined(VM_SWAPUSAGE) */
/* No global variables */
/* #endif defined(VM_SWAPUSAGE) */
-#elif HAVE_LIBKVM
+#elif HAVE_LIBKVM_GETSWAPINFO
static kvm_t *kvm_obj = NULL;
int kvm_pagesize;
static kvm_t *kvm_obj = NULL;
int kvm_pagesize;
-/* #endif HAVE_LIBKVM */
+/* #endif HAVE_LIBKVM_GETSWAPINFO */
#elif HAVE_LIBSTATGRAB
/* No global variables */
#elif HAVE_LIBSTATGRAB
/* No global variables */
/* No init stuff */
/* #endif defined(VM_SWAPUSAGE) */
/* No init stuff */
/* #endif defined(VM_SWAPUSAGE) */
-#elif HAVE_LIBKVM
+#elif HAVE_LIBKVM_GETSWAPINFO
if (kvm_obj != NULL)
{
kvm_close (kvm_obj);
if (kvm_obj != NULL)
{
kvm_close (kvm_obj);
ERROR ("swap plugin: kvm_open failed.");
return (-1);
}
ERROR ("swap plugin: kvm_open failed.");
return (-1);
}
-/* #endif HAVE_LIBKVM */
+/* #endif HAVE_LIBKVM_GETSWAPINFO */
#elif HAVE_LIBSTATGRAB
/* No init stuff */
#elif HAVE_LIBSTATGRAB
/* No init stuff */
vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "swap", sizeof (vl.plugin));
vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "swap", sizeof (vl.plugin));
- strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
+ sstrncpy (vl.type, "swap", sizeof (vl.type));
+ 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)
swap_submit ("free", sw_usage.xsu_avail);
/* #endif VM_SWAPUSAGE */
swap_submit ("free", sw_usage.xsu_avail);
/* #endif VM_SWAPUSAGE */
-#elif HAVE_LIBKVM
+#elif HAVE_LIBKVM_GETSWAPINFO
struct kvm_swap data_s;
int status;
struct kvm_swap data_s;
int status;
swap_submit ("used", used);
swap_submit ("free", free);
swap_submit ("used", used);
swap_submit ("free", free);
-/* #endif HAVE_LIBKVM */
+/* #endif HAVE_LIBKVM_GETSWAPINFO */
#elif HAVE_LIBSTATGRAB
sg_swap_stats *swap;
#elif HAVE_LIBSTATGRAB
sg_swap_stats *swap;