diff options
| -rw-r--r-- | plugins/check_fping.c | 109 | ||||
| -rw-r--r-- | plugins/check_snmp.c | 4 |
2 files changed, 53 insertions, 60 deletions
diff --git a/plugins/check_fping.c b/plugins/check_fping.c index ac203f52..86170d57 100644 --- a/plugins/check_fping.c +++ b/plugins/check_fping.c | |||
| @@ -22,17 +22,20 @@ | |||
| 22 | * | 22 | * |
| 23 | * Description: | 23 | * Description: |
| 24 | * | 24 | * |
| 25 | * This plugin will use the /bin/fping command (form saint) to ping | 25 | * This plugin will use the /bin/fping command (from saint) to ping |
| 26 | * the specified host for a fast check if the host is alive. Note that | 26 | * the specified host for a fast check if the host is alive. Note that |
| 27 | * it is necessary to set the suid flag on fping. | 27 | * it is necessary to set the suid flag on fping. |
| 28 | ******************************************************************************/ | 28 | ******************************************************************************/ |
| 29 | 29 | ||
| 30 | #include "config.h" | 30 | const char *progname = "check_fping"; |
| 31 | const char *revision = "$Revision$"; | ||
| 32 | const char *copyright = "1999-2003"; | ||
| 33 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | ||
| 34 | |||
| 31 | #include "common.h" | 35 | #include "common.h" |
| 32 | #include "popen.h" | 36 | #include "popen.h" |
| 33 | #include "utils.h" | 37 | #include "utils.h" |
| 34 | 38 | ||
| 35 | const char *progname = "check_fping"; | ||
| 36 | #define PACKET_COUNT 1 | 39 | #define PACKET_COUNT 1 |
| 37 | #define PACKET_SIZE 56 | 40 | #define PACKET_SIZE 56 |
| 38 | #define UNKNOWN_PACKET_LOSS 200 /* 200% */ | 41 | #define UNKNOWN_PACKET_LOSS 200 /* 200% */ |
| @@ -41,11 +44,54 @@ const char *progname = "check_fping"; | |||
| 41 | #define PL 0 | 44 | #define PL 0 |
| 42 | #define RTA 1 | 45 | #define RTA 1 |
| 43 | 46 | ||
| 47 | void | ||
| 48 | print_usage (void) | ||
| 49 | { | ||
| 50 | printf (_("Usage: %s <host_address>\n"), progname); | ||
| 51 | } | ||
| 52 | |||
| 53 | void | ||
| 54 | print_help (void) | ||
| 55 | { | ||
| 56 | |||
| 57 | print_revision (progname, "$Revision$"); | ||
| 58 | |||
| 59 | printf (_("\ | ||
| 60 | Copyright (c) 1999 Didi Rieder (adrieder@sbox.tu-graz.ac.at)\n\n\ | ||
| 61 | This plugin will use the /bin/fping command (from saint) to ping the\n\ | ||
| 62 | specified host for a fast check if the host is alive. Note that it is\n\ | ||
| 63 | necessary to set the suid flag on fping.\n\n")); | ||
| 64 | |||
| 65 | print_usage (); | ||
| 66 | |||
| 67 | printf (_(UT_HELP_VRSN)); | ||
| 68 | |||
| 69 | printf (_("\ | ||
| 70 | -H, --hostname=HOST\n\ | ||
| 71 | Name or IP Address of host to ping (IP Address bypasses name lookup,\n\ | ||
| 72 | reducing system load)\n\ | ||
| 73 | -w, --warning=THRESHOLD\n\ | ||
| 74 | warning threshold pair\n\ | ||
| 75 | -c, --critical=THRESHOLD\n\ | ||
| 76 | critical threshold pair\n\ | ||
| 77 | -b, --bytes=INTEGER\n\ | ||
| 78 | Size of ICMP packet (default: %d)\n\ | ||
| 79 | -n, --number=INTEGER\n\ | ||
| 80 | Number of ICMP packets to send (default: %d)\n"), | ||
| 81 | PACKET_SIZE, PACKET_COUNT); | ||
| 82 | |||
| 83 | printf (_(UT_VERBOSE)); | ||
| 84 | |||
| 85 | printf (_("\n\ | ||
| 86 | THRESHOLD is <rta>,<pl>%% where <rta> is the round trip average travel\n\ | ||
| 87 | time (ms) which triggers a WARNING or CRITICAL state, and <pl> is the\n\ | ||
| 88 | percentage of packet loss to trigger an alarm state.\n")); | ||
| 89 | |||
| 90 | } | ||
| 91 | |||
| 44 | int textscan (char *buf); | 92 | int textscan (char *buf); |
| 45 | int process_arguments (int, char **); | 93 | int process_arguments (int, char **); |
| 46 | int get_threshold (char *arg, char *rv[2]); | 94 | int get_threshold (char *arg, char *rv[2]); |
| 47 | void print_usage (void); | ||
| 48 | void print_help (void); | ||
| 49 | 95 | ||
| 50 | char *server_name = NULL; | 96 | char *server_name = NULL; |
| 51 | int cpl = UNKNOWN_PACKET_LOSS; | 97 | int cpl = UNKNOWN_PACKET_LOSS; |
| @@ -343,56 +389,3 @@ get_threshold (char *arg, char *rv[2]) | |||
| 343 | 389 | ||
| 344 | return OK; | 390 | return OK; |
| 345 | } | 391 | } |
| 346 | |||
| 347 | |||
| 348 | |||
| 349 | |||
| 350 | |||
| 351 | void | ||
| 352 | print_usage (void) | ||
| 353 | { | ||
| 354 | printf ("Usage: %s <host_address>\n", progname); | ||
| 355 | } | ||
| 356 | |||
| 357 | |||
| 358 | |||
| 359 | |||
| 360 | |||
| 361 | void | ||
| 362 | print_help (void) | ||
| 363 | { | ||
| 364 | |||
| 365 | print_revision (progname, "$Revision$"); | ||
| 366 | |||
| 367 | printf | ||
| 368 | ("Copyright (c) 1999 Didi Rieder (adrieder@sbox.tu-graz.ac.at)\n\n" | ||
| 369 | "This plugin will use the /bin/fping command (from saint) to ping the\n" | ||
| 370 | "specified host for a fast check if the host is alive. Note that it is\n" | ||
| 371 | "necessary to set the suid flag on fping.\n\n"); | ||
| 372 | |||
| 373 | print_usage (); | ||
| 374 | |||
| 375 | printf | ||
| 376 | ("\nOptions:\n" | ||
| 377 | "-H, --hostname=HOST\n" | ||
| 378 | " Name or IP Address of host to ping (IP Address bypasses name lookup,\n" | ||
| 379 | " reducing system load)\n" | ||
| 380 | "-w, --warning=THRESHOLD\n" | ||
| 381 | " warning threshold pair\n" | ||
| 382 | "-c, --critical=THRESHOLD\n" | ||
| 383 | " critical threshold pair\n" | ||
| 384 | "-b, --bytes=INTEGER\n" | ||
| 385 | " Size of ICMP packet (default: %d)\n" | ||
| 386 | "-n, --number=INTEGER\n" | ||
| 387 | " Number of ICMP packets to send (default: %d)\n" | ||
| 388 | "-v, --verbose\n" | ||
| 389 | " Show details for command-line debugging (do not use with nagios server)\n" | ||
| 390 | "-h, --help\n" | ||
| 391 | " Print this help screen\n" | ||
| 392 | "-V, --version\n" | ||
| 393 | " Print version information\n" | ||
| 394 | "THRESHOLD is <rta>,<pl>%% where <rta> is the round trip average travel\n" | ||
| 395 | "time (ms) which triggers a WARNING or CRITICAL state, and <pl> is the\n" | ||
| 396 | "percentage of packet loss to trigger an alarm state.\n", | ||
| 397 | PACKET_SIZE, PACKET_COUNT); | ||
| 398 | } | ||
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index 097c30ea..821f10ec 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c | |||
| @@ -65,7 +65,7 @@ print_help (void) | |||
| 65 | printf (_(COPYRIGHT), copyright, email); | 65 | printf (_(COPYRIGHT), copyright, email); |
| 66 | 66 | ||
| 67 | printf (_("\ | 67 | printf (_("\ |
| 68 | Check status of remote machines and obtain sustem information via SNMP")); | 68 | Check status of remote machines and obtain sustem information via SNMP\n\n")); |
| 69 | 69 | ||
| 70 | print_usage (); | 70 | print_usage (); |
| 71 | 71 | ||
| @@ -133,7 +133,7 @@ Check status of remote machines and obtain sustem information via SNMP")); | |||
| 133 | 133 | ||
| 134 | printf (_(UT_VERBOSE)); | 134 | printf (_(UT_VERBOSE)); |
| 135 | 135 | ||
| 136 | printf (_("\ | 136 | printf (_("\n\ |
| 137 | - This plugin uses the 'snmpget' command included with the NET-SNMP package.\n\ | 137 | - This plugin uses the 'snmpget' command included with the NET-SNMP package.\n\ |
| 138 | If you don't have the package installed, you will need to download it from\n\ | 138 | If you don't have the package installed, you will need to download it from\n\ |
| 139 | http://net-snmp.sourceforge.net before you can use this plugin.\n")); | 139 | http://net-snmp.sourceforge.net before you can use this plugin.\n")); |
