diff options
Diffstat (limited to 'plugins/check_dig.c')
-rw-r--r-- | plugins/check_dig.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/plugins/check_dig.c b/plugins/check_dig.c index d0903be2..c27e5f13 100644 --- a/plugins/check_dig.c +++ b/plugins/check_dig.c | |||
@@ -81,8 +81,9 @@ int main(int argc, char **argv) { | |||
81 | 81 | ||
82 | char *command_line; | 82 | char *command_line; |
83 | /* get the command to run */ | 83 | /* get the command to run */ |
84 | xasprintf(&command_line, "%s %s %s -p %d @%s %s %s +retry=%d +time=%d", PATH_TO_DIG, config.dig_args, config.query_transport, | 84 | xasprintf(&command_line, "%s %s %s -p %d @%s %s %s +retry=%d +time=%d", PATH_TO_DIG, |
85 | config.server_port, config.dns_server, config.query_address, config.record_type, config.number_tries, timeout_interval_dig); | 85 | config.dig_args, config.query_transport, config.server_port, config.dns_server, |
86 | config.query_address, config.record_type, config.number_tries, timeout_interval_dig); | ||
86 | 87 | ||
87 | alarm(timeout_interval); | 88 | alarm(timeout_interval); |
88 | struct timeval start_time; | 89 | struct timeval start_time; |
@@ -118,8 +119,9 @@ int main(int argc, char **argv) { | |||
118 | printf("%s\n", chld_out.line[i]); | 119 | printf("%s\n", chld_out.line[i]); |
119 | } | 120 | } |
120 | 121 | ||
121 | if (strcasestr(chld_out.line[i], (config.expected_address == NULL ? config.query_address : config.expected_address)) != | 122 | if (strcasestr(chld_out.line[i], (config.expected_address == NULL |
122 | NULL) { | 123 | ? config.query_address |
124 | : config.expected_address)) != NULL) { | ||
123 | msg = chld_out.line[i]; | 125 | msg = chld_out.line[i]; |
124 | result = STATE_OK; | 126 | result = STATE_OK; |
125 | 127 | ||
@@ -174,8 +176,9 @@ int main(int argc, char **argv) { | |||
174 | 176 | ||
175 | printf("DNS %s - %.3f seconds response time (%s)|%s\n", state_text(result), elapsed_time, | 177 | printf("DNS %s - %.3f seconds response time (%s)|%s\n", state_text(result), elapsed_time, |
176 | msg ? msg : _("Probably a non-existent host/domain"), | 178 | msg ? msg : _("Probably a non-existent host/domain"), |
177 | fperfdata("time", elapsed_time, "s", (config.warning_interval > UNDEFINED), config.warning_interval, | 179 | fperfdata("time", elapsed_time, "s", (config.warning_interval > UNDEFINED), |
178 | (config.critical_interval > UNDEFINED), config.critical_interval, true, 0, false, 0)); | 180 | config.warning_interval, (config.critical_interval > UNDEFINED), |
181 | config.critical_interval, true, 0, false, 0)); | ||
179 | exit(result); | 182 | exit(result); |
180 | } | 183 | } |
181 | 184 | ||
@@ -335,7 +338,8 @@ void print_help(void) { | |||
335 | printf(" %s\n", "-T, --record_type=STRING"); | 338 | printf(" %s\n", "-T, --record_type=STRING"); |
336 | printf(" %s\n", _("Record type to lookup (default: A)")); | 339 | printf(" %s\n", _("Record type to lookup (default: A)")); |
337 | printf(" %s\n", "-a, --expected_address=STRING"); | 340 | printf(" %s\n", "-a, --expected_address=STRING"); |
338 | printf(" %s\n", _("An address expected to be in the answer section. If not set, uses whatever")); | 341 | printf(" %s\n", |
342 | _("An address expected to be in the answer section. If not set, uses whatever")); | ||
339 | printf(" %s\n", _("was in -l")); | 343 | printf(" %s\n", _("was in -l")); |
340 | printf(" %s\n", "-A, --dig-arguments=STRING"); | 344 | printf(" %s\n", "-A, --dig-arguments=STRING"); |
341 | printf(" %s\n", _("Pass STRING as argument(s) to dig")); | 345 | printf(" %s\n", _("Pass STRING as argument(s) to dig")); |