diff --git a/plugins/check_swap.c b/plugins/check_swap.c
index 3a3ec35c7bd695e452c4a1df5e20e0db58ecc383..bcc6b170c6d4e554682d8c2c5fa94032828c696b 100644 (file)
--- a/plugins/check_swap.c
+++ b/plugins/check_swap.c
int result = STATE_UNKNOWN;
char input_buffer[MAX_INPUT_BUFFER];
char *perf;
- int conv_factor = SWAP_CONVERSION;
#ifdef HAVE_PROC_MEMINFO
FILE *fp;
#else
+ int conv_factor = SWAP_CONVERSION;
# ifdef HAVE_SWAP
char *temp_buffer;
char *swap_command;
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;
/* and now, tally 'em up */
swapctl_res=swapctl(SC_LIST, tbl);
if(swapctl_res < 0){
- perror("swapctl failed: ");
+ perror(_("swapctl failed: "));
result = STATE_WARNING;
}
/* and now, tally 'em up */
swapctl_res=swapctl(SWAP_STATS, ent, nswaps);
if(swapctl_res < 0){
- perror("swapctl failed: ");
+ perror(_("swapctl failed: "));
result = STATE_WARNING;
}
break;
}
else {
- usage (_("Warning threshold must be integer or percentage!\n"));
+ usage4 (_("Warning threshold must be integer or percentage!"));
}
case 'c': /* critical size threshold */
if (is_intnonneg (optarg)) {
break;
}
else {
- usage (_("Critical threshold must be integer or percentage!\n"));
+ usage4 (_("Critical threshold must be integer or percentage!"));
}
case 'a': /* all swap */
allswaps = TRUE;
print_help ();
exit (STATE_OK);
case '?': /* error */
- printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
- print_usage ();
- exit (STATE_UNKNOWN);
+ usage2 (_("Unknown argument"), optarg);
}
}
return ERROR;
}
else if (warn_percent < crit_percent) {
- usage
- (_("Warning percentage should be more than critical percentage\n"));
+ usage4
+ (_("Warning percentage should be more than critical percentage"));
}
else if (warn_size < crit_size) {
- usage
- (_("Warning free space should be more than critical free space\n"));
+ usage4
+ (_("Warning free space should be more than critical free space"));
}
return OK;
}
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", progname, progname);
+ printf ("\
+Usage: %s [-av] -w <percent_free>%% -c <percent_free>%%\n\
+ %s [-av] -w <bytes_free> -c <bytes_free>\n", progname, progname);
}