Fixing compile-errors/-warnings when building without librrd.
[collectd.git] / src / swap.c
index 9667b58..b7fc7ed 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * collectd - src/swap.c
- * Copyright (C) 2005  Florian octo Forster
+ * Copyright (C) 2005,2006  Florian octo Forster
  *
  * 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
@@ -44,10 +44,10 @@ static char *swap_file = "swap.rrd";
 /* 1099511627776 == 1TB ought to be enough for anyone ;) */
 static char *ds_def[] =
 {
-       "DS:used:GAUGE:25:0:1099511627776",
-       "DS:free:GAUGE:25:0:1099511627776",
-       "DS:cached:GAUGE:25:0:1099511627776",
-       "DS:resv:GAUGE:25:0:1099511627776",
+       "DS:used:GAUGE:"COLLECTD_HEARTBEAT":0:1099511627776",
+       "DS:free:GAUGE:"COLLECTD_HEARTBEAT":0:1099511627776",
+       "DS:cached:GAUGE:"COLLECTD_HEARTBEAT":0:1099511627776",
+       "DS:resv:GAUGE:"COLLECTD_HEARTBEAT":0:1099511627776",
        NULL
 };
 static int ds_num = 4;
@@ -74,6 +74,7 @@ static void swap_write (char *host, char *inst, char *val)
        rrd_update_file (host, swap_file, val, ds_def, ds_num);
 }
 
+#if SWAP_HAVE_READ
 static void swap_submit (unsigned long long swap_used,
                unsigned long long swap_free,
                unsigned long long swap_cached,
@@ -88,7 +89,6 @@ static void swap_submit (unsigned long long swap_used,
        plugin_submit (MODULE_NAME, "-", buffer);
 }
 
-#if SWAP_HAVE_READ
 static void swap_read (void)
 {
 #ifdef KERNEL_LINUX