mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-22 14:46:57 -04:00
Check swap compiler warnings (#1756)
* Fix compiler warnings * Fix superfluous whitespaces
This commit is contained in:
parent
3ad5fe9d84
commit
fbbc9fcbd5
1 changed files with 3 additions and 6 deletions
|
|
@ -410,7 +410,6 @@ check_swap(float free_swap_mb, float total_swap_mb)
|
|||
uint64_t usage_percentage = ((total_swap_mb - free_swap_mb) / total_swap_mb) * 100;
|
||||
|
||||
if (crit.is_percentage &&
|
||||
usage_percentage >= 0 &&
|
||||
crit.value != 0 &&
|
||||
usage_percentage >= (100 - crit.value))
|
||||
{
|
||||
|
|
@ -418,7 +417,6 @@ check_swap(float free_swap_mb, float total_swap_mb)
|
|||
}
|
||||
|
||||
if (warn.is_percentage &&
|
||||
usage_percentage >= 0 &&
|
||||
warn.value != 0 &&
|
||||
usage_percentage >= (100 - warn.value))
|
||||
{
|
||||
|
|
@ -475,10 +473,9 @@ process_arguments (int argc, char **argv)
|
|||
if (is_uint64(optarg, &warn.value)) {
|
||||
if (warn.value > 100) {
|
||||
usage4 (_("Warning threshold percentage must be <= 100!"));
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
/* It's Bytes */
|
||||
warn.is_percentage = 0;
|
||||
|
|
@ -506,10 +503,9 @@ process_arguments (int argc, char **argv)
|
|||
if (is_uint64(optarg, &crit.value)) {
|
||||
if (crit.value> 100) {
|
||||
usage4 (_("Critical threshold percentage must be <= 100!"));
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
/* It's Bytes */
|
||||
crit.is_percentage = 0;
|
||||
|
|
@ -527,6 +523,7 @@ process_arguments (int argc, char **argv)
|
|||
if ((no_swap_state = mp_translate_state(optarg)) == ERROR) {
|
||||
usage4 (_("no-swap result must be a valid state name (OK, WARNING, CRITICAL, UNKNOWN) or integer (0-3)."));
|
||||
}
|
||||
break;
|
||||
case 'v': /* verbose */
|
||||
verbose++;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue