summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <dermoth@aei.ca>2014-01-29 01:41:23 -0500
committerThomas Guyot-Sionnest <dermoth@aei.ca>2014-01-29 01:44:22 -0500
commit6f2d545244193432a6ad3d54185628b8f6a6091e (patch)
tree24a81b5dba14b0d64f08749123b4b2cfb69c5172 /plugins
parentcb99931e43a1da8c6cb3ff80e2561d4d5d34764f (diff)
downloadmonitoring-plugins-6f2d545244193432a6ad3d54185628b8f6a6091e.tar.gz
Fix check_swap returning OK on & thresholds and no swap
Return 0% free instead of 100% free when total swap is 0
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_swap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/check_swap.c b/plugins/check_swap.c
index ce510e14..04256adf 100644
--- a/plugins/check_swap.c
+++ b/plugins/check_swap.c
@@ -350,7 +350,7 @@ main (int argc, char **argv)
350 if(total_swap_mb) { 350 if(total_swap_mb) {
351 percent_used = 100 * ((double) used_swap_mb) / ((double) total_swap_mb); 351 percent_used = 100 * ((double) used_swap_mb) / ((double) total_swap_mb);
352 } else { 352 } else {
353 percent_used = 0; 353 percent_used = 100;
354 } 354 }
355 355
356 result = max_state (result, check_swap (percent_used, free_swap_mb)); 356 result = max_state (result, check_swap (percent_used, free_swap_mb));