From 6f2d545244193432a6ad3d54185628b8f6a6091e Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Wed, 29 Jan 2014 01:41:23 -0500 Subject: Fix check_swap returning OK on & thresholds and no swap Return 0% free instead of 100% free when total swap is 0 diff --git a/plugins/check_swap.c b/plugins/check_swap.c index ce510e1..04256ad 100644 --- a/plugins/check_swap.c +++ b/plugins/check_swap.c @@ -350,7 +350,7 @@ main (int argc, char **argv) if(total_swap_mb) { percent_used = 100 * ((double) used_swap_mb) / ((double) total_swap_mb); } else { - percent_used = 0; + percent_used = 100; } result = max_state (result, check_swap (percent_used, free_swap_mb)); -- cgit v0.10-9-g596f