summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorBenoit Mortier <opensides@users.sourceforge.net>2004-12-03 23:02:04 (GMT)
committerBenoit Mortier <opensides@users.sourceforge.net>2004-12-03 23:02:04 (GMT)
commit5e3fc41c6143676cf01b7aad789fc5f2cae5ce84 (patch)
treec6a4be653d48aab261ad1496f9b83f6f17c491e1 /plugins
parentc6a18d714a1ee49c62eb3b53ebff41ecadf3b7c2 (diff)
downloadmonitoring-plugins-5e3fc41c6143676cf01b7aad789fc5f2cae5ce84.tar.gz
print_help and print_usage() cleanup
other misc cleanups git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@996 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_dig.c6
-rw-r--r--plugins/check_disk.c6
-rw-r--r--plugins/check_dns.c12
-rw-r--r--plugins/check_dummy.c8
-rw-r--r--plugins/check_fping.c8
-rw-r--r--plugins/check_game.c4
-rw-r--r--plugins/check_hpjd.c3
-rw-r--r--plugins/check_http.c14
-rw-r--r--plugins/check_ide-smart.c252
-rw-r--r--plugins/check_ldap.c5
-rw-r--r--plugins/check_mrtg.c5
-rw-r--r--plugins/check_mrtgtraf.c20
-rw-r--r--plugins/check_nagios.c2
-rw-r--r--plugins/check_nt.c18
-rw-r--r--plugins/check_nwstat.c6
-rw-r--r--plugins/check_overcr.c2
-rw-r--r--plugins/check_pgsql.c4
-rw-r--r--plugins/check_procs.c4
-rw-r--r--plugins/check_radius.c3
-rw-r--r--plugins/check_real.c2
-rw-r--r--plugins/check_smtp.c5
-rw-r--r--plugins/check_snmp.c12
-rw-r--r--plugins/check_swap.c8
-rw-r--r--plugins/check_tcp.c12
-rw-r--r--plugins/check_time.c5
-rw-r--r--plugins/check_udp.c2
-rw-r--r--plugins/check_ups.c3
27 files changed, 217 insertions, 214 deletions
diff --git a/plugins/check_dig.c b/plugins/check_dig.c
index 5bed80d..8f88316 100644
--- a/plugins/check_dig.c
+++ b/plugins/check_dig.c
@@ -20,7 +20,7 @@
20 20
21const char *progname = "check_dig"; 21const char *progname = "check_dig";
22const char *revision = "$Revision$"; 22const char *revision = "$Revision$";
23const char *copyright = "2002-2003"; 23const char *copyright = "2002-2004";
24const char *email = "nagiosplug-devel@lists.sourceforge.net"; 24const char *email = "nagiosplug-devel@lists.sourceforge.net";
25 25
26#include "common.h" 26#include "common.h"
@@ -221,7 +221,7 @@ process_arguments (int argc, char **argv)
221 print_help (); 221 print_help ();
222 exit (STATE_OK); 222 exit (STATE_OK);
223 case 'V': /* version */ 223 case 'V': /* version */
224 print_revision (progname, "$Revision$"); 224 print_revision (progname, revision);
225 exit (STATE_OK); 225 exit (STATE_OK);
226 case 'H': /* hostname */ 226 case 'H': /* hostname */
227 if (is_host (optarg)) { 227 if (is_host (optarg)) {
@@ -318,7 +318,7 @@ print_help (void)
318 printf ("Copyright (c) 2000 Karl DeBisschop <kdebisschop@users.sourceforge.net>\n"); 318 printf ("Copyright (c) 2000 Karl DeBisschop <kdebisschop@users.sourceforge.net>\n");
319 printf (COPYRIGHT, copyright, email); 319 printf (COPYRIGHT, copyright, email);
320 320
321 printf (_("Test the DNS service on the specified host using dig\n")); 321 printf (_("Test the DNS service on the specified host using dig\n\n"));
322 322
323 print_usage (); 323 print_usage ();
324 324
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index 109420a..71a6807 100644
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
@@ -21,7 +21,7 @@
21const char *progname = "check_disk"; 21const char *progname = "check_disk";
22const char *program_name = "check_disk"; // Required for coreutils libs 22const char *program_name = "check_disk"; // Required for coreutils libs
23const char *revision = "$Revision$"; 23const char *revision = "$Revision$";
24const char *copyright = "1999-2003"; 24const char *copyright = "1999-2004";
25const char *email = "nagiosplug-devel@lists.sourceforge.net"; 25const char *email = "nagiosplug-devel@lists.sourceforge.net";
26 26
27#include "common.h" 27#include "common.h"
@@ -578,7 +578,7 @@ print_help (void)
578 578
579 printf (_("\ 579 printf (_("\
580This plugin checks the amount of used disk space on a mounted file system\n\ 580This plugin checks the amount of used disk space on a mounted file system\n\
581and generates an alert if free space is less than one of the threshold values.")); 581and generates an alert if free space is less than one of the threshold values.\n\n"));
582 582
583 print_usage (); 583 print_usage ();
584 584
@@ -638,5 +638,5 @@ print_usage (void)
638{ 638{
639 printf ("\ 639 printf ("\
640Usage: %s -w limit -c limit [-p path | -x device] [-t timeout] [-m] [-e]\n\ 640Usage: %s -w limit -c limit [-p path | -x device] [-t timeout] [-m] [-e]\n\
641 [-v] [-q]\n", progname); 641 [-v] [-q]\n", progname);
642} 642}
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index 492fa17..2a8f459 100644
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
@@ -395,6 +395,12 @@ print_help (void)
395 printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"); 395 printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
396 printf (COPYRIGHT, copyright, email); 396 printf (COPYRIGHT, copyright, email);
397 397
398 printf (_("\
399This plugin uses the nslookup program to obtain the IP address\n\
400for the given host/domain query. A optional DNS server to use may\n\
401be specified. If no DNS server is specified, the default server(s)\n\
402specified in /etc/resolv.conf will be used.\n\n"));
403
398 print_usage (); 404 print_usage ();
399 405
400 printf (_(UT_HELP_VRSN)); 406 printf (_(UT_HELP_VRSN));
@@ -411,12 +417,6 @@ print_help (void)
411 417
412 printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT); 418 printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
413 419
414 printf (_("\n\
415This plugin uses the nslookup program to obtain the IP address\n\
416for the given host/domain query. A optional DNS server to use may\n\
417be specified. If no DNS server is specified, the default server(s)\n\
418specified in /etc/resolv.conf will be used.\n"));
419
420 printf (_(UT_SUPPORT)); 420 printf (_(UT_SUPPORT));
421} 421}
422 422
diff --git a/plugins/check_dummy.c b/plugins/check_dummy.c
index e0c38d3..2dbbaec 100644
--- a/plugins/check_dummy.c
+++ b/plugins/check_dummy.c
@@ -91,14 +91,14 @@ print_help (void)
91 printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"); 91 printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
92 printf (COPYRIGHT, copyright, email); 92 printf (COPYRIGHT, copyright, email);
93 93
94 printf (_("\
95This plugin will simply return the state corresponding to the numeric value\n\
96of the <state> argument with optional text.\n\n"));
97
94 print_usage (); 98 print_usage ();
95 99
96 printf (_(UT_HELP_VRSN)); 100 printf (_(UT_HELP_VRSN));
97 101
98 printf (_("\n\
99This plugin will simply return the state corresponding to the numeric value\n\
100of the <state> argument with optional text.\n"));
101
102 printf (_(UT_SUPPORT)); 102 printf (_(UT_SUPPORT));
103} 103}
104 104
diff --git a/plugins/check_fping.c b/plugins/check_fping.c
index 0b23f79..ce62a7c 100644
--- a/plugins/check_fping.c
+++ b/plugins/check_fping.c
@@ -356,15 +356,15 @@ void
356print_help (void) 356print_help (void)
357{ 357{
358 358
359 print_revision (progname, "$Revision$"); 359 print_revision (progname, revision);
360 360
361 printf ("Copyright (c) 1999 Didi Rieder <adrieder@sbox.tu-graz.ac.at>\n"); 361 printf ("Copyright (c) 1999 Didi Rieder <adrieder@sbox.tu-graz.ac.at>\n");
362 printf (COPYRIGHT, copyright, email); 362 printf (COPYRIGHT, copyright, email);
363 363
364 printf (_("\ 364 printf (_("\
365This plugin will use the /bin/fping command (from saint) to ping the\n\ 365This plugin will use the /bin/fping command to ping the specified host\n\
366specified host for a fast check if the host is alive. Note that it is\n\ 366for a fast check if the host is alive.\n\
367necessary to set the suid flag on fping.\n\n")); 367Note that it is necessary to set the suid flag on fping.\n\n"));
368 368
369 print_usage (); 369 print_usage ();
370 370
diff --git a/plugins/check_game.c b/plugins/check_game.c
index 9b13d94..c0f9a47 100644
--- a/plugins/check_game.c
+++ b/plugins/check_game.c
@@ -302,7 +302,7 @@ print_help (void)
302 printf ("Copyright (c) 1999 Ian Cass, Knowledge Matters Limited\n"); 302 printf ("Copyright (c) 1999 Ian Cass, Knowledge Matters Limited\n");
303 printf (_(COPYRIGHT), copyright, email); 303 printf (_(COPYRIGHT), copyright, email);
304 304
305 printf (_("This plugin tests %s connections with the specified host."), progname); 305 printf (_("This plugin tests game server connections with the specified host."), progname);
306 306
307 print_usage (); 307 print_usage ();
308 308
@@ -334,7 +334,7 @@ print_usage (void)
334{ 334{
335 printf ("\ 335 printf ("\
336Usage: %s <game> <ip_address> [-p port] [-gf game_field] [-mf map_field]\n\ 336Usage: %s <game> <ip_address> [-p port] [-gf game_field] [-mf map_field]\n\
337 [-pf ping_field]\n", progname); 337 [-pf ping_field]\n", progname);
338} 338}
339 339
340/****************************************************************************** 340/******************************************************************************
diff --git a/plugins/check_hpjd.c b/plugins/check_hpjd.c
index 816ce19..678d5c8 100644
--- a/plugins/check_hpjd.c
+++ b/plugins/check_hpjd.c
@@ -398,6 +398,5 @@ Net-snmp must be installed on the computer running the plugin.\n\n"));
398void 398void
399print_usage (void) 399print_usage (void)
400{ 400{
401 printf (_("\ 401 printf ("Usage: %s -H host [-C community]\n"), progname);
402Usage: %s -H host [-C community]\n"), progname);
403} 402}
diff --git a/plugins/check_http.c b/plugins/check_http.c
index f334026..3ff834b 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -21,7 +21,7 @@
21 21
22const char *progname = "check_http"; 22const char *progname = "check_http";
23const char *revision = "$Revision$"; 23const char *revision = "$Revision$";
24const char *copyright = "1999-2001"; 24const char *copyright = "1999-2004";
25const char *email = "nagiosplug-devel@lists.sourceforge.net"; 25const char *email = "nagiosplug-devel@lists.sourceforge.net";
26 26
27#include "common.h" 27#include "common.h"
@@ -1376,7 +1376,7 @@ print_help (void)
1376This plugin tests the HTTP service on the specified host. It can test\n\ 1376This plugin tests the HTTP service on the specified host. It can test\n\
1377normal (http) and secure (https) servers, follow redirects, search for\n\ 1377normal (http) and secure (https) servers, follow redirects, search for\n\
1378strings and regular expressions, check connection times, and report on\n\ 1378strings and regular expressions, check connection times, and report on\n\
1379certificate expiration times.\n")); 1379certificate expiration times.\n\n"));
1380 1380
1381 print_usage (); 1381 print_usage ();
1382 1382
@@ -1492,9 +1492,9 @@ print_usage (void)
1492{ 1492{
1493 printf (_("\ 1493 printf (_("\
1494Usage: %s -H <vhost> | -I <IP-address>) [-u <uri>] [-p <port>]\n\ 1494Usage: %s -H <vhost> | -I <IP-address>) [-u <uri>] [-p <port>]\n\
1495 [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L]\n\ 1495 [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L]\n\
1496 [-a auth] [-f <ok | warn | critcal | follow>] [-e <expect>]\n\ 1496 [-a auth] [-f <ok | warn | critcal | follow>] [-e <expect>]\n\
1497 [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n\ 1497 [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n\
1498 [-P string] [-m min_pg_size] [-4|-6] [-N] [-M <age>] [-A string]\n\ 1498 [-P string] [-m min_pg_size] [-4|-6] [-N] [-M <age>]\n\
1499 [-k string]\n"), progname); 1499 [-A string] [-k string]\n"), progname);
1500} 1500}
diff --git a/plugins/check_ide-smart.c b/plugins/check_ide-smart.c
index 9ebef6c..1c0af31 100644
--- a/plugins/check_ide-smart.c
+++ b/plugins/check_ide-smart.c
@@ -146,6 +146,125 @@ enum SmartCommand
146 }; 146 };
147 147
148 148
149int
150main (int argc, char *argv[])
151{
152 char *device = NULL;
153 int command = -1;
154 int o, longindex;
155 int retval = 0;
156
157 thresholds_t thresholds;
158 values_t values;
159 int fd;
160
161 static struct option longopts[] = {
162 {"device", required_argument, 0, 'd'},
163 {"immediate", no_argument, 0, 'i'},
164 {"quiet-check", no_argument, 0, 'q'},
165 {"auto-on", no_argument, 0, '1'},
166 {"auto-off", no_argument, 0, '0'},
167 {"net-saint", no_argument, 0, 'n'},
168 {"help", no_argument, 0, 'h'},
169 {"version", no_argument, 0, 'V'}, {0, 0, 0, 0}
170 };
171
172 setlocale (LC_ALL, "");
173 bindtextdomain (PACKAGE, LOCALEDIR);
174 textdomain (PACKAGE);
175
176 while (1) {
177
178 o = getopt_long (argc, argv, "+d:iq10nhV", longopts, &longindex);
179
180 if (o == -1 || o == EOF)
181 break;
182
183 switch (o) {
184 case 'd':
185 device = optarg;
186 break;
187 case 'q':
188 command = 3;
189 break;
190 case 'i':
191 command = 2;
192 break;
193 case '1':
194 command = 1;
195 break;
196 case '0':
197 command = 0;
198 break;
199 case 'n':
200 command = 4;
201 break;
202 case 'h':
203 print_help ();
204 return STATE_OK;
205 case 'V':
206 print_revision (progname, revision);
207 return STATE_OK;
208 default:
209 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
210 print_usage ();
211 exit (STATE_UNKNOWN);
212 }
213
214 if (optind < argc) {
215 device = argv[optind];
216 }
217
218 if (!device) {
219 show_help ();
220 show_version ();
221 return -1;
222 }
223
224 fd = open (device, O_RDONLY);
225
226 if (fd < 0) {
227 printf (_("CRITICAL - Couldn't open device: %s\n"), strerror (errno));
228 return 2;
229 }
230
231 if (smart_cmd_simple (fd, SMART_CMD_ENABLE, 0, TRUE)) {
232 printf (_("CRITICAL - SMART_CMD_ENABLE\n"));
233 return 2;
234 }
235
236 switch (command) {
237 case 0:
238 retval = smart_cmd_simple (fd, SMART_CMD_AUTO_OFFLINE, 0, TRUE);
239 break;
240 case 1:
241 retval = smart_cmd_simple (fd, SMART_CMD_AUTO_OFFLINE, 0xF8, TRUE);
242 break;
243 case 2:
244 retval = smart_cmd_simple (fd, SMART_CMD_IMMEDIATE_OFFLINE, 0, TRUE);
245 break;
246 case 3:
247 smart_read_values (fd, &values);
248 smart_read_thresholds (fd, &thresholds);
249 retval = values_not_passed (&values, &thresholds);
250 break;
251 case 4:
252 smart_read_values (fd, &values);
253 smart_read_thresholds (fd, &thresholds);
254 retval = net_saint (&values, &thresholds);
255 break;
256 default:
257 smart_read_values (fd, &values);
258 smart_read_thresholds (fd, &thresholds);
259 print_values (&values, &thresholds);
260 break;
261 }
262 close (fd);
263 }
264 return retval;
265}
266
267
149 268
150char * 269char *
151get_offline_text (int status) 270get_offline_text (int status)
@@ -371,19 +490,14 @@ smart_read_thresholds (int fd, thresholds_t * thresholds)
371 490
372 491
373void 492void
374show_version () 493print_help ()
375{ 494{
376 printf ("check_ide-smart v.1 - FREE Software with NO WARRANTY\n"); 495 print_revision (progname, revision);
377 printf ("Nagios feature - Robert Dale <rdale@digital-mission.com>\n"); 496
497 printf ("Nagios feature - 1999 Robert Dale <rdale@digital-mission.com>\n");
378 printf ("(C) 1999 Ragnar Hojland Espinosa <ragnar@lightside.dhis.org>\n"); 498 printf ("(C) 1999 Ragnar Hojland Espinosa <ragnar@lightside.dhis.org>\n");
379 printf (COPYRIGHT, copyright, email); 499 printf (COPYRIGHT, copyright, email);
380} 500
381
382
383
384void
385show_help ()
386{
387 printf (_("\ 501 printf (_("\
388Usage: %s [DEVICE] [OPTION]\n\ 502Usage: %s [DEVICE] [OPTION]\n\
389 -d, --device=DEVICE\n\ 503 -d, --device=DEVICE\n\
@@ -402,120 +516,8 @@ Usage: %s [DEVICE] [OPTION]\n\
402 516
403 517
404 518
405int 519void
406main (int argc, char *argv[]) 520print_usage (void)
407{ 521{
408 char *device = NULL; 522 printf ("Usage: %s \n"), progname);
409 int command = -1;
410 int o, longindex;
411 int retval = 0;
412
413 thresholds_t thresholds;
414 values_t values;
415 int fd;
416
417 static struct option longopts[] = {
418 {"device", required_argument, 0, 'd'},
419 {"immediate", no_argument, 0, 'i'},
420 {"quiet-check", no_argument, 0, 'q'},
421 {"auto-on", no_argument, 0, '1'},
422 {"auto-off", no_argument, 0, '0'},
423 {"net-saint", no_argument, 0, 'n'},
424 {"help", no_argument, 0, 'h'},
425 {"version", no_argument, 0, 'V'}, {0, 0, 0, 0}
426 };
427
428 setlocale (LC_ALL, "");
429 bindtextdomain (PACKAGE, LOCALEDIR);
430 textdomain (PACKAGE);
431
432 while (1) {
433
434 o = getopt_long (argc, argv, "+d:iq10nhV", longopts, &longindex);
435
436 if (o == -1 || o == EOF)
437 break;
438
439 switch (o) {
440 case 'd':
441 device = optarg;
442 break;
443 case 'q':
444 command = 3;
445 break;
446 case 'i':
447 command = 2;
448 break;
449 case '1':
450 command = 1;
451 break;
452 case '0':
453 command = 0;
454 break;
455 case 'n':
456 command = 4;
457 break;
458 case 'h':
459 show_help ();
460 return 0;
461 case 'V':
462 show_version ();
463 return 0;
464 default:
465 printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
466 print_usage ();
467 exit (STATE_UNKNOWN);
468 }
469
470 if (optind < argc) {
471 device = argv[optind];
472 }
473
474 if (!device) {
475 show_help ();
476 show_version ();
477 return -1;
478 }
479
480 fd = open (device, O_RDONLY);
481
482 if (fd < 0) {
483 printf (_("CRITICAL - Couldn't open device: %s\n"), strerror (errno));
484 return 2;
485 }
486
487 if (smart_cmd_simple (fd, SMART_CMD_ENABLE, 0, TRUE)) {
488 printf (_("CRITICAL - SMART_CMD_ENABLE\n"));
489 return 2;
490 }
491
492 switch (command) {
493 case 0:
494 retval = smart_cmd_simple (fd, SMART_CMD_AUTO_OFFLINE, 0, TRUE);
495 break;
496 case 1:
497 retval = smart_cmd_simple (fd, SMART_CMD_AUTO_OFFLINE, 0xF8, TRUE);
498 break;
499 case 2:
500 retval = smart_cmd_simple (fd, SMART_CMD_IMMEDIATE_OFFLINE, 0, TRUE);
501 break;
502 case 3:
503 smart_read_values (fd, &values);
504 smart_read_thresholds (fd, &thresholds);
505 retval = values_not_passed (&values, &thresholds);
506 break;
507 case 4:
508 smart_read_values (fd, &values);
509 smart_read_thresholds (fd, &thresholds);
510 retval = net_saint (&values, &thresholds);
511 break;
512 default:
513 smart_read_values (fd, &values);
514 smart_read_thresholds (fd, &thresholds);
515 print_values (&values, &thresholds);
516 break;
517 }
518 close (fd);
519 }
520 return retval;
521} 523}
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c
index 9664c0f..dfdd837 100644
--- a/plugins/check_ldap.c
+++ b/plugins/check_ldap.c
@@ -277,8 +277,6 @@ validate_arguments ()
277 277
278 278
279 279
280
281
282void 280void
283print_help (void) 281print_help (void)
284{ 282{
@@ -334,7 +332,8 @@ print_usage (void)
334{ 332{
335 printf ("\ 333 printf ("\
336Usage: %s -H <host> -b <base_dn> [-p <port>] [-a <attr>] [-D <binddn>]\n\ 334Usage: %s -H <host> -b <base_dn> [-p <port>] [-a <attr>] [-D <binddn>]\n\
337 [-P <password>] [-w <warn_time>] [-c <crit_time>] [-t timeout]%s\n", 335 [-P <password>] [-w <warn_time>] [-c <crit_time>]\n\
336 [-t timeout]%s\n",
338//(Note: all times are in seconds.)\n", 337//(Note: all times are in seconds.)\n",
339 progname, 338 progname,
340#ifdef HAVE_LDAP_SET_OPTION 339#ifdef HAVE_LDAP_SET_OPTION
diff --git a/plugins/check_mrtg.c b/plugins/check_mrtg.c
index 5dfee72..cf3cc85 100644
--- a/plugins/check_mrtg.c
+++ b/plugins/check_mrtg.c
@@ -316,7 +316,7 @@ print_help (void)
316 316
317 printf(_("\ 317 printf(_("\
318This plugin will check either the average or maximum value of one of the\n\ 318This plugin will check either the average or maximum value of one of the\n\
319two variables recorded in an MRTG log file.\n")); 319two variables recorded in an MRTG log file.\n\n"));
320 320
321 print_usage (); 321 print_usage ();
322 322
@@ -377,5 +377,6 @@ print_usage (void)
377{ 377{
378 printf ("\ 378 printf ("\
379Usage: %s -F log_file -a <AVG | MAX> -v variable -w warning -c critical\n\ 379Usage: %s -F log_file -a <AVG | MAX> -v variable -w warning -c critical\n\
380 [-l label] [-u units] [-e expire_minutes] [-t timeout] [-v]\n", progname); 380 [-l label] [-u units] [-e expire_minutes] [-t timeout]\n\
381 [-v]\n", progname);
381} 382}
diff --git a/plugins/check_mrtgtraf.c b/plugins/check_mrtgtraf.c
index 9b408a4..0f7afbc 100644
--- a/plugins/check_mrtgtraf.c
+++ b/plugins/check_mrtgtraf.c
@@ -321,6 +321,14 @@ print_help (void)
321 printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"); 321 printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
322 printf (COPYRIGHT, copyright, email); 322 printf (COPYRIGHT, copyright, email);
323 323
324 printf (_("\n\
325This plugin will check the incoming/outgoing transfer rates of a router,\n\
326switch, etc recorded in an MRTG log. If the newest log entry is older\n\
327than <expire_minutes>, a WARNING status is returned. If either the\n\
328incoming or outgoing rates exceed the <icl> or <ocl> thresholds (in\n\
329Bytes/sec), a CRITICAL status results. If either of the rates exceed\n\
330the <iwl> or <owl> thresholds (in Bytes/sec), a WARNING status results.\n\n"));
331
324 print_usage (); 332 print_usage ();
325 333
326 printf (_(UT_HELP_VRSN)); 334 printf (_(UT_HELP_VRSN));
@@ -337,14 +345,6 @@ print_help (void)
337 -c, --critical\n\ 345 -c, --critical\n\
338 Critical threshold pair \"<incoming>,<outgoing>\"\n")); 346 Critical threshold pair \"<incoming>,<outgoing>\"\n"));
339 347
340 printf (_("\n\
341This plugin will check the incoming/outgoing transfer rates of a router,\n\
342switch, etc recorded in an MRTG log. If the newest log entry is older\n\
343than <expire_minutes>, a WARNING status is returned. If either the\n\
344incoming or outgoing rates exceed the <icl> or <ocl> thresholds (in\n\
345Bytes/sec), a CRITICAL status results. If either of the rates exceed\n\
346the <iwl> or <owl> thresholds (in Bytes/sec), a WARNING status results.\n\n"));
347
348 printf (_("Notes:\n\ 348 printf (_("Notes:\n\
349- MRTG stands for Multi Router Traffic Grapher. It can be downloaded from\n\ 349- MRTG stands for Multi Router Traffic Grapher. It can be downloaded from\n\
350 http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html\n\ 350 http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html\n\
@@ -363,6 +363,6 @@ void
363print_usage (void) 363print_usage (void)
364{ 364{
365 printf ("\ 365 printf ("\
366Usage: %s -F <log_file> -a <AVG | MAX> -v <variable> -w <warning_pair> -c <critical_pair>\n\ 366Usage: %s -F <log_file> -a <AVG | MAX> -v <variable> -w <warning_pair>\n\
367 [-e expire_minutes] [-t timeout] [-v]\n", progname); 367 -c <critical_pair> [-e expire_minutes] [-t timeout] [-v]\n", progname);
368} 368}
diff --git a/plugins/check_nagios.c b/plugins/check_nagios.c
index 8a10c4a..29abc2a 100644
--- a/plugins/check_nagios.c
+++ b/plugins/check_nagios.c
@@ -276,7 +276,7 @@ This plugin attempts to check the status of the Nagios process on the local\n\
276machine. The plugin will check to make sure the Nagios status log is no older\n\ 276machine. The plugin will check to make sure the Nagios status log is no older\n\
277than the number of minutes specified by the <expire_minutes> option. It also\n\ 277than the number of minutes specified by the <expire_minutes> option. It also\n\
278uses the /bin/ps command to check for a process matching whatever you specify\n\ 278uses the /bin/ps command to check for a process matching whatever you specify\n\
279by the <process_string> argument.\n")); 279by the <process_string> argument.\n\n"));
280 280
281 print_usage (); 281 print_usage ();
282 282
diff --git a/plugins/check_nt.c b/plugins/check_nt.c
index 67c3017..4826d68 100644
--- a/plugins/check_nt.c
+++ b/plugins/check_nt.c
@@ -608,11 +608,15 @@ void preparelist(char *string) {
608void print_help(void) 608void print_help(void)
609{ 609{
610 print_revision(progname,revision); 610 print_revision(progname,revision);
611 printf (_("\ 611
612Copyright (c) 2000 Yves Rubin (rubiyz@yahoo.com)\n\n\ 612 printf (_("Copyright (c) 2000 Yves Rubin (rubiyz@yahoo.com)\n"));
613This plugin collects data from the NSClient service running on a\n\ 613 printf (COPYRIGHT, copyright, email);
614Windows NT/2000/XP server.\n\n")); 614
615 printf (_("This plugin collects data from the NSClient service running on a\n\
616Windows NT/2000/XP/2003 server.\n\n"));
617
615 print_usage(); 618 print_usage();
619
616 printf (_("\nOptions:\n\ 620 printf (_("\nOptions:\n\
617-H, --hostname=HOST\n\ 621-H, --hostname=HOST\n\
618 Name of the host to check\n\ 622 Name of the host to check\n\
@@ -629,8 +633,8 @@ Windows NT/2000/XP server.\n\n"));
629-h, --help\n\ 633-h, --help\n\
630 Print this help screen\n\ 634 Print this help screen\n\
631-V, --version\n\ 635-V, --version\n\
632 Print version information\n"), 636 Print version information\n"), PORT, DEFAULT_SOCKET_TIMEOUT);
633 PORT, DEFAULT_SOCKET_TIMEOUT); 637
634 printf (_("\ 638 printf (_("\
635-v, --variable=STRING\n\ 639-v, --variable=STRING\n\
636 Variable to check. Valid variables are:\n")); 640 Variable to check. Valid variables are:\n"));
@@ -684,5 +688,5 @@ void print_usage(void)
684{ 688{
685 printf("\ 689 printf("\
686Usage: %s -H host -v variable [-p port] [-w warning] [-c critical]\n\ 690Usage: %s -H host -v variable [-p port] [-w warning] [-c critical]\n\
687 [-l params] [-d SHOWALL] [-t timeout]\n", progname); 691 [-l params] [-d SHOWALL] [-t timeout]\n", progname);
688} 692}
diff --git a/plugins/check_nwstat.c b/plugins/check_nwstat.c
index b791640..4dffba3 100644
--- a/plugins/check_nwstat.c
+++ b/plugins/check_nwstat.c
@@ -908,8 +908,8 @@ void print_help(void)
908 printf (COPYRIGHT, copyright, email); 908 printf (COPYRIGHT, copyright, email);
909 909
910 printf (_("\ 910 printf (_("\
911Usage: %s This plugin attempts to contact the MRTGEXT NLM running\n\ 911This plugin attempts to contact the MRTGEXT NLM running on a\n\
912on a Novell server to gather the requested system information.\n\n"), 912Novell server to gather the requested system information.\n\n"),
913 progname); 913 progname);
914 914
915 print_usage(); 915 print_usage();
@@ -989,5 +989,5 @@ void print_usage(void)
989{ 989{
990 printf ("\ 990 printf ("\
991Usage: %s -H host [-p port] [-v variable] [-w warning] [-c critical]\n\ 991Usage: %s -H host [-p port] [-v variable] [-w warning] [-c critical]\n\
992 [-t timeout].\n", progname); 992 [-t timeout].\n", progname);
993} 993}
diff --git a/plugins/check_overcr.c b/plugins/check_overcr.c
index 2ebf62e..8fb1ef4 100644
--- a/plugins/check_overcr.c
+++ b/plugins/check_overcr.c
@@ -465,5 +465,5 @@ print_usage (void)
465{ 465{
466 printf ("\ 466 printf ("\
467Usage: %s -H host [-p port] [-v variable] [-w warning] [-c critical]\n\ 467Usage: %s -H host [-p port] [-v variable] [-w warning] [-c critical]\n\
468 [-t timeout]\n", progname); 468 [-t timeout]\n", progname);
469} 469}
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
index 53f9e96..a002571 100644
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
@@ -391,7 +391,7 @@ print_help (void)
391 391
392 print_revision (progname, revision); 392 print_revision (progname, revision);
393 393
394 printf (_(COPYRIGHT), copyright, email); 394 printf (COPYRIGHT, copyright, email);
395 395
396 printf (_("Test whether a PostgreSQL Database is accepting connections.\n\n")); 396 printf (_("Test whether a PostgreSQL Database is accepting connections.\n\n"));
397 397
@@ -443,5 +443,5 @@ print_usage (void)
443{ 443{
444 printf ("\ 444 printf ("\
445Usage: %s [-H <host>] [-P <port>] [-c <critical time>] [-w <warning time>]\n\ 445Usage: %s [-H <host>] [-P <port>] [-c <critical time>] [-w <warning time>]\n\
446 [-t <timeout>] [-d <database>] [-l <logname>] [-p <password>]\n", progname); 446 [-t <timeout>] [-d <database>] [-l <logname>] [-p <password>]\n", progname);
447} 447}
diff --git a/plugins/check_procs.c b/plugins/check_procs.c
index 7770dda..5742b72 100644
--- a/plugins/check_procs.c
+++ b/plugins/check_procs.c
@@ -751,6 +751,6 @@ print_usage (void)
751{ 751{
752 printf ("\ 752 printf ("\
753Usage: %s -w <range> -c <range> [-m metric] [-s state] [-p ppid]\n\ 753Usage: %s -w <range> -c <range> [-m metric] [-s state] [-p ppid]\n\
754 [-u user] [-r rss] [-z vsz] [-P %%cpu] [-a argument-array]\n\ 754 [-u user] [-r rss] [-z vsz] [-P %%cpu] [-a argument-array]\n\
755 [-C command] [-t timeout] [-v]\n", progname); 755 [-C command] [-t timeout] [-v]\n", progname);
756} 756}
diff --git a/plugins/check_radius.c b/plugins/check_radius.c
index 90653a2..bdb9b7a 100644
--- a/plugins/check_radius.c
+++ b/plugins/check_radius.c
@@ -26,6 +26,7 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net";
26#include "common.h" 26#include "common.h"
27#include "utils.h" 27#include "utils.h"
28#include "netutils.h" 28#include "netutils.h"
29
29#include <radiusclient.h> 30#include <radiusclient.h>
30 31
31int process_arguments (int, char **); 32int process_arguments (int, char **);
@@ -335,5 +336,5 @@ print_usage (void)
335{ 336{
336 printf ("\ 337 printf ("\
337Usage: %s -H host -F config_file -u username -p password [-n nas-id] [-P port]\n\ 338Usage: %s -H host -F config_file -u username -p password [-n nas-id] [-P port]\n\
338 [-t timeout] [-r retries] [-e expect]\n", progname); 339 [-t timeout] [-r retries] [-e expect]\n", progname);
339} 340}
diff --git a/plugins/check_real.c b/plugins/check_real.c
index 9fad2a8..f843172 100644
--- a/plugins/check_real.c
+++ b/plugins/check_real.c
@@ -438,5 +438,5 @@ print_usage (void)
438{ 438{
439 printf ("\ 439 printf ("\
440Usage: %s -H host [-e expect] [-p port] [-w warn] [-c crit]\n\ 440Usage: %s -H host [-e expect] [-p port] [-w warn] [-c crit]\n\
441 [-t timeout] [-v]\n", progname); 441 [-t timeout] [-v]\n", progname);
442} 442}
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index ac20853..d834642 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -422,8 +422,7 @@ print_help (void)
422 printf ("Copyright (c) 1999-2001 Ethan Galstad <nagios@nagios.org>\n"); 422 printf ("Copyright (c) 1999-2001 Ethan Galstad <nagios@nagios.org>\n");
423 printf (COPYRIGHT, copyright, email); 423 printf (COPYRIGHT, copyright, email);
424 424
425 printf(_("\ 425 printf(_("This plugin will attempt to open an SMTP connection with the host.\n\n"));
426This plugin will attempt to open an SMTP connection with the host.\n\n"));
427 426
428 print_usage (); 427 print_usage ();
429 428
@@ -468,5 +467,5 @@ print_usage (void)
468{ 467{
469 printf ("\ 468 printf ("\
470Usage: %s -H host [-p port] [-e expect] [-C command] [-f from addr]\n\ 469Usage: %s -H host [-p port] [-e expect] [-C command] [-f from addr]\n\
471 [-w warn] [-c crit] [-t timeout] [-n] [-v] [-4|-6]\n", progname); 470 [-w warn] [-c crit] [-t timeout] [-n] [-v] [-4|-6]\n", progname);
472} 471}
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index fa4f56c..18b7f2f 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -842,7 +842,7 @@ print_help (void)
842{ 842{
843 print_revision (progname, revision); 843 print_revision (progname, revision);
844 844
845 printf (_(COPYRIGHT), copyright, email); 845 printf (COPYRIGHT, copyright, email);
846 846
847 printf (_("\ 847 printf (_("\
848Check status of remote machines and obtain sustem information via SNMP\n\n")); 848Check status of remote machines and obtain sustem information via SNMP\n\n"));
@@ -950,9 +950,9 @@ print_usage (void)
950{ 950{
951 printf ("\ 951 printf ("\
952Usage: %s -H <ip_address> -o <OID> [-w warn_range] [-c crit_range] \n\ 952Usage: %s -H <ip_address> -o <OID> [-w warn_range] [-c crit_range] \n\
953 [-C community] [-s string] [-r regex] [-R regexi] [-t timeout]\n\ 953 [-C community] [-s string] [-r regex] [-R regexi] [-t timeout]\n\
954 [-l label] [-u units] [-p port-number] [-d delimiter]\n\ 954 [-l label] [-u units] [-p port-number] [-d delimiter]\n\
955 [-D output-delimiter] [-m miblist] [-P snmp version]\n\ 955 [-D output-delimiter] [-m miblist] [-P snmp version]\n\
956 [-L seclevel] [-U secname] [-a authproto] [-A authpasswd]\n\ 956 [-L seclevel] [-U secname] [-a authproto] [-A authpasswd]\n\
957 [-X privpasswd]\n", progname); 957 [-X privpasswd]\n", progname);
958} 958}
diff --git a/plugins/check_swap.c b/plugins/check_swap.c
index 3a3ec35..2e5f5c7 100644
--- a/plugins/check_swap.c
+++ b/plugins/check_swap.c
@@ -479,7 +479,7 @@ print_help (void)
479 479
480 printf (_(COPYRIGHT), copyright, email); 480 printf (_(COPYRIGHT), copyright, email);
481 481
482 printf (_("Check swap space on local server.\n\n")); 482 printf (_("Check swap space on local machine.\n\n"));
483 483
484 print_usage (); 484 print_usage ();
485 485
@@ -514,7 +514,7 @@ On AIX, if -a is specified, uses lsps -a, otherwise uses lsps -s.\n"));
514void 514void
515print_usage (void) 515print_usage (void)
516{ 516{
517 printf ("Usage:\n\ 517 printf ("\
518 %s [-av] -w <percent_free>%% -c <percent_free>%%\n\ 518 Usage: %s [-av] -w <percent_free>%% -c <percent_free>%%\n\
519 %s [-av] -w <bytes_free> -c <bytes_free>\n", progname, progname); 519 %s [-av] -w <bytes_free> -c <bytes_free>\n", progname, progname);
520} 520}
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index b2066c7..93ba344 100644
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -739,8 +739,8 @@ print_help (void)
739{ 739{
740 print_revision (progname, revision); 740 print_revision (progname, revision);
741 741
742 printf (_("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n")); 742 printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"));
743 printf (_(COPYRIGHT), copyright, email); 743 printf (COPYRIGHT, copyright, email);
744 744
745 printf (_("This plugin tests %s connections with the specified host.\n\n"), 745 printf (_("This plugin tests %s connections with the specified host.\n\n"),
746 SERVICE); 746 SERVICE);
@@ -795,8 +795,8 @@ print_usage (void)
795{ 795{
796 printf ("\ 796 printf ("\
797Usage: %s -H host -p port [-w <warning time>] [-c <critical time>]\n\ 797Usage: %s -H host -p port [-w <warning time>] [-c <critical time>]\n\
798 [-s <send string>] [-e <expect string>] [-q <quit string>]\n\ 798 [-s <send string>] [-e <expect string>] [-q <quit string>]\n\
799 [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>]\n\ 799 [-m <maximum bytes>] [-d <delay>] [-t <timeout seconds>]\n\
800 [-r <refuse state>] [-v] [-4|-6] [-j] [-D <days to cert expiry>]\n\ 800 [-r <refuse state>] [-v] [-4|-6] [-j] [-D <days to cert expiry>]\n\
801 [-S <use SSL>]\n", progname); 801 [-S <use SSL>]\n", progname);
802} 802}
diff --git a/plugins/check_time.c b/plugins/check_time.c
index 5d07f54..b2e5374 100644
--- a/plugins/check_time.c
+++ b/plugins/check_time.c
@@ -326,8 +326,7 @@ print_help (void)
326 printf ("Copyright (c) 1999 Ethan Galstad\n"); 326 printf ("Copyright (c) 1999 Ethan Galstad\n");
327 printf (COPYRIGHT, copyright, email); 327 printf (COPYRIGHT, copyright, email);
328 328
329 printf (_("\ 329 printf (_("This plugin will check the time on the specified host.\n\n"));
330This plugin will check the time on the specified host.\n\n"));
331 330
332 print_usage (); 331 print_usage ();
333 332
@@ -359,5 +358,5 @@ print_usage (void)
359{ 358{
360 printf ("\ 359 printf ("\
361Usage: %s -H <host_address> [-p port] [-u] [-w variance] [-c variance]\n\ 360Usage: %s -H <host_address> [-p port] [-u] [-w variance] [-c variance]\n\
362 [-W connect_time] [-C connect_time] [-t timeout]\n", progname); 361 [-W connect_time] [-C connect_time] [-t timeout]\n", progname);
363} 362}
diff --git a/plugins/check_udp.c b/plugins/check_udp.c
index ea91f41..e446b93 100644
--- a/plugins/check_udp.c
+++ b/plugins/check_udp.c
@@ -264,5 +264,5 @@ print_usage (void)
264{ 264{
265 printf ("\ 265 printf ("\
266Usage: %s -H <host_address> [-p port] [-w warn_time] [-c crit_time]\n\ 266Usage: %s -H <host_address> [-p port] [-w warn_time] [-c crit_time]\n\
267 [-e expect] [-s send] [-t to_sec] [-v]\n", progname); 267 [-e expect] [-s send] [-t to_sec] [-v]\n", progname);
268} 268}
diff --git a/plugins/check_ups.c b/plugins/check_ups.c
index 23fb8d2..8383b09 100644
--- a/plugins/check_ups.c
+++ b/plugins/check_ups.c
@@ -592,7 +592,6 @@ print_help (void)
592 printf ("Copyright (c) 2000 Tom Shields"); 592 printf ("Copyright (c) 2000 Tom Shields");
593 printf ("Copyright (c) 2004 Alain Richard <alain.richard@equation.fr>\n"); 593 printf ("Copyright (c) 2004 Alain Richard <alain.richard@equation.fr>\n");
594 printf ("Copyright (c) 2004 Arnaud Quette <arnaud.quette@mgeups.com>\n"); 594 printf ("Copyright (c) 2004 Arnaud Quette <arnaud.quette@mgeups.com>\n");
595
596 printf (COPYRIGHT, copyright, email); 595 printf (COPYRIGHT, copyright, email);
597 596
598 printf (_("This plugin tests the UPS service on the specified host.\n\ 597 printf (_("This plugin tests the UPS service on the specified host.\n\
@@ -648,5 +647,5 @@ print_usage (void)
648{ 647{
649 printf ("\ 648 printf ("\
650Usage: %s -H host -u ups [-p port] [-v variable]\n\ 649Usage: %s -H host -u ups [-p port] [-v variable]\n\
651 [-wv warn_value] [-cv crit_value] [-to to_sec] [-T]\n", progname); 650 [-wv warn_value] [-cv crit_value] [-to to_sec] [-T]\n", progname);
652} 651}