summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_swap.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/plugins/check_swap.c b/plugins/check_swap.c
index ff58b15..a607da1 100644
--- a/plugins/check_swap.c
+++ b/plugins/check_swap.c
@@ -410,7 +410,6 @@ check_swap(float free_swap_mb, float total_swap_mb)
410 uint64_t usage_percentage = ((total_swap_mb - free_swap_mb) / total_swap_mb) * 100; 410 uint64_t usage_percentage = ((total_swap_mb - free_swap_mb) / total_swap_mb) * 100;
411 411
412 if (crit.is_percentage && 412 if (crit.is_percentage &&
413 usage_percentage >= 0 &&
414 crit.value != 0 && 413 crit.value != 0 &&
415 usage_percentage >= (100 - crit.value)) 414 usage_percentage >= (100 - crit.value))
416 { 415 {
@@ -418,7 +417,6 @@ check_swap(float free_swap_mb, float total_swap_mb)
418 } 417 }
419 418
420 if (warn.is_percentage && 419 if (warn.is_percentage &&
421 usage_percentage >= 0 &&
422 warn.value != 0 && 420 warn.value != 0 &&
423 usage_percentage >= (100 - warn.value)) 421 usage_percentage >= (100 - warn.value))
424 { 422 {
@@ -475,10 +473,9 @@ process_arguments (int argc, char **argv)
475 if (is_uint64(optarg, &warn.value)) { 473 if (is_uint64(optarg, &warn.value)) {
476 if (warn.value > 100) { 474 if (warn.value > 100) {
477 usage4 (_("Warning threshold percentage must be <= 100!")); 475 usage4 (_("Warning threshold percentage must be <= 100!"));
478 } else {
479 break;
480 } 476 }
481 } 477 }
478 break;
482 } else { 479 } else {
483 /* It's Bytes */ 480 /* It's Bytes */
484 warn.is_percentage = 0; 481 warn.is_percentage = 0;
@@ -506,10 +503,9 @@ process_arguments (int argc, char **argv)
506 if (is_uint64(optarg, &crit.value)) { 503 if (is_uint64(optarg, &crit.value)) {
507 if (crit.value> 100) { 504 if (crit.value> 100) {
508 usage4 (_("Critical threshold percentage must be <= 100!")); 505 usage4 (_("Critical threshold percentage must be <= 100!"));
509 } else {
510 break;
511 } 506 }
512 } 507 }
508 break;
513 } else { 509 } else {
514 /* It's Bytes */ 510 /* It's Bytes */
515 crit.is_percentage = 0; 511 crit.is_percentage = 0;
@@ -527,6 +523,7 @@ process_arguments (int argc, char **argv)
527 if ((no_swap_state = mp_translate_state(optarg)) == ERROR) { 523 if ((no_swap_state = mp_translate_state(optarg)) == ERROR) {
528 usage4 (_("no-swap result must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3).")); 524 usage4 (_("no-swap result must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3)."));
529 } 525 }
526 break;
530 case 'v': /* verbose */ 527 case 'v': /* verbose */
531 verbose++; 528 verbose++;
532 break; 529 break;