summaryrefslogtreecommitdiffstats
path: root/plugins/t
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/t')
0 files changed, 0 insertions, 0 deletions
diff --git a/plugins/check_swap.c b/plugins/check_swap.c
index fddd93f..499a8d2 100644
--- a/plugins/check_swap.c
+++ b/plugins/check_swap.c
@@ -4,7 +4,7 @@
4* 4*
5* License: GPL 5* License: GPL
6* Copyright (c) 2000 Karl DeBisschop (kdebisschop@users.sourceforge.net) 6* Copyright (c) 2000 Karl DeBisschop (kdebisschop@users.sourceforge.net)
7* Copyright (c) 2000-2007 Monitoring Plugins Development Team 7* Copyright (c) 2000-2024 Monitoring Plugins Development Team
8* 8*
9* Description: 9* Description:
10* 10*
@@ -28,7 +28,7 @@
28*****************************************************************************/ 28*****************************************************************************/
29 29
30const char *progname = "check_swap"; 30const char *progname = "check_swap";
31const char *copyright = "2000-2007"; 31const char *copyright = "2000-2024";
32const char *email = "devel@monitoring-plugins.org"; 32const char *email = "devel@monitoring-plugins.org";
33 33
34#include "common.h" 34#include "common.h"
@@ -52,9 +52,9 @@ const char *email = "devel@monitoring-plugins.org";
52#endif 52#endif
53 53
54typedef struct { 54typedef struct {
55 int is_percentage; 55 bool is_percentage;
56 uint64_t value; 56 uint64_t value;
57} threshold_t; 57} threshold;
58 58
59int check_swap (float free_swap_mb, float total_swap_mb); 59int check_swap (float free_swap_mb, float total_swap_mb);
60int process_arguments (int argc, char **argv); 60int process_arguments (int argc, char **argv);
@@ -62,8 +62,8 @@ int validate_arguments (void);
62void print_usage (void); 62void print_usage (void);
63void print_help (void); 63void print_help (void);
64 64
65threshold_t warn; 65threshold warn;
66threshold_t crit; 66threshold crit;
67int verbose; 67int verbose;
68bool allswaps = false; 68bool allswaps = false;
69int no_swap_state = STATE_CRITICAL; 69int no_swap_state = STATE_CRITICAL;
@@ -465,7 +465,7 @@ process_arguments (int argc, char **argv)
465 465
466 if (optarg[length - 1] == '%') { 466 if (optarg[length - 1] == '%') {
467 /* It's percentage */ 467 /* It's percentage */
468 warn.is_percentage = 1; 468 warn.is_percentage = true;
469 optarg[length - 1] = '\0'; 469 optarg[length - 1] = '\0';
470 if (is_uint64(optarg, &warn.value)) { 470 if (is_uint64(optarg, &warn.value)) {
471 if (warn.value > 100) { 471 if (warn.value > 100) {
@@ -475,7 +475,7 @@ process_arguments (int argc, char **argv)
475 break; 475 break;
476 } else { 476 } else {
477 /* It's Bytes */ 477 /* It's Bytes */
478 warn.is_percentage = 0; 478 warn.is_percentage = false;
479 if (is_uint64(optarg, &warn.value)) { 479 if (is_uint64(optarg, &warn.value)) {
480 break; 480 break;
481 } else { 481 } else {
@@ -495,7 +495,7 @@ process_arguments (int argc, char **argv)
495 495
496 if (optarg[length - 1] == '%') { 496 if (optarg[length - 1] == '%') {
497 /* It's percentage */ 497 /* It's percentage */
498 crit.is_percentage = 1; 498 crit.is_percentage = true;
499 optarg[length - 1] = '\0'; 499 optarg[length - 1] = '\0';
500 if (is_uint64(optarg, &crit.value)) { 500 if (is_uint64(optarg, &crit.value)) {
501 if (crit.value> 100) { 501 if (crit.value> 100) {
@@ -505,7 +505,7 @@ process_arguments (int argc, char **argv)
505 break; 505 break;
506 } else { 506 } else {
507 /* It's Bytes */ 507 /* It's Bytes */
508 crit.is_percentage = 0; 508 crit.is_percentage = false;
509 if (is_uint64(optarg, &crit.value)) { 509 if (is_uint64(optarg, &crit.value)) {
510 break; 510 break;
511 } else { 511 } else {