summaryrefslogtreecommitdiffstats
path: root/plugins/check_hpjd.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_hpjd.c')
-rw-r--r--plugins/check_hpjd.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/plugins/check_hpjd.c b/plugins/check_hpjd.c
index 5699570..af6044a 100644
--- a/plugins/check_hpjd.c
+++ b/plugins/check_hpjd.c
@@ -14,6 +14,7 @@
14* along with this program; if not, write to the Free Software 14* along with this program; if not, write to the Free Software
15* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 15* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16* 16*
17* $Id$
17*****************************************************************************/ 18*****************************************************************************/
18 19
19#include "common.h" 20#include "common.h"
@@ -84,7 +85,7 @@ main (int argc, char **argv)
84 textdomain (PACKAGE); 85 textdomain (PACKAGE);
85 86
86 if (process_arguments (argc, argv) != OK) 87 if (process_arguments (argc, argv) != OK)
87 usage (_("Incorrect arguments supplied\n")); 88 usage (_("check_hpjd: could not parse arguments\n"));
88 89
89 /* removed ' 2>1' at end of command 10/27/1999 - EG */ 90 /* removed ' 2>1' at end of command 10/27/1999 - EG */
90 /* create the query string */ 91 /* create the query string */
@@ -285,8 +286,6 @@ main (int argc, char **argv)
285 286
286 287
287 288
288
289
290/* process command-line arguments */ 289/* process command-line arguments */
291int 290int
292process_arguments (int argc, char **argv) 291process_arguments (int argc, char **argv)
@@ -321,7 +320,7 @@ process_arguments (int argc, char **argv)
321 address = strscpy(address, optarg) ; 320 address = strscpy(address, optarg) ;
322 } 321 }
323 else { 322 else {
324 usage2 (_("Invalid host name"), optarg); 323 usage2 (_("Invalid hostname/address"), optarg);
325 } 324 }
326 break; 325 break;
327 case 'C': /* community */ 326 case 'C': /* community */
@@ -334,7 +333,9 @@ process_arguments (int argc, char **argv)
334 print_help (); 333 print_help ();
335 exit (STATE_OK); 334 exit (STATE_OK);
336 case '?': /* help */ 335 case '?': /* help */
337 usage (_("Invalid argument\n")); 336 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
337 print_usage ();
338 exit (STATE_UNKNOWN);
338 } 339 }
339 } 340 }
340 341
@@ -344,7 +345,7 @@ process_arguments (int argc, char **argv)
344 address = argv[c++]; 345 address = argv[c++];
345 } 346 }
346 else { 347 else {
347 usage2 (_("Invalid host name"), argv[c]); 348 usage2 (_("Invalid hostname/address"), argv[c]);
348 } 349 }
349 } 350 }
350 351
@@ -360,8 +361,6 @@ process_arguments (int argc, char **argv)
360 361
361 362
362 363
363
364
365int 364int
366validate_arguments (void) 365validate_arguments (void)
367{ 366{
@@ -370,9 +369,6 @@ validate_arguments (void)
370 369
371 370
372 371
373
374
375
376void 372void
377print_help (void) 373print_help (void)
378{ 374{
@@ -398,7 +394,6 @@ Net-snmp must be installed on the computer running the plugin.\n\n"));
398 394
399 395
400 396
401
402void 397void
403print_usage (void) 398print_usage (void)
404{ 399{