[monitoring-plugins] Fix check_swap returning OK on & thresholds and ...

Git Repository git at monitoring-plugins.org
Wed Jan 29 09:10:07 CET 2014


 Module: monitoring-plugins
 Branch: master
 Commit: 6f2d545244193432a6ad3d54185628b8f6a6091e
 Author: Thomas Guyot-Sionnest <dermoth at aei.ca>
   Date: Wed Jan 29 01:41:23 2014 -0500
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=6f2d545

Fix check_swap returning OK on & thresholds and no swap

Return 0% free instead of 100% free when total swap is 0

---

 plugins/check_swap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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));



More information about the Commits mailing list