diff options
Diffstat (limited to 'plugins/check_swap.c')
-rw-r--r-- | plugins/check_swap.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/check_swap.c b/plugins/check_swap.c index 4e3471b6..c3199ab7 100644 --- a/plugins/check_swap.c +++ b/plugins/check_swap.c | |||
@@ -56,10 +56,13 @@ static swap_config_wrapper process_arguments(int argc, char **argv); | |||
56 | void print_usage(void); | 56 | void print_usage(void); |
57 | static void print_help(swap_config /*config*/); | 57 | static void print_help(swap_config /*config*/); |
58 | 58 | ||
59 | static int verbose; | 59 | int verbose; |
60 | 60 | ||
61 | #define HUNDRED_PERCENT 100 | 61 | #define HUNDRED_PERCENT 100 |
62 | 62 | ||
63 | #define BYTES_TO_KiB(number) (number / 1024) | ||
64 | #define BYTES_TO_MiB(number) (BYTES_TO_KiB(number) / 1024) | ||
65 | |||
63 | int main(int argc, char **argv) { | 66 | int main(int argc, char **argv) { |
64 | setlocale(LC_ALL, ""); | 67 | setlocale(LC_ALL, ""); |
65 | bindtextdomain(PACKAGE, LOCALEDIR); | 68 | bindtextdomain(PACKAGE, LOCALEDIR); |
@@ -127,8 +130,8 @@ int main(int argc, char **argv) { | |||
127 | data.statusCode = max_state(data.statusCode, STATE_CRITICAL); | 130 | data.statusCode = max_state(data.statusCode, STATE_CRITICAL); |
128 | } | 131 | } |
129 | 132 | ||
130 | printf(_("SWAP %s - %g%% free (%lluMB out of %lluMB) %s|%s\n"), state_text(data.statusCode), (HUNDRED_PERCENT - percent_used), | 133 | printf(_("SWAP %s - %g%% free (%lluMiB out of %lluMiB) %s|%s\n"), state_text(data.statusCode), (HUNDRED_PERCENT - percent_used), |
131 | data.metrics.free, data.metrics.total, status, perfdata); | 134 | BYTES_TO_MiB(data.metrics.free), BYTES_TO_MiB(data.metrics.total), status, perfdata); |
132 | 135 | ||
133 | exit(data.statusCode); | 136 | exit(data.statusCode); |
134 | } | 137 | } |