aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_smtp.c
diff options
context:
space:
mode:
authorGravatar Jeremy T. Bouse <undrgrid@users.sourceforge.net> 2003-06-30 19:47:21 +0000
committerGravatar Jeremy T. Bouse <undrgrid@users.sourceforge.net> 2003-06-30 19:47:21 +0000
commitf813c747a264906c066d85d220e7b0f4aab3e046 (patch)
treeba8dd633c0a5b5e92355adb606d190cd0863023b /plugins/check_smtp.c
parent97634d8fc6bba849f771eda24106d88104e703b9 (diff)
downloadmonitoring-plugins-f813c747a264906c066d85d220e7b0f4aab3e046.tar.gz
Added -4 and -6 command line options into check_http, check_ldap and
check_smtp git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@575 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_smtp.c')
-rw-r--r--plugins/check_smtp.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index dd9f19bc..7562c4c6 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -33,11 +33,15 @@ STATE_WARNING return values.\n";
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\
@@ -233,6 +237,8 @@ process_arguments (int argc, char **argv)
{"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}
};
@@ -250,7 +256,7 @@ process_arguments (int argc, char **argv)
}
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)
@@ -315,6 +321,16 @@ process_arguments (int argc, char **argv)
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);