[Nagiosplug-checkins] CVS: nagiosplug/plugins check_hpjd.c,1.13,1.14

Karl DeBisschop kdebisschop at users.sourceforge.net
Sat Aug 2 15:20:01 CEST 2003


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv28292

Modified Files:
	check_hpjd.c 
Log Message:
markup for translation

Index: check_hpjd.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_hpjd.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** check_hpjd.c	13 Apr 2003 04:49:58 -0000	1.13
--- check_hpjd.c	2 Aug 2003 22:19:21 -0000	1.14
***************
*** 20,46 ****
  #include "popen.h"
  #include "utils.h"
  
  const char *progname = "check_hpjd";
  const char *revision = "$Revision$";
- const char *authors = "Nagios Plugin Development Team";
- const char *email = "nagiosplug-devel at lists.sourceforge.net";
  const char *copyright = "2000-2003";
  
! const char *summary = "\
  This plugin tests the STATUS of an HP printer with a JetDirect card.\n\
! Net-snmp must be installed on the computer running the plugin.\n\n";
  
! const char *option_summary = "-H host [-C community]\n";
  
! const char *options = "\
!  -H, --hostname=STRING or IPADDRESS\n\
!    Check server on the indicated host\n\
   -C, --community=STRING\n\
!    The SNMP community name (default=%s)\n\
!  -h, --help\n\
!    Print detailed help screen\n\
!  -V, --version\n\
!    Print version information\n\n";
  
  #define HPJD_LINE_STATUS		".1.3.6.1.4.1.11.2.3.9.1.1.2.1"
  #define HPJD_PAPER_STATUS		".1.3.6.1.4.1.11.2.3.9.1.1.2.2"
--- 20,63 ----
  #include "popen.h"
  #include "utils.h"
+ #include "netutils.h"
+ 
+ #define DEFAULT_COMMUNITY "public"
  
  const char *progname = "check_hpjd";
  const char *revision = "$Revision$";
  const char *copyright = "2000-2003";
+ const char *email = "nagiosplug-devel at lists.sourceforge.net";
  
! const char *option_summary = "-H host [-C community]\n";
! void
! print_usage (void)
! {
! 	printf (_("\
! Usage: %s -H host [-C community]\n"), progname);
! 	printf (_(UT_HLP_VRS), progname, progname);
! }
! 
! void
! print_help (void)
! {
! 	print_revision (progname, revision);
! 
! 	printf (_(COPYRIGHT), copyright, email);
! 
! 	printf (_("\
  This plugin tests the STATUS of an HP printer with a JetDirect card.\n\
! Net-snmp must be installed on the computer running the plugin.\n\n"));
  
! 	print_usage ();
! 
! 	printf (_(UT_HELP_VRSN));
  
! 	printf (_("\
   -C, --community=STRING\n\
!     The SNMP community name (default=%s)\n"), DEFAULT_COMMUNITY);
  
+ 	printf (_(UT_SUPPORT));
+ }
+ 
  #define HPJD_LINE_STATUS		".1.3.6.1.4.1.11.2.3.9.1.1.2.1"
  #define HPJD_PAPER_STATUS		".1.3.6.1.4.1.11.2.3.9.1.1.2.2"
***************
*** 59,73 ****
  #define OFFLINE		1
  
- #define DEFAULT_COMMUNITY "public"
- 
  int process_arguments (int, char **);
  int validate_arguments (void);
- void print_help (void);
- void print_usage (void);
  
  char *community = DEFAULT_COMMUNITY;
  char *address = NULL;
  
- 
  int
  main (int argc, char **argv)
--- 76,85 ----
***************
*** 95,99 ****
  
  	if (process_arguments (argc, argv) != OK)
! 		usage ("Invalid command arguments supplied\n");
  
  	/* removed ' 2>1' at end of command 10/27/1999 - EG */
--- 107,111 ----
  
  	if (process_arguments (argc, argv) != OK)
! 		usage (_("Invalid command arguments supplied\n"));
  
  	/* removed ' 2>1' at end of command 10/27/1999 - EG */
***************
*** 120,124 ****
  	child_process = spopen (command_line);
  	if (child_process == NULL) {
! 		printf ("Could not open pipe: %s\n", command_line);
  		return STATE_UNKNOWN;
  	}
--- 132,136 ----
  	child_process = spopen (command_line);
  	if (child_process == NULL) {
! 		printf (_("Could not open pipe: %s\n"), command_line);
  		return STATE_UNKNOWN;
  	}
***************
*** 126,130 ****
  	child_stderr = fdopen (child_stderr_array[fileno (child_process)], "r");
  	if (child_stderr == NULL) {
! 		printf ("Could not open stderr for %s\n", command_line);
  	}
  
--- 138,142 ----
  	child_stderr = fdopen (child_stderr_array[fileno (child_process)], "r");
  	if (child_stderr == NULL) {
! 		printf (_("Could not open stderr for %s\n"), command_line);
  	}
  
***************
*** 294,345 ****
  		if (paper_jam) {
  			result = STATE_WARNING;
! 			strcpy (error_message, "Paper Jam");
  		}
  		else if (paper_out) {
  			result = STATE_WARNING;
! 			strcpy (error_message, "Out of Paper");
  		}
  		else if (line_status == OFFLINE) {
  			if (strcmp (error_message, "POWERSAVE ON") != 0) {
  				result = STATE_WARNING;
! 				strcpy (error_message, "Printer Offline");
  			}
  		}
  		else if (peripheral_error) {
  			result = STATE_WARNING;
! 			strcpy (error_message, "Peripheral Error");
  		}
  		else if (intervention_required) {
  			result = STATE_WARNING;
! 			strcpy (error_message, "Intervention Required");
  		}
  		else if (toner_low) {
  			result = STATE_WARNING;
! 			strcpy (error_message, "Toner Low");
  		}
  		else if (memory_out) {
  			result = STATE_WARNING;
! 			strcpy (error_message, "Insufficient Memory");
  		}
  		else if (door_open) {
  			result = STATE_WARNING;
! 			strcpy (error_message, "A Door is Open");
  		}
  		else if (paper_output) {
  			result = STATE_WARNING;
! 			strcpy (error_message, "Output Tray is Full");
  		}
  		else if (page_punt) {
  			result = STATE_WARNING;
! 			strcpy (error_message, "Data too Slow for Engine");
  		}
  		else if (paper_status) {
  			result = STATE_WARNING;
! 			strcpy (error_message, "Unknown Paper Error");
  		}
  	}
  
  	if (result == STATE_OK)
! 		printf ("Printer ok - (%s)\n", display_message);
  
  	else if (result == STATE_UNKNOWN) {
--- 306,357 ----
  		if (paper_jam) {
  			result = STATE_WARNING;
! 			strcpy (error_message, _("Paper Jam"));
  		}
  		else if (paper_out) {
  			result = STATE_WARNING;
! 			strcpy (error_message, _("Out of Paper"));
  		}
  		else if (line_status == OFFLINE) {
  			if (strcmp (error_message, "POWERSAVE ON") != 0) {
  				result = STATE_WARNING;
! 				strcpy (error_message, _("Printer Offline"));
  			}
  		}
  		else if (peripheral_error) {
  			result = STATE_WARNING;
! 			strcpy (error_message, _("Peripheral Error"));
  		}
  		else if (intervention_required) {
  			result = STATE_WARNING;
! 			strcpy (error_message, _("Intervention Required"));
  		}
  		else if (toner_low) {
  			result = STATE_WARNING;
! 			strcpy (error_message, _("Toner Low"));
  		}
  		else if (memory_out) {
  			result = STATE_WARNING;
! 			strcpy (error_message, _("Insufficient Memory"));
  		}
  		else if (door_open) {
  			result = STATE_WARNING;
! 			strcpy (error_message, _("A Door is Open"));
  		}
  		else if (paper_output) {
  			result = STATE_WARNING;
! 			strcpy (error_message, _("Output Tray is Full"));
  		}
  		else if (page_punt) {
  			result = STATE_WARNING;
! 			strcpy (error_message, _("Data too Slow for Engine"));
  		}
  		else if (paper_status) {
  			result = STATE_WARNING;
! 			strcpy (error_message, _("Unknown Paper Error"));
  		}
  	}
  
  	if (result == STATE_OK)
! 		printf (_("Printer ok - (%s)\n"), display_message);
  
  	else if (result == STATE_UNKNOWN) {
***************
*** 396,400 ****
  			}
  			else {
! 				usage ("Invalid host name\n");
  			}
  			break;
--- 408,412 ----
  			}
  			else {
! 				usage (_("Invalid host name\n"));
  			}
  			break;
***************
*** 409,413 ****
  			exit (STATE_OK);
  		case '?':									/* help */
! 			usage ("Invalid argument\n");
  		}
  	}
--- 421,425 ----
  			exit (STATE_OK);
  		case '?':									/* help */
! 			usage (_("Invalid argument\n"));
  		}
  	}
***************
*** 419,423 ****
  		}
  		else {
! 			usage ("Invalid host name");
  		}
  	}
--- 431,435 ----
  		}
  		else {
! 			usage (_("Invalid host name"));
  		}
  	}
***************
*** 439,470 ****
  	return OK;
  }
- 
- 
- 
- 
- 
- void
- print_help (void)
- {
- 	print_revision (progname, revision);
- 	printf ("Copyright (c) %s %s\n\t<%s>\n\n", copyright, authors, email);
- 	printf (summary);
- 	print_usage ();
- 	printf ("\nOptions:\n");
- 	printf (options, DEFAULT_COMMUNITY);
- 	support ();
- }
- 
- void
- print_usage (void)
- {
- 	printf ("\
- Usage:\n\
-  %s %s\n\
-  %s (-h | --help) for detailed help\n\
-  %s (-V | --version) for version information\n",
- 	        progname, option_summary, progname, progname);
- }
- 
- 
- 
--- 451,452 ----





More information about the Commits mailing list