diff options
Diffstat (limited to 'plugins/check_dns.c')
-rw-r--r-- | plugins/check_dns.c | 133 |
1 files changed, 88 insertions, 45 deletions
diff --git a/plugins/check_dns.c b/plugins/check_dns.c index 95f33083..56f91dae 100644 --- a/plugins/check_dns.c +++ b/plugins/check_dns.c | |||
@@ -48,7 +48,8 @@ typedef struct { | |||
48 | } check_dns_config_wrapper; | 48 | } check_dns_config_wrapper; |
49 | static check_dns_config_wrapper process_arguments(int /*argc*/, char ** /*argv*/); | 49 | static check_dns_config_wrapper process_arguments(int /*argc*/, char ** /*argv*/); |
50 | static check_dns_config_wrapper validate_arguments(check_dns_config_wrapper /*config_wrapper*/); | 50 | static check_dns_config_wrapper validate_arguments(check_dns_config_wrapper /*config_wrapper*/); |
51 | static mp_state_enum error_scan(char * /*input_buffer*/, bool * /*is_nxdomain*/, const char /*dns_server*/[ADDRESS_LENGTH]); | 51 | static mp_state_enum error_scan(char * /*input_buffer*/, bool * /*is_nxdomain*/, |
52 | const char /*dns_server*/[ADDRESS_LENGTH]); | ||
52 | static bool ip_match_cidr(const char * /*addr*/, const char * /*cidr_ro*/); | 53 | static bool ip_match_cidr(const char * /*addr*/, const char * /*cidr_ro*/); |
53 | static unsigned long ip2long(const char * /*src*/); | 54 | static unsigned long ip2long(const char * /*src*/); |
54 | static void print_help(void); | 55 | static void print_help(void); |
@@ -127,7 +128,8 @@ int main(int argc, char **argv) { | |||
127 | puts(chld_out.line[i]); | 128 | puts(chld_out.line[i]); |
128 | } | 129 | } |
129 | 130 | ||
130 | if (strcasestr(chld_out.line[i], ".in-addr.arpa") || strcasestr(chld_out.line[i], ".ip6.arpa")) { | 131 | if (strcasestr(chld_out.line[i], ".in-addr.arpa") || |
132 | strcasestr(chld_out.line[i], ".ip6.arpa")) { | ||
131 | if ((strstr(chld_out.line[i], "canonical name = ") != NULL)) { | 133 | if ((strstr(chld_out.line[i], "canonical name = ") != NULL)) { |
132 | continue; | 134 | continue; |
133 | } | 135 | } |
@@ -145,7 +147,8 @@ int main(int argc, char **argv) { | |||
145 | if (strstr(chld_out.line[i], "Server:") && strlen(config.dns_server) > 0) { | 147 | if (strstr(chld_out.line[i], "Server:") && strlen(config.dns_server) > 0) { |
146 | char *temp_buffer = strchr(chld_out.line[i], ':'); | 148 | char *temp_buffer = strchr(chld_out.line[i], ':'); |
147 | if (temp_buffer == NULL) { | 149 | if (temp_buffer == NULL) { |
148 | die(STATE_UNKNOWN, _("'%s' returned a weirdly formatted Server line\n"), NSLOOKUP_COMMAND); | 150 | die(STATE_UNKNOWN, _("'%s' returned a weirdly formatted Server line\n"), |
151 | NSLOOKUP_COMMAND); | ||
149 | } | 152 | } |
150 | 153 | ||
151 | temp_buffer++; | 154 | temp_buffer++; |
@@ -157,21 +160,25 @@ int main(int argc, char **argv) { | |||
157 | 160 | ||
158 | strip(temp_buffer); | 161 | strip(temp_buffer); |
159 | if (strlen(temp_buffer) == 0) { | 162 | if (strlen(temp_buffer) == 0) { |
160 | die(STATE_CRITICAL, _("DNS CRITICAL - '%s' returned empty server string\n"), NSLOOKUP_COMMAND); | 163 | die(STATE_CRITICAL, _("DNS CRITICAL - '%s' returned empty server string\n"), |
164 | NSLOOKUP_COMMAND); | ||
161 | } | 165 | } |
162 | 166 | ||
163 | if (strcmp(temp_buffer, config.dns_server) != 0) { | 167 | if (strcmp(temp_buffer, config.dns_server) != 0) { |
164 | die(STATE_CRITICAL, _("DNS CRITICAL - No response from DNS %s\n"), config.dns_server); | 168 | die(STATE_CRITICAL, _("DNS CRITICAL - No response from DNS %s\n"), |
169 | config.dns_server); | ||
165 | } | 170 | } |
166 | } | 171 | } |
167 | 172 | ||
168 | /* the server is responding, we just got the host name... */ | 173 | /* the server is responding, we just got the host name... */ |
169 | if (strstr(chld_out.line[i], "Name:")) { | 174 | if (strstr(chld_out.line[i], "Name:")) { |
170 | parse_address = true; | 175 | parse_address = true; |
171 | } else if (parse_address && (strstr(chld_out.line[i], "Address:") || strstr(chld_out.line[i], "Addresses:"))) { | 176 | } else if (parse_address && (strstr(chld_out.line[i], "Address:") || |
177 | strstr(chld_out.line[i], "Addresses:"))) { | ||
172 | char *temp_buffer = strchr(chld_out.line[i], ':'); | 178 | char *temp_buffer = strchr(chld_out.line[i], ':'); |
173 | if (temp_buffer == NULL) { | 179 | if (temp_buffer == NULL) { |
174 | die(STATE_UNKNOWN, _("'%s' returned a weirdly formatted Address line\n"), NSLOOKUP_COMMAND); | 180 | die(STATE_UNKNOWN, _("'%s' returned a weirdly formatted Address line\n"), |
181 | NSLOOKUP_COMMAND); | ||
175 | } | 182 | } |
176 | 183 | ||
177 | temp_buffer++; | 184 | temp_buffer++; |
@@ -183,7 +190,8 @@ int main(int argc, char **argv) { | |||
183 | 190 | ||
184 | strip(temp_buffer); | 191 | strip(temp_buffer); |
185 | if (strlen(temp_buffer) == 0) { | 192 | if (strlen(temp_buffer) == 0) { |
186 | die(STATE_CRITICAL, _("DNS CRITICAL - '%s' returned empty host name string\n"), NSLOOKUP_COMMAND); | 193 | die(STATE_CRITICAL, _("DNS CRITICAL - '%s' returned empty host name string\n"), |
194 | NSLOOKUP_COMMAND); | ||
187 | } | 195 | } |
188 | 196 | ||
189 | addresses[n_addresses++] = strdup(temp_buffer); | 197 | addresses[n_addresses++] = strdup(temp_buffer); |
@@ -209,7 +217,8 @@ int main(int argc, char **argv) { | |||
209 | } | 217 | } |
210 | 218 | ||
211 | if (error_scan(chld_err.line[i], &is_nxdomain, config.dns_server) != STATE_OK) { | 219 | if (error_scan(chld_err.line[i], &is_nxdomain, config.dns_server) != STATE_OK) { |
212 | result = max_state(result, error_scan(chld_err.line[i], &is_nxdomain, config.dns_server)); | 220 | result = |
221 | max_state(result, error_scan(chld_err.line[i], &is_nxdomain, config.dns_server)); | ||
213 | msg = strchr(input_buffer, ':'); | 222 | msg = strchr(input_buffer, ':'); |
214 | if (msg) { | 223 | if (msg) { |
215 | msg++; | 224 | msg++; |
@@ -242,7 +251,8 @@ int main(int argc, char **argv) { | |||
242 | } | 251 | } |
243 | *adrp = 0; | 252 | *adrp = 0; |
244 | } else { | 253 | } else { |
245 | die(STATE_CRITICAL, _("DNS CRITICAL - '%s' msg parsing exited with no address\n"), NSLOOKUP_COMMAND); | 254 | die(STATE_CRITICAL, _("DNS CRITICAL - '%s' msg parsing exited with no address\n"), |
255 | NSLOOKUP_COMMAND); | ||
246 | } | 256 | } |
247 | 257 | ||
248 | /* compare to expected address */ | 258 | /* compare to expected address */ |
@@ -255,7 +265,8 @@ int main(int argc, char **argv) { | |||
255 | for (size_t i = 0; i < config.expected_address_cnt; i++) { | 265 | for (size_t i = 0; i < config.expected_address_cnt; i++) { |
256 | /* check if we get a match on 'raw' ip or cidr */ | 266 | /* check if we get a match on 'raw' ip or cidr */ |
257 | for (size_t j = 0; j < n_addresses; j++) { | 267 | for (size_t j = 0; j < n_addresses; j++) { |
258 | if (strcmp(addresses[j], config.expected_address[i]) == 0 || ip_match_cidr(addresses[j], config.expected_address[i])) { | 268 | if (strcmp(addresses[j], config.expected_address[i]) == 0 || |
269 | ip_match_cidr(addresses[j], config.expected_address[i])) { | ||
259 | result = STATE_OK; | 270 | result = STATE_OK; |
260 | addr_match &= ~(1 << j); | 271 | addr_match &= ~(1 << j); |
261 | expect_match &= ~(1 << i); | 272 | expect_match &= ~(1 << i); |
@@ -279,7 +290,8 @@ int main(int argc, char **argv) { | |||
279 | if (config.expect_nxdomain) { | 290 | if (config.expect_nxdomain) { |
280 | if (!is_nxdomain) { | 291 | if (!is_nxdomain) { |
281 | result = STATE_CRITICAL; | 292 | result = STATE_CRITICAL; |
282 | xasprintf(&msg, _("Domain '%s' was found by the server: '%s'\n"), config.query_address, address); | 293 | xasprintf(&msg, _("Domain '%s' was found by the server: '%s'\n"), config.query_address, |
294 | address); | ||
283 | } else { | 295 | } else { |
284 | if (address != NULL) { | 296 | if (address != NULL) { |
285 | free(address); | 297 | free(address); |
@@ -291,7 +303,8 @@ int main(int argc, char **argv) { | |||
291 | /* check if authoritative */ | 303 | /* check if authoritative */ |
292 | if (result == STATE_OK && config.expect_authority && non_authoritative) { | 304 | if (result == STATE_OK && config.expect_authority && non_authoritative) { |
293 | result = STATE_CRITICAL; | 305 | result = STATE_CRITICAL; |
294 | xasprintf(&msg, _("server %s is not authoritative for %s"), config.dns_server, config.query_address); | 306 | xasprintf(&msg, _("server %s is not authoritative for %s"), config.dns_server, |
307 | config.query_address); | ||
295 | } | 308 | } |
296 | 309 | ||
297 | long microsec = deltime(tv); | 310 | long microsec = deltime(tv); |
@@ -306,24 +319,36 @@ int main(int argc, char **argv) { | |||
306 | } else if (result == STATE_CRITICAL) { | 319 | } else if (result == STATE_CRITICAL) { |
307 | printf("DNS %s: ", _("CRITICAL")); | 320 | printf("DNS %s: ", _("CRITICAL")); |
308 | } | 321 | } |
309 | printf(ngettext("%.3f second response time", "%.3f seconds response time", elapsed_time), elapsed_time); | 322 | printf(ngettext("%.3f second response time", "%.3f seconds response time", elapsed_time), |
323 | elapsed_time); | ||
310 | printf(_(". %s returns %s"), config.query_address, address); | 324 | printf(_(". %s returns %s"), config.query_address, address); |
311 | if ((config.time_thresholds->warning != NULL) && (config.time_thresholds->critical != NULL)) { | 325 | if ((config.time_thresholds->warning != NULL) && |
312 | printf("|%s\n", fperfdata("time", elapsed_time, "s", true, config.time_thresholds->warning->end, true, | 326 | (config.time_thresholds->critical != NULL)) { |
327 | printf("|%s\n", | ||
328 | fperfdata("time", elapsed_time, "s", true, config.time_thresholds->warning->end, | ||
329 | true, config.time_thresholds->critical->end, true, 0, false, 0)); | ||
330 | } else if ((config.time_thresholds->warning == NULL) && | ||
331 | (config.time_thresholds->critical != NULL)) { | ||
332 | printf("|%s\n", fperfdata("time", elapsed_time, "s", false, 0, true, | ||
313 | config.time_thresholds->critical->end, true, 0, false, 0)); | 333 | config.time_thresholds->critical->end, true, 0, false, 0)); |
314 | } else if ((config.time_thresholds->warning == NULL) && (config.time_thresholds->critical != NULL)) { | 334 | } else if ((config.time_thresholds->warning != NULL) && |
315 | printf("|%s\n", fperfdata("time", elapsed_time, "s", false, 0, true, config.time_thresholds->critical->end, true, 0, false, 0)); | 335 | (config.time_thresholds->critical == NULL)) { |
316 | } else if ((config.time_thresholds->warning != NULL) && (config.time_thresholds->critical == NULL)) { | 336 | printf("|%s\n", |
317 | printf("|%s\n", fperfdata("time", elapsed_time, "s", true, config.time_thresholds->warning->end, false, 0, true, 0, false, 0)); | 337 | fperfdata("time", elapsed_time, "s", true, config.time_thresholds->warning->end, |
338 | false, 0, true, 0, false, 0)); | ||
318 | } else { | 339 | } else { |
319 | printf("|%s\n", fperfdata("time", elapsed_time, "s", false, 0, false, 0, true, 0, false, 0)); | 340 | printf("|%s\n", |
341 | fperfdata("time", elapsed_time, "s", false, 0, false, 0, true, 0, false, 0)); | ||
320 | } | 342 | } |
321 | } else if (result == STATE_WARNING) { | 343 | } else if (result == STATE_WARNING) { |
322 | printf(_("DNS WARNING - %s\n"), !strcmp(msg, "") ? _(" Probably a non-existent host/domain") : msg); | 344 | printf(_("DNS WARNING - %s\n"), |
345 | !strcmp(msg, "") ? _(" Probably a non-existent host/domain") : msg); | ||
323 | } else if (result == STATE_CRITICAL) { | 346 | } else if (result == STATE_CRITICAL) { |
324 | printf(_("DNS CRITICAL - %s\n"), !strcmp(msg, "") ? _(" Probably a non-existent host/domain") : msg); | 347 | printf(_("DNS CRITICAL - %s\n"), |
348 | !strcmp(msg, "") ? _(" Probably a non-existent host/domain") : msg); | ||
325 | } else { | 349 | } else { |
326 | printf(_("DNS UNKNOWN - %s\n"), !strcmp(msg, "") ? _(" Probably a non-existent host/domain") : msg); | 350 | printf(_("DNS UNKNOWN - %s\n"), |
351 | !strcmp(msg, "") ? _(" Probably a non-existent host/domain") : msg); | ||
327 | } | 352 | } |
328 | 353 | ||
329 | exit(result); | 354 | exit(result); |
@@ -342,29 +367,34 @@ bool ip_match_cidr(const char *addr, const char *cidr_ro) { | |||
342 | mask = atoi(mask_c); | 367 | mask = atoi(mask_c); |
343 | 368 | ||
344 | /* https://www.cryptobells.com/verifying-ips-in-a-subnet-in-php/ */ | 369 | /* https://www.cryptobells.com/verifying-ips-in-a-subnet-in-php/ */ |
345 | return (ip2long(addr) & ~((1 << (32 - mask)) - 1)) == (ip2long(subnet) >> (32 - mask)) << (32 - mask); | 370 | return (ip2long(addr) & ~((1 << (32 - mask)) - 1)) == (ip2long(subnet) >> (32 - mask)) |
371 | << (32 - mask); | ||
346 | } | 372 | } |
347 | 373 | ||
348 | unsigned long ip2long(const char *src) { | 374 | unsigned long ip2long(const char *src) { |
349 | unsigned long ip[4]; | 375 | unsigned long ip[4]; |
350 | /* http://computer-programming-forum.com/47-c-language/1376ffb92a12c471.htm */ | 376 | /* http://computer-programming-forum.com/47-c-language/1376ffb92a12c471.htm */ |
351 | return (sscanf(src, "%3lu.%3lu.%3lu.%3lu", &ip[0], &ip[1], &ip[2], &ip[3]) == 4 && ip[0] < 256 && ip[1] < 256 && ip[2] < 256 && | 377 | return (sscanf(src, "%3lu.%3lu.%3lu.%3lu", &ip[0], &ip[1], &ip[2], &ip[3]) == 4 && |
352 | ip[3] < 256) | 378 | ip[0] < 256 && ip[1] < 256 && ip[2] < 256 && ip[3] < 256) |
353 | ? ip[0] << 24 | ip[1] << 16 | ip[2] << 8 | ip[3] | 379 | ? ip[0] << 24 | ip[1] << 16 | ip[2] << 8 | ip[3] |
354 | : 0; | 380 | : 0; |
355 | } | 381 | } |
356 | 382 | ||
357 | mp_state_enum error_scan(char *input_buffer, bool *is_nxdomain, const char dns_server[ADDRESS_LENGTH]) { | 383 | mp_state_enum error_scan(char *input_buffer, bool *is_nxdomain, |
384 | const char dns_server[ADDRESS_LENGTH]) { | ||
358 | 385 | ||
359 | const int nxdomain = strstr(input_buffer, "Non-existent") || strstr(input_buffer, "** server can't find") || | 386 | const int nxdomain = strstr(input_buffer, "Non-existent") || |
387 | strstr(input_buffer, "** server can't find") || | ||
360 | strstr(input_buffer, "** Can't find") || strstr(input_buffer, "NXDOMAIN"); | 388 | strstr(input_buffer, "** Can't find") || strstr(input_buffer, "NXDOMAIN"); |
361 | if (nxdomain) { | 389 | if (nxdomain) { |
362 | *is_nxdomain = true; | 390 | *is_nxdomain = true; |
363 | } | 391 | } |
364 | 392 | ||
365 | /* the DNS lookup timed out */ | 393 | /* the DNS lookup timed out */ |
366 | if (strstr(input_buffer, _("Note: nslookup is deprecated and may be removed from future releases.")) || | 394 | if (strstr(input_buffer, |
367 | strstr(input_buffer, _("Consider using the `dig' or `host' programs instead. Run nslookup with")) || | 395 | _("Note: nslookup is deprecated and may be removed from future releases.")) || |
396 | strstr(input_buffer, | ||
397 | _("Consider using the `dig' or `host' programs instead. Run nslookup with")) || | ||
368 | strstr(input_buffer, _("the `-sil[ent]' option to prevent this message from appearing."))) { | 398 | strstr(input_buffer, _("the `-sil[ent]' option to prevent this message from appearing."))) { |
369 | return STATE_OK; | 399 | return STATE_OK; |
370 | } | 400 | } |
@@ -382,8 +412,9 @@ mp_state_enum error_scan(char *input_buffer, bool *is_nxdomain, const char dns_s | |||
382 | } | 412 | } |
383 | 413 | ||
384 | /* Connection was refused */ | 414 | /* Connection was refused */ |
385 | else if (strstr(input_buffer, "Connection refused") || strstr(input_buffer, "Couldn't find server") || | 415 | else if (strstr(input_buffer, "Connection refused") || |
386 | strstr(input_buffer, "Refused") || (strstr(input_buffer, "** server can't find") && strstr(input_buffer, ": REFUSED"))) { | 416 | strstr(input_buffer, "Couldn't find server") || strstr(input_buffer, "Refused") || |
417 | (strstr(input_buffer, "** server can't find") && strstr(input_buffer, ": REFUSED"))) { | ||
387 | die(STATE_CRITICAL, _("Connection to DNS %s was refused\n"), dns_server); | 418 | die(STATE_CRITICAL, _("Connection to DNS %s was refused\n"), dns_server); |
388 | } | 419 | } |
389 | 420 | ||
@@ -504,20 +535,24 @@ check_dns_config_wrapper process_arguments(int argc, char **argv) { | |||
504 | if (strchr(optarg, ',') != NULL) { | 535 | if (strchr(optarg, ',') != NULL) { |
505 | char *comma = strchr(optarg, ','); | 536 | char *comma = strchr(optarg, ','); |
506 | while (comma != NULL) { | 537 | while (comma != NULL) { |
507 | result.config.expected_address = | 538 | result.config.expected_address = (char **)realloc( |
508 | (char **)realloc(result.config.expected_address, (result.config.expected_address_cnt + 1) * sizeof(char **)); | 539 | result.config.expected_address, |
509 | result.config.expected_address[result.config.expected_address_cnt] = strndup(optarg, comma - optarg); | 540 | (result.config.expected_address_cnt + 1) * sizeof(char **)); |
541 | result.config.expected_address[result.config.expected_address_cnt] = | ||
542 | strndup(optarg, comma - optarg); | ||
510 | result.config.expected_address_cnt++; | 543 | result.config.expected_address_cnt++; |
511 | optarg = comma + 1; | 544 | optarg = comma + 1; |
512 | comma = strchr(optarg, ','); | 545 | comma = strchr(optarg, ','); |
513 | } | 546 | } |
514 | result.config.expected_address = | 547 | result.config.expected_address = |
515 | (char **)realloc(result.config.expected_address, (result.config.expected_address_cnt + 1) * sizeof(char **)); | 548 | (char **)realloc(result.config.expected_address, |
549 | (result.config.expected_address_cnt + 1) * sizeof(char **)); | ||
516 | result.config.expected_address[result.config.expected_address_cnt] = strdup(optarg); | 550 | result.config.expected_address[result.config.expected_address_cnt] = strdup(optarg); |
517 | result.config.expected_address_cnt++; | 551 | result.config.expected_address_cnt++; |
518 | } else { | 552 | } else { |
519 | result.config.expected_address = | 553 | result.config.expected_address = |
520 | (char **)realloc(result.config.expected_address, (result.config.expected_address_cnt + 1) * sizeof(char **)); | 554 | (char **)realloc(result.config.expected_address, |
555 | (result.config.expected_address_cnt + 1) * sizeof(char **)); | ||
521 | result.config.expected_address[result.config.expected_address_cnt] = strdup(optarg); | 556 | result.config.expected_address[result.config.expected_address_cnt] = strdup(optarg); |
522 | result.config.expected_address_cnt++; | 557 | result.config.expected_address_cnt++; |
523 | } | 558 | } |
@@ -586,9 +621,11 @@ void print_help(void) { | |||
586 | printf("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"); | 621 | printf("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"); |
587 | printf(COPYRIGHT, copyright, email); | 622 | printf(COPYRIGHT, copyright, email); |
588 | 623 | ||
589 | printf("%s\n", _("This plugin uses the nslookup program to obtain the IP address for the given host/domain query.")); | 624 | printf("%s\n", _("This plugin uses the nslookup program to obtain the IP address for the given " |
625 | "host/domain query.")); | ||
590 | printf("%s\n", _("An optional DNS server to use may be specified.")); | 626 | printf("%s\n", _("An optional DNS server to use may be specified.")); |
591 | printf("%s\n", _("If no DNS server is specified, the default server(s) specified in /etc/resolv.conf will be used.")); | 627 | printf("%s\n", _("If no DNS server is specified, the default server(s) specified in " |
628 | "/etc/resolv.conf will be used.")); | ||
592 | 629 | ||
593 | printf("\n\n"); | 630 | printf("\n\n"); |
594 | 631 | ||
@@ -602,11 +639,14 @@ void print_help(void) { | |||
602 | printf(" -s, --server=HOST\n"); | 639 | printf(" -s, --server=HOST\n"); |
603 | printf(" %s\n", _("Optional DNS server you want to use for the lookup")); | 640 | printf(" %s\n", _("Optional DNS server you want to use for the lookup")); |
604 | printf(" -a, --expected-address=IP-ADDRESS|CIDR|HOST\n"); | 641 | printf(" -a, --expected-address=IP-ADDRESS|CIDR|HOST\n"); |
605 | printf(" %s\n", _("Optional IP-ADDRESS/CIDR you expect the DNS server to return. HOST must end")); | 642 | printf(" %s\n", |
606 | printf(" %s\n", _("with a dot (.). This option can be repeated multiple times (Returns OK if any")); | 643 | _("Optional IP-ADDRESS/CIDR you expect the DNS server to return. HOST must end")); |
644 | printf(" %s\n", | ||
645 | _("with a dot (.). This option can be repeated multiple times (Returns OK if any")); | ||
607 | printf(" %s\n", _("value matches).")); | 646 | printf(" %s\n", _("value matches).")); |
608 | printf(" -n, --expect-nxdomain\n"); | 647 | printf(" -n, --expect-nxdomain\n"); |
609 | printf(" %s\n", _("Expect the DNS server to return NXDOMAIN (i.e. the domain was not found)")); | 648 | printf(" %s\n", |
649 | _("Expect the DNS server to return NXDOMAIN (i.e. the domain was not found)")); | ||
610 | printf(" %s\n", _("Cannot be used together with -a")); | 650 | printf(" %s\n", _("Cannot be used together with -a")); |
611 | printf(" -A, --expect-authority\n"); | 651 | printf(" -A, --expect-authority\n"); |
612 | printf(" %s\n", _("Optionally expect the DNS server to be authoritative for the lookup")); | 652 | printf(" %s\n", _("Optionally expect the DNS server to be authoritative for the lookup")); |
@@ -615,7 +655,8 @@ void print_help(void) { | |||
615 | printf(" -c, --critical=seconds\n"); | 655 | printf(" -c, --critical=seconds\n"); |
616 | printf(" %s\n", _("Return critical if elapsed time exceeds value. Default off")); | 656 | printf(" %s\n", _("Return critical if elapsed time exceeds value. Default off")); |
617 | printf(" -L, --all\n"); | 657 | printf(" -L, --all\n"); |
618 | printf(" %s\n", _("Return critical if the list of expected addresses does not match all addresses")); | 658 | printf(" %s\n", |
659 | _("Return critical if the list of expected addresses does not match all addresses")); | ||
619 | printf(" %s\n", _("returned. Default off")); | 660 | printf(" %s\n", _("returned. Default off")); |
620 | 661 | ||
621 | printf(UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); | 662 | printf(UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); |
@@ -625,5 +666,7 @@ void print_help(void) { | |||
625 | 666 | ||
626 | void print_usage(void) { | 667 | void print_usage(void) { |
627 | printf("%s\n", _("Usage:")); | 668 | printf("%s\n", _("Usage:")); |
628 | printf("%s -H host [-s server] [-a expected-address] [-n] [-A] [-t timeout] [-w warn] [-c crit] [-L]\n", progname); | 669 | printf("%s -H host [-s server] [-a expected-address] [-n] [-A] [-t timeout] [-w warn] [-c " |
670 | "crit] [-L]\n", | ||
671 | progname); | ||
629 | } | 672 | } |