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) } } - if (result == STATE_UNKNOWN) + if (result == STATE_UNKNOWN) { msg = (char *)_("No ANSWER SECTION found"); + result = STATE_CRITICAL; + } /* If we get anything on STDERR, at least set warning */ if(chld_err.buflen > 0) { @@ -295,7 +297,10 @@ process_arguments (int argc, char **argv) int validate_arguments (void) { - return OK; + if (query_address != NULL) + return OK; + else + return ERROR; } @@ -357,7 +362,7 @@ void print_usage (void) { printf (_("Usage:")); - printf ("%s -H <host> -l <query_address> [-p <server port>]\n", progname); + printf ("%s -l <query_address> [-H <host>] [-p <server port>]\n", progname); printf (" [-T <query type>] [-w <warning interval>] [-c <critical interval>]\n"); printf (" [-t <timeout>] [-a <expected answer address>] [-v]\n"); } |