diff options
author | Matthias Eble <psychotrahe@users.sourceforge.net> | 2008-06-09 19:47:36 +0000 |
---|---|---|
committer | Matthias Eble <psychotrahe@users.sourceforge.net> | 2008-06-09 19:47:36 +0000 |
commit | d8577e19942b4885ac642513540fc1791a0fa38b (patch) | |
tree | e31b28007cee8baf4c76ed5a3eb2312d0a6fdac8 /plugins/check_dig.c | |
parent | 5c3d4aea27de408cb7b04f5aab83558efbf841f4 (diff) | |
download | monitoring-plugins-d8577e19942b4885ac642513540fc1791a0fa38b.tar.gz |
Added testcases for check_dig
check_dig's -l option is mandatory now (#1986306)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2011 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_dig.c')
-rw-r--r-- | plugins/check_dig.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/check_dig.c b/plugins/check_dig.c index e3f7adbd..34197ecc 100644 --- a/plugins/check_dig.c +++ b/plugins/check_dig.c | |||
@@ -143,8 +143,10 @@ main (int argc, char **argv) | |||
143 | } | 143 | } |
144 | } | 144 | } |
145 | 145 | ||
146 | if (result == STATE_UNKNOWN) | 146 | if (result == STATE_UNKNOWN) { |
147 | msg = (char *)_("No ANSWER SECTION found"); | 147 | msg = (char *)_("No ANSWER SECTION found"); |
148 | result = STATE_CRITICAL; | ||
149 | } | ||
148 | 150 | ||
149 | /* If we get anything on STDERR, at least set warning */ | 151 | /* If we get anything on STDERR, at least set warning */ |
150 | if(chld_err.buflen > 0) { | 152 | if(chld_err.buflen > 0) { |
@@ -295,7 +297,10 @@ process_arguments (int argc, char **argv) | |||
295 | int | 297 | int |
296 | validate_arguments (void) | 298 | validate_arguments (void) |
297 | { | 299 | { |
298 | return OK; | 300 | if (query_address != NULL) |
301 | return OK; | ||
302 | else | ||
303 | return ERROR; | ||
299 | } | 304 | } |
300 | 305 | ||
301 | 306 | ||
@@ -357,7 +362,7 @@ void | |||
357 | print_usage (void) | 362 | print_usage (void) |
358 | { | 363 | { |
359 | printf (_("Usage:")); | 364 | printf (_("Usage:")); |
360 | printf ("%s -H <host> -l <query_address> [-p <server port>]\n", progname); | 365 | printf ("%s -l <query_address> [-H <host>] [-p <server port>]\n", progname); |
361 | printf (" [-T <query type>] [-w <warning interval>] [-c <critical interval>]\n"); | 366 | printf (" [-T <query type>] [-w <warning interval>] [-c <critical interval>]\n"); |
362 | printf (" [-t <timeout>] [-a <expected answer address>] [-v]\n"); | 367 | printf (" [-t <timeout>] [-a <expected answer address>] [-v]\n"); |
363 | } | 368 | } |