summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 97634d8)
raw | patch | inline | side by side (parent: 97634d8)
author | Jeremy T. Bouse <undrgrid@users.sourceforge.net> | |
Mon, 30 Jun 2003 19:47:21 +0000 (19:47 +0000) | ||
committer | Jeremy T. Bouse <undrgrid@users.sourceforge.net> | |
Mon, 30 Jun 2003 19:47:21 +0000 (19:47 +0000) |
check_smtp
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@575 f882894a-f735-0410-b71e-b25c423dba1c
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@575 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_http.c | patch | blob | history | |
plugins/check_ldap.c | patch | blob | history | |
plugins/check_smtp.c | patch | blob | history |
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 468e4c22daf5e22e718639163e92a6a526f02b02..038ac68ad51c12dd0280e56fd1aed03d0031366d 100644 (file)
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
[-w <warn time>] [-c <critical time>] [-t <timeout>] [-L]\n\
[-a auth] [-f <ok | warn | critcal | follow>] [-e <expect>]\n\
[-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n\
- [-P string] [-m min_pg_size]"
+ [-P string] [-m min_pg_size] [-4|-6]"
#define LONGOPTIONS "\
-H, --hostname=ADDRESS\n\
Host name argument for servers using host headers (virtual host)\n\
-I, --IP-address=ADDRESS\n\
IP address or name (use numeric address if possible to bypass DNS lookup).\n\
+ -4, --use-ipv4\n\
+ Use IPv4 protocol\n\
+ -6, --use-ipv6\n\
+ Use IPv6 protocol\n\
-e, --expect=STRING\n\
String to expect in first (status) line of server response (default: %s)\n\
If specified skips all other status line logic (ex: 3xx, 4xx, 5xx processing)\n\
{"onredirect", required_argument, 0, 'f'},
{"certificate", required_argument, 0, 'C'},
{"min", required_argument, 0, 'm'},
+ {"use-ipv4", no_argument, 0, '4'},
+ {"use-ipv6", no_argument, 0, '6'},
{0, 0, 0, 0}
};
}
while (1) {
- c = getopt_long (argc, argv, "Vvht:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLSm:", long_options, &option_index);
+ c = getopt_long (argc, argv, "Vvh46t:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLSm:", long_options, &option_index);
if (c == -1 || c == EOF)
break;
}
break;
#endif
+ case '4':
+ address_family = AF_INET;
+ break;
+ case '6':
+#ifdef USE_IPV6
+ address_family = AF_INET6;
+#else
+ usage ("IPv6 support not available\n");
+#endif
+ break;
case 'v': /* verbose */
verbose = TRUE;
break;
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c
index 8eb895691e3cf89d7b3d3fd9152b53cb10810af6..af919f273e0702447ff1d4ecdfe7424854be6dde 100644 (file)
--- a/plugins/check_ldap.c
+++ b/plugins/check_ldap.c
{"ver2", no_argument, 0, '2'},
{"ver3", no_argument, 0, '3'},
#endif
+ {"use-ipv4", no_argument, 0, '4'},
+ {"use-ipv6", no_argument, 0, '6'},
{"port", required_argument, 0, 'p'},
{"warn", required_argument, 0, 'w'},
{"crit", required_argument, 0, 'c'},
}
while (1) {
- c = getopt_long (argc, argv, "hV23t:c:w:H:b:p:a:D:P:", longopts, &option_index);
+ c = getopt_long (argc, argv, "hV2346t:c:w:H:b:p:a:D:P:", longopts, &option_index);
if (c == -1 || c == EOF)
break;
ld_protocol = 3;
break;
#endif
+ case '4':
+ address_family = AF_INET;
+ break;
+ case '6':
+#ifdef USE_IPV6
+ address_family = AF_INET6;
+#else
+ usage ("IPv6 support not available\n");
+#endif
+ break;
default:
usage ("check_ldap: could not parse unknown arguments\n");
break;
}
}
- if (ld_host[0] == 0) {
- asprintf (&ld_host, "%s", argv[c]);
+ c = optind;
+ if (strlen(ld_host) == 0 && is_host(argv[c])) {
+ asprintf (&ld_host, "%s", argv[c++]);
+ }
+ if (strlen(ld_base) == 0 && argv[c]) {
+ asprintf (&ld_base, "%s", argv[c++]);
}
return validate_arguments ();
"\t-P [--pass] ... ldap password (if required)\n"
"\t-p [--port] ... ldap port (default: %d)\n"
#ifdef HAVE_LDAP_SET_OPTION
- "\t-2 [--ver2] ... use ldap porotocol version 2\n"
- "\t-3 [--ver3] ... use ldap porotocol version 3\n"
+ "\t-2 [--ver2] ... use ldap protocol version 2\n"
+ "\t-3 [--ver3] ... use ldap protocol version 3\n"
+ "\t-4 [--use-ipv4] ... use IPv4 protocol\n"
+ "\t-6 [--use-ipv6] ... use IPv6 protocol\n"
"\t\t(default protocol version: %d)\n"
#endif
"\t-w [--warn] ... time in secs. - if the exceeds <warn> the STATE_WARNING will be returned\n"
("Usage: %s -H <host> -b <base_dn> [-p <port>] [-a <attr>] [-D <binddn>]\n"
" [-P <password>] [-w <warn_time>] [-c <crit_time>] [-t timeout]\n"
#ifdef HAVE_LDAP_SET_OPTION
- " [-2|-3]\n"
+ " [-2|-3] [-4|-6]\n"
#endif
"(Note: all times are in seconds.)\n", progname);
}
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index dd9f19bcc39d85927b087508a1d3596b80b4b946..7562c4c67550fcd8794ac9cffb5fef624bf2345b 100644 (file)
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
const char *option_summary = "\
-H host [-p port] [-e expect] [-C command] [-f from addr]\n\
- [-w warn] [-c crit] [-t timeout] [-n] [-v]";
+ [-w warn] [-c crit] [-t timeout] [-n] [-v] [-4|-6]";
const char *options = "\
-H, --hostname=STRING or IPADDRESS\n\
Check server on the indicated host\n\
+ -4, --use-ipv4\n\
+ Use IPv4 protocol\n\
+ -6, --use-ipv6\n\
+ Use IPv6 protocol\n\
-p, --port=INTEGER\n\
Make connection on the indicated port (default: %d)\n\
-e, --expect=STRING\n\
{"nocommand", required_argument, 0, 'n'},
{"verbose", no_argument, 0, 'v'},
{"version", no_argument, 0, 'V'},
+ {"use-ipv4", no_argument, 0, '4'},
+ {"use-ipv6", no_argument, 0, '6'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
}
while (1) {
- c = getopt_long (argc, argv, "+hVvt:p:f:e:c:w:H:C:",
+ c = getopt_long (argc, argv, "+hVv46t:p:f:e:c:w:H:C:",
long_options, &option_index);
if (c == -1 || c == EOF)
usage ("Time interval must be a nonnegative integer\n");
}
break;
+ case '4':
+ address_family = AF_INET;
+ break;
+ case '6':
+#ifdef USE_IPV6
+ address_family = AF_INET6;
+#else
+ usage ("IPv6 support not available\n");
+#endif
+ break;
case 'V': /* version */
print_revision (progname, revision);
exit (STATE_OK);