summaryrefslogtreecommitdiffstats
path: root/plugins/check_ssh.c
diff options
context:
space:
mode:
authorJeremy T. Bouse <undrgrid@users.sourceforge.net>2003-06-29 06:36:55 +0000
committerJeremy T. Bouse <undrgrid@users.sourceforge.net>2003-06-29 06:36:55 +0000
commitd77d183ddb8bdff5069ba5fa008406087162d117 (patch)
tree35ece18bb2080b168605c5533e4ff6b1574f9f88 /plugins/check_ssh.c
parentcb448eb1d57259641e10494e8d74d885e44c215d (diff)
downloadmonitoring-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.c15
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)
68 static struct option long_options[] = { 68 static struct option long_options[] = {
69 {"version", no_argument, 0, 'V'}, 69 {"version", no_argument, 0, 'V'},
70 {"help", no_argument, 0, 'h'}, 70 {"help", no_argument, 0, 'h'},
71 {"use-ipv4", no_argument, 0, '4'},
72 {"use-ipv6", no_argument, 0, '6'},
71 {"verbose", no_argument, 0, 'v'}, 73 {"verbose", no_argument, 0, 'v'},
72 {"timeout", required_argument, 0, 't'}, 74 {"timeout", required_argument, 0, 't'},
73 {"host", required_argument, 0, 'H'}, 75 {"host", required_argument, 0, 'H'},
@@ -82,7 +84,7 @@ process_arguments (int argc, char **argv)
82 strcpy (argv[c], "-t"); 84 strcpy (argv[c], "-t");
83 85
84 while (1) { 86 while (1) {
85 c = getopt_long (argc, argv, "+Vhvt:H:p:", long_options, &option_index); 87 c = getopt_long (argc, argv, "+Vhv46t:H:p:", long_options, &option_index);
86 88
87 if (c == -1 || c == EOF) 89 if (c == -1 || c == EOF)
88 break; 90 break;
@@ -104,6 +106,12 @@ process_arguments (int argc, char **argv)
104 usage ("Timeout Interval must be an integer!\n\n"); 106 usage ("Timeout Interval must be an integer!\n\n");
105 socket_timeout = atoi (optarg); 107 socket_timeout = atoi (optarg);
106 break; 108 break;
109 case '4':
110 address_family = AF_INET;
111 break;
112 case '6':
113 address_family = AF_INET6;
114 break;
107 case 'H': /* host */ 115 case 'H': /* host */
108 if (is_host (optarg) == FALSE) 116 if (is_host (optarg) == FALSE)
109 usage ("Invalid hostname/address\n"); 117 usage ("Invalid hostname/address\n");
@@ -217,7 +225,10 @@ print_usage (void)
217 ("Usage:\n" 225 ("Usage:\n"
218 " %s -t [timeout] -p [port] <host>\n" 226 " %s -t [timeout] -p [port] <host>\n"
219 " %s -V prints version info\n" 227 " %s -V prints version info\n"
220 " %s -h prints more detailed help\n", progname, progname, progname); 228 " %s -4 use IPv4 connection\n"
229 " %s -6 use IPv6 connection\n"
230 " %s -h prints more detailed help\n",
231 progname, progname, progname, progname, progname);
221} 232}
222 233
223/* end of check_ssh.c */ 234/* end of check_ssh.c */