swap plugin: Complain if physical and virtual reporting have both been deactivated.
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Mon, 6 Dec 2010 10:21:45 +0000 (11:21 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Mon, 6 Dec 2010 10:21:45 +0000 (11:21 +0100)
src/swap.c

index 03e4eec..a1c78b6 100644 (file)
@@ -564,6 +564,13 @@ static int swap_read (void) /* {{{ */
 {
        int status;
 
+       if (!report_physical && !report_virtual)
+       {
+               WARNING ("swap plugin: Neither the \"ReportPhysical\" nor the \"ReportVirtual\" option "
+                               "has been activated. This plugin will not collect any data.");
+               return (-1);
+       }
+
        if (report_physical)
        {
                status = swap_read_swapctl2 ();