diff --git a/plugins/check_swap.c b/plugins/check_swap.c
index 608080acb6f0ab856977c47b739f3c867be08dc3..ba353bc0b89a44580860c6c94815806f61ecf2fa 100644 (file)
--- a/plugins/check_swap.c
+++ b/plugins/check_swap.c
*
*****************************************************************************/
-#include "common.h"
-#include "popen.h"
-#include "utils.h"
-
const char *progname = "check_swap";
const char *revision = "$Revision$";
-const char *copyright = "2000-2003";
+const char *copyright = "2000-2004";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
+#include "common.h"
+#include "popen.h"
+#include "utils.h"
+
int check_swap (int usp, long unsigned int free_swap);
int process_arguments (int argc, char **argv);
int validate_arguments (void);
int percent_used, percent;
unsigned long long total_swap = 0, used_swap = 0, free_swap = 0;
unsigned long long dsktotal = 0, dskused = 0, dskfree = 0, tmp = 0;
- int result = STATE_OK;
+ int result = STATE_UNKNOWN;
char input_buffer[MAX_INPUT_BUFFER];
char *perf;
int conv_factor = SWAP_CONVERSION;
tmp_status = strdup ("");
perf = strdup ("");
- if (process_arguments (argc, argv) != TRUE)
+ if (process_arguments (argc, argv) == ERROR)
usage4 (_("Could not parse arguments"));
#ifdef HAVE_PROC_MEMINFO
dskfree = dskfree / conv_factor;
# endif
if (verbose >= 3)
- printf (_("total=%d, free=%d\n"), dsktotal, dskfree);
+ printf (_("total=%llu, free=%llu\n"), dsktotal, dskfree);
dskused = dsktotal - dskfree;
total_swap += dsktotal;
printf (_(COPYRIGHT), copyright, email);
- printf (_("Check swap space on local server.\n\n"));
+ printf (_("Check swap space on local machine.\n\n"));
print_usage ();
void
print_usage (void)
{
- printf (_("Usage:\n\
- %s [-av] -w <percent_free>%% -c <percent_free>%%\n\
- %s [-av] -w <bytes_free> -c <bytes_free>\n\
- %s (-h | --help) for detailed help\n\
- %s (-V | --version) for version information\n"),
- progname, progname, progname, progname);
+ printf ("\
+ Usage: %s [-av] -w <percent_free>%% -c <percent_free>%%\n\
+ %s [-av] -w <bytes_free> -c <bytes_free>\n", progname, progname);
}