diff options
Diffstat (limited to 'plugins/check_dns.c')
| -rw-r--r-- | plugins/check_dns.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/plugins/check_dns.c b/plugins/check_dns.c index ac6cfc38..31a953d7 100644 --- a/plugins/check_dns.c +++ b/plugins/check_dns.c | |||
| @@ -1,9 +1,9 @@ | |||
| 1 | /***************************************************************************** | 1 | /***************************************************************************** |
| 2 | * | 2 | * |
| 3 | * Nagios check_dns plugin | 3 | * Monitoring check_dns plugin |
| 4 | * | 4 | * |
| 5 | * License: GPL | 5 | * License: GPL |
| 6 | * Copyright (c) 2000-2008 Nagios Plugins Development Team | 6 | * Copyright (c) 2000-2008 Monitoring Plugins Development Team |
| 7 | * | 7 | * |
| 8 | * Description: | 8 | * Description: |
| 9 | * | 9 | * |
| @@ -31,7 +31,7 @@ | |||
| 31 | 31 | ||
| 32 | const char *progname = "check_dns"; | 32 | const char *progname = "check_dns"; |
| 33 | const char *copyright = "2000-2008"; | 33 | const char *copyright = "2000-2008"; |
| 34 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 34 | const char *email = "devel@monitoring-plugins.org"; |
| 35 | 35 | ||
| 36 | #include "common.h" | 36 | #include "common.h" |
| 37 | #include "utils.h" | 37 | #include "utils.h" |
| @@ -242,7 +242,23 @@ main (int argc, char **argv) | |||
| 242 | } | 242 | } |
| 243 | printf (ngettext("%.3f second response time", "%.3f seconds response time", elapsed_time), elapsed_time); | 243 | printf (ngettext("%.3f second response time", "%.3f seconds response time", elapsed_time), elapsed_time); |
| 244 | printf (_(". %s returns %s"), query_address, address); | 244 | printf (_(". %s returns %s"), query_address, address); |
| 245 | printf ("|%s\n", fperfdata ("time", elapsed_time, "s", FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0)); | 245 | if ((time_thresholds->warning != NULL) && (time_thresholds->critical != NULL)) { |
| 246 | printf ("|%s\n", fperfdata ("time", elapsed_time, "s", | ||
| 247 | TRUE, time_thresholds->warning->end, | ||
| 248 | TRUE, time_thresholds->critical->end, | ||
| 249 | TRUE, 0, FALSE, 0)); | ||
| 250 | } else if ((time_thresholds->warning == NULL) && (time_thresholds->critical != NULL)) { | ||
| 251 | printf ("|%s\n", fperfdata ("time", elapsed_time, "s", | ||
| 252 | FALSE, 0, | ||
| 253 | TRUE, time_thresholds->critical->end, | ||
| 254 | TRUE, 0, FALSE, 0)); | ||
| 255 | } else if ((time_thresholds->warning != NULL) && (time_thresholds->critical == NULL)) { | ||
| 256 | printf ("|%s\n", fperfdata ("time", elapsed_time, "s", | ||
| 257 | TRUE, time_thresholds->warning->end, | ||
| 258 | FALSE, 0, | ||
| 259 | TRUE, 0, FALSE, 0)); | ||
| 260 | } else | ||
| 261 | printf ("|%s\n", fperfdata ("time", elapsed_time, "s", FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0)); | ||
| 246 | } | 262 | } |
| 247 | else if (result == STATE_WARNING) | 263 | else if (result == STATE_WARNING) |
| 248 | printf (_("DNS WARNING - %s\n"), | 264 | printf (_("DNS WARNING - %s\n"), |
| @@ -474,7 +490,7 @@ print_help (void) | |||
| 474 | printf (" -c, --critical=seconds\n"); | 490 | printf (" -c, --critical=seconds\n"); |
| 475 | printf (" %s\n", _("Return critical if elapsed time exceeds value. Default off")); | 491 | printf (" %s\n", _("Return critical if elapsed time exceeds value. Default off")); |
| 476 | 492 | ||
| 477 | printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); | 493 | printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); |
| 478 | 494 | ||
| 479 | printf (UT_SUPPORT); | 495 | printf (UT_SUPPORT); |
| 480 | } | 496 | } |
