diff --git a/plugins/check_nwstat.c b/plugins/check_nwstat.c
index dc8ce2104b6f7f76526117b5eb9847ac5e429847..6a21f90175684db0d7d8faabfd85e7da4a7bf0e6 100644 (file)
--- a/plugins/check_nwstat.c
+++ b/plugins/check_nwstat.c
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ $Id$
+
******************************************************************************/
const char *progname = "check_nwstat";
-
-
-\f
int
main(int argc, char **argv) {
int result;
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- if (process_arguments(argc,argv)==ERROR)
- usage(_("Could not parse arguments\n"));
+ if (process_arguments(argc,argv) != OK)
+ usage (_("check_nwstat: could not parse arguments\n"));
/* initialize alarm signal handling */
signal(SIGALRM,socket_timeout_alarm_handler);
if (result!=STATE_OK)
return result;
if (!strcmp(recv_buffer,"-1\n"))
- asprintf (&netware_version, "%s", "");
+ netware_version = strdup("");
else {
recv_buffer[strlen(recv_buffer)-1]=0;
asprintf (&netware_version,_("NetWare %s: "),recv_buffer);
}
} else
- asprintf (&netware_version, "%s", "");
+ netware_version = strdup("");
/* check CPU load */
return result;
if (!strcmp(recv_buffer,"-1\n")) {
- asprintf (&output_message,_("Error: Volume '%s' does not exist!"),volume_name);
+ asprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
result=STATE_CRITICAL;
} else {
free_disk_space=strtoul(recv_buffer,NULL,10);
if (!strcmp(recv_buffer,"-1\n")) {
- asprintf (&output_message,_("Error: Volume '%s' does not exist!"),volume_name);
+ asprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
result=STATE_CRITICAL;
} else {
return result;
if (!strcmp(recv_buffer,"-1\n")) {
- asprintf (&output_message,_("Error: Volume '%s' does not exist!"),volume_name);
+ asprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
result=STATE_CRITICAL;
} else {
purgeable_disk_space=strtoul(recv_buffer,NULL,10);
if (!strcmp(recv_buffer,"-1\n")) {
- asprintf (&output_message,_("Error: Volume '%s' does not exist!"),volume_name);
+ asprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
result=STATE_CRITICAL;
} else {
return result;
if (!strcmp(recv_buffer,"-1\n")) {
- asprintf (&output_message,_("Error: Volume '%s' does not exist!"),volume_name);
+ asprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
result=STATE_CRITICAL;
} else {
non_purgeable_disk_space=strtoul(recv_buffer,NULL,10);
if (!strcmp(recv_buffer,"-1\n")) {
- asprintf (&output_message,_("Error: Volume '%s' does not exist!"),volume_name);
+ asprintf (&output_message,_("CRITICAL - Volume '%s' does not exist!"),volume_name);
result=STATE_CRITICAL;
} else {
if (time_sync_status==0) {
result=STATE_CRITICAL;
- asprintf (&output_message,_("Critical: Time not in sync with network!"));
+ asprintf (&output_message,_("CRITICAL - Time not in sync with network!"));
}
else {
- asprintf (&output_message,_("OK! Time in sync with network!"));
+ asprintf (&output_message,_("OK - Time in sync with network!"));
}
/* check LRU sitting time in secondss */
return result;
}
-\f
+
+
+
/* process command-line arguments */
int process_arguments(int argc, char **argv) {
int c;
-
-
-\f
void print_help(void)
{
char *myport;
print_revision (progname, revision);
- printf (_("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"));
- printf (_(COPYRIGHT), copyright, email);
+ printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
+ printf (COPYRIGHT, copyright, email);
printf (_("\
Usage: %s This plugin attempts to contact the MRTGEXT NLM running\n\
-
void print_usage(void)
{
printf (_("\