diff options
author | Jeremy T. Bouse <undrgrid@users.sourceforge.net> | 2003-06-29 06:36:55 +0000 |
---|---|---|
committer | Jeremy T. Bouse <undrgrid@users.sourceforge.net> | 2003-06-29 06:36:55 +0000 |
commit | d77d183ddb8bdff5069ba5fa008406087162d117 (patch) | |
tree | 35ece18bb2080b168605c5533e4ff6b1574f9f88 /plugins/check_ssh.c | |
parent | cb448eb1d57259641e10494e8d74d885e44c215d (diff) | |
download | monitoring-plugins-d77d183ddb8bdff5069ba5fa008406087162d117.tar.gz |
Added address_family extern int variable to netutils to allow for -4 & -6
options for explicit connection protocol
Added support for -4 & -6 options to check_ssh and check_tcp for testing
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@568 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_ssh.c')
-rw-r--r-- | plugins/check_ssh.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c index f3a351e6..421fc01c 100644 --- a/plugins/check_ssh.c +++ b/plugins/check_ssh.c @@ -68,6 +68,8 @@ process_arguments (int argc, char **argv) static struct option long_options[] = { {"version", no_argument, 0, 'V'}, {"help", no_argument, 0, 'h'}, + {"use-ipv4", no_argument, 0, '4'}, + {"use-ipv6", no_argument, 0, '6'}, {"verbose", no_argument, 0, 'v'}, {"timeout", required_argument, 0, 't'}, {"host", required_argument, 0, 'H'}, @@ -82,7 +84,7 @@ process_arguments (int argc, char **argv) strcpy (argv[c], "-t"); while (1) { - c = getopt_long (argc, argv, "+Vhvt:H:p:", long_options, &option_index); + c = getopt_long (argc, argv, "+Vhv46t:H:p:", long_options, &option_index); if (c == -1 || c == EOF) break; @@ -104,6 +106,12 @@ process_arguments (int argc, char **argv) usage ("Timeout Interval must be an integer!\n\n"); socket_timeout = atoi (optarg); break; + case '4': + address_family = AF_INET; + break; + case '6': + address_family = AF_INET6; + break; case 'H': /* host */ if (is_host (optarg) == FALSE) usage ("Invalid hostname/address\n"); @@ -217,7 +225,10 @@ print_usage (void) ("Usage:\n" " %s -t [timeout] -p [port] <host>\n" " %s -V prints version info\n" - " %s -h prints more detailed help\n", progname, progname, progname); + " %s -4 use IPv4 connection\n" + " %s -6 use IPv6 connection\n" + " %s -h prints more detailed help\n", + progname, progname, progname, progname, progname); } /* end of check_ssh.c */ |