summaryrefslogtreecommitdiffstats
path: root/plugins-root/check_icmp.c
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-06-23 09:26:13 +0200
committerLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-06-23 10:16:42 +0200
commit8ae415ee4ceddeed1c1a1e0e6e64175cff6731c3 (patch)
tree21e3232aae654cc531589d6c6edbbb78e4aa0b67 /plugins-root/check_icmp.c
parentb8580c18e354b9070adbf464df186442d55dc120 (diff)
downloadmonitoring-plugins-8ae415ee4ceddeed1c1a1e0e6e64175cff6731c3.tar.gz
Improve check_icmp help output
Diffstat (limited to 'plugins-root/check_icmp.c')
-rw-r--r--plugins-root/check_icmp.c48
1 files changed, 19 insertions, 29 deletions
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c
index 55405b8a..0c69d31c 100644
--- a/plugins-root/check_icmp.c
+++ b/plugins-root/check_icmp.c
@@ -2045,32 +2045,32 @@ unsigned short icmp_checksum(uint16_t *packet, size_t packet_size) {
2045} 2045}
2046 2046
2047void print_help(void) { 2047void print_help(void) {
2048 /*print_revision (progname);*/ /* FIXME: Why? */ 2048 // print_revision (progname); /* FIXME: Why? */
2049 printf("Copyright (c) 2005 Andreas Ericsson <ae@op5.se>\n"); 2049 printf("Copyright (c) 2005 Andreas Ericsson <ae@op5.se>\n");
2050 2050
2051 printf(COPYRIGHT, copyright, email); 2051 printf(COPYRIGHT, copyright, email);
2052 2052
2053 printf("\n\n");
2054
2055 print_usage(); 2053 print_usage();
2056 2054
2057 printf(UT_HELP_VRSN); 2055 printf(UT_HELP_VRSN);
2058 printf(UT_EXTRA_OPTS); 2056 printf(UT_EXTRA_OPTS);
2059 2057
2060 printf(" %s\n", "-H"); 2058 printf(" %s\n", "-H");
2061 printf(" %s\n", _("specify a target")); 2059 printf(" %s\n",
2060 _("specify a target, might be one of: resolveable name, IPv6 address, IPv4 address "
2061 "(necessary, can be given multiple times)"));
2062 printf(" %s\n", "[-4|-6]"); 2062 printf(" %s\n", "[-4|-6]");
2063 printf(" %s\n", _("Use IPv4 (default) or IPv6 to communicate with the targets")); 2063 printf(" %s\n", _("Use IPv4 or IPv6 only to communicate with the targets"));
2064 printf(" %s\n", "-w"); 2064 printf(" %s\n", "-w");
2065 printf(" %s", _("warning threshold (currently ")); 2065 printf(" %s", _("warning threshold (default "));
2066 printf("%0.3fms,%u%%)\n", (float)DEFAULT_WARN_RTA / 1000, DEFAULT_WARN_PL); 2066 printf("%0.3fms,%u%%)\n", (float)DEFAULT_WARN_RTA / 1000, DEFAULT_WARN_PL);
2067 printf(" %s\n", "-c"); 2067 printf(" %s\n", "-c");
2068 printf(" %s", _("critical threshold (currently ")); 2068 printf(" %s", _("critical threshold (default "));
2069 printf("%0.3fms,%u%%)\n", (float)DEFAULT_CRIT_RTA / 1000, DEFAULT_CRIT_PL); 2069 printf("%0.3fms,%u%%)\n", (float)DEFAULT_CRIT_RTA / 1000, DEFAULT_CRIT_PL);
2070 2070
2071 printf(" %s\n", "-R"); 2071 printf(" %s\n", "-R");
2072 printf(" %s\n", 2072 printf(" %s\n",
2073 _("RTA, round trip average, mode warning,critical, ex. 100ms,200ms unit in ms")); 2073 _("RTA (round trip average) mode warning,critical, ex. 100ms,200ms unit in ms"));
2074 printf(" %s\n", "-P"); 2074 printf(" %s\n", "-P");
2075 printf(" %s\n", _("packet loss mode, ex. 40%,50% , unit in %")); 2075 printf(" %s\n", _("packet loss mode, ex. 40%,50% , unit in %"));
2076 printf(" %s\n", "-J"); 2076 printf(" %s\n", "-J");
@@ -2080,42 +2080,34 @@ void print_help(void) {
2080 printf(" %s\n", "-S"); 2080 printf(" %s\n", "-S");
2081 printf(" %s\n", _("score mode, max value 100 warning,critical, ex. 80,70 ")); 2081 printf(" %s\n", _("score mode, max value 100 warning,critical, ex. 80,70 "));
2082 printf(" %s\n", "-O"); 2082 printf(" %s\n", "-O");
2083 printf(" %s\n", _("detect out of order ICMP packts ")); 2083 printf(" %s\n",
2084 printf(" %s\n", "-H"); 2084 _("detect out of order ICMP packts, if such packets are found, the result is CRITICAL"));
2085 printf(" %s\n", _("specify a target"));
2086 printf(" %s\n", "-s");
2087 printf(" %s\n", _("specify a source IP address or device name"));
2088 printf(" %s\n", "-n"); 2085 printf(" %s\n", "-n");
2089 printf(" %s", _("number of packets to send (currently "));
2090 printf("%u)\n", DEFAULT_NUMBER_OF_PACKETS);
2091 printf(" %s\n", "-p"); 2086 printf(" %s\n", "-p");
2092 printf(" %s", _("number of packets to send (currently ")); 2087 printf(" %s", _("number of packets to send (default "));
2093 printf("%u)\n", DEFAULT_NUMBER_OF_PACKETS); 2088 printf("%u)\n", DEFAULT_NUMBER_OF_PACKETS);
2094 printf(" %s\n", "-i"); 2089 printf(" %s\n", "-i");
2095 printf(" %s", _("max packet interval (currently ")); 2090 printf(" %s", _("max packet interval (default "));
2096 printf("%0.3fms)\n", (float)DEFAULT_PKT_INTERVAL / 1000); 2091 printf("%0.3fms)\n", (float)DEFAULT_PKT_INTERVAL / 1000);
2097 printf(" %s\n", "-I"); 2092 printf(" %s\n", "-I");
2098 printf(" %s", _("max target interval (currently ")); 2093 printf(" %s%0.3fms)\n The time intervall to wait in between one target and the next",
2099 printf("%0.3fms)\n", (float)DEFAULT_TARGET_INTERVAL / 1000); 2094 _("max target interval (default "), (float)DEFAULT_TARGET_INTERVAL / 1000);
2100 printf(" %s\n", "-m"); 2095 printf(" %s\n", "-m");
2101 printf(" %s", _("number of alive hosts required for success")); 2096 printf(" %s", _("number of alive hosts required for success"));
2102 printf("\n"); 2097 printf("\n");
2103 printf(" %s\n", "-l"); 2098 printf(" %s\n", "-l");
2104 printf(" %s", _("TTL on outgoing packets (currently ")); 2099 printf(" %s", _("TTL on outgoing packets (default "));
2105 printf("%u)\n", DEFAULT_TTL); 2100 printf("%u)\n", DEFAULT_TTL);
2106 printf(" %s\n", "-t");
2107 printf(" %s", _("timeout value (seconds, currently "));
2108 printf("%u)\n", DEFAULT_TIMEOUT);
2109 printf(" %s\n", "-b"); 2101 printf(" %s\n", "-b");
2110 printf(" %s\n", _("Number of icmp data bytes to send")); 2102 printf(" %s\n", _("Number of icmp data bytes to send"));
2111 printf(" %s %lu + %d)\n", _("Packet size will be data bytes + icmp header (currently"), 2103 printf(" %s %lu + %d)\n", _("Packet size will be data bytes + icmp header (default"),
2112 DEFAULT_PING_DATA_SIZE, ICMP_MINLEN); 2104 DEFAULT_PING_DATA_SIZE, ICMP_MINLEN);
2113 printf(" %s\n", "-v"); 2105 printf(" %s\n", "-v");
2114 printf(" %s\n", _("verbose")); 2106 printf(" %s\n", _("Verbosity, can be given multiple times (for debugging)"));
2115 printf("\n"); 2107 printf("\n");
2116 printf("%s\n", _("Notes:")); 2108 printf("%s\n", _("Notes:"));
2117 printf(" %s\n", _("If none of R,P,J,M,S or O is specified, default behavior is -R -P")); 2109 printf(" %s\n", _("If none of R,P,J,M,S or O is specified, default behavior is -R -P"));
2118 printf(" %s\n", _("The -H switch is optional. Naming a host (or several) to check is not.")); 2110 printf(" %s\n", _("Naming a host (or several) to check is not."));
2119 printf("\n"); 2111 printf("\n");
2120 printf(" %s\n", _("Threshold format for -w and -c is 200.25,60% for 200.25 msec RTA and 60%")); 2112 printf(" %s\n", _("Threshold format for -w and -c is 200.25,60% for 200.25 msec RTA and 60%"));
2121 printf(" %s\n", _("packet loss. The default values should work well for most users.")); 2113 printf(" %s\n", _("packet loss. The default values should work well for most users."));
@@ -2128,8 +2120,6 @@ void print_help(void) {
2128 hops")); printf ("%s\n", _("are spent and CRITICAL if >= 14 hops are spent.")); printf 2120 hops")); printf ("%s\n", _("are spent and CRITICAL if >= 14 hops are spent.")); printf
2129 ("%s\n\n", _("NOTE: Some systems decrease TTL when forming ICMP_ECHOREPLY, others do 2121 ("%s\n\n", _("NOTE: Some systems decrease TTL when forming ICMP_ECHOREPLY, others do
2130 not."));*/ 2122 not."));*/
2131 printf("\n");
2132 printf(" %s\n", _("The -v switch can be specified several times for increased verbosity."));
2133 /* printf ("%s\n", _("Long options are currently unsupported.")); 2123 /* printf ("%s\n", _("Long options are currently unsupported."));
2134 printf ("%s\n", _("Options marked with * require an argument")); 2124 printf ("%s\n", _("Options marked with * require an argument"));
2135 */ 2125 */
@@ -2139,7 +2129,7 @@ void print_help(void) {
2139 2129
2140void print_usage(void) { 2130void print_usage(void) {
2141 printf("%s\n", _("Usage:")); 2131 printf("%s\n", _("Usage:"));
2142 printf(" %s [options] [-H] host1 host2 hostN\n", progname); 2132 printf(" %s [options] [-H host1 [-H host2 [-H hostN]]]\n", progname);
2143} 2133}
2144 2134
2145static add_host_wrapper add_host(char *arg, check_icmp_execution_mode mode, 2135static add_host_wrapper add_host(char *arg, check_icmp_execution_mode mode,