summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-03-19 23:44:40 (GMT)
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-03-19 23:44:40 (GMT)
commit35a2cf99f6e08edd75c56881ed28bbc981f20f26 (patch)
treea0e3ad23ad06d211b6ee5084c85884325585b221 /plugins
parent4f29ac7115a5852a747242fc7973a6137817c3df (diff)
downloadmonitoring-plugins-35a2cf99f6e08edd75c56881ed28bbc981f20f26.tar.gz
allow to specify -1 and -2 for protocol version
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@442 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_by_ssh.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/check_by_ssh.c b/plugins/check_by_ssh.c
index 866044b..7328f5a 100644
--- a/plugins/check_by_ssh.c
+++ b/plugins/check_by_ssh.c
@@ -190,6 +190,8 @@ process_arguments (int argc, char **argv)
190 {"user", required_argument, 0, 'u'}, 190 {"user", required_argument, 0, 'u'},
191 {"logname", required_argument, 0, 'l'}, 191 {"logname", required_argument, 0, 'l'},
192 {"command", required_argument, 0, 'C'}, 192 {"command", required_argument, 0, 'C'},
193 {"proto1", no_argument, 0, '1'},
194 {"proto2", no_argument, 0, '2'},
193 {"use-ipv4", no_argument, 0, '4'}, 195 {"use-ipv4", no_argument, 0, '4'},
194 {"use-ipv6", no_argument, 0, '6'}, 196 {"use-ipv6", no_argument, 0, '6'},
195 {0, 0, 0, 0} 197 {0, 0, 0, 0}
@@ -203,7 +205,7 @@ process_arguments (int argc, char **argv)
203 strcpy (argv[c], "-t"); 205 strcpy (argv[c], "-t");
204 206
205 while (1) { 207 while (1) {
206 c = getopt_long (argc, argv, "Vvh46ft:H:O:p:i:u:l:C:n:s:", long_options, 208 c = getopt_long (argc, argv, "Vvh1246ft:H:O:p:i:u:l:C:n:s:", long_options,
207 &option_index); 209 &option_index);
208 210
209 if (c == -1 || c == EOF) 211 if (c == -1 || c == EOF)
@@ -261,8 +263,10 @@ process_arguments (int argc, char **argv)
261 case 'i': /* identity */ 263 case 'i': /* identity */
262 asprintf (&comm, "%s -%c %s", comm, c, optarg); 264 asprintf (&comm, "%s -%c %s", comm, c, optarg);
263 break; 265 break;
264 case '4': /* Pass these switches directly to ssh */ 266 case '1': /* Pass these switches directly to ssh */
265 case '6': /* -4 for IPv4, -6 for IPv6 */ 267 case '2': /* 1 to force version 1, 2 to force version 2 */
268 case '4': /* -4 for IPv4 */
269 case '6': /* -6 for IPv6 */
266 case 'f': /* fork to background */ 270 case 'f': /* fork to background */
267 asprintf (&comm, "%s -%c", comm, c); 271 asprintf (&comm, "%s -%c", comm, c);
268 break; 272 break;
@@ -357,6 +361,10 @@ print_help (const char *cmd)
357 " list of nagios service names, separated by ':' [optional]\n" 361 " list of nagios service names, separated by ':' [optional]\n"
358 "-n, --name=NAME\n" 362 "-n, --name=NAME\n"
359 " short name of host in nagios configuration [optional]\n" 363 " short name of host in nagios configuration [optional]\n"
364 "-1, --proto1\n"
365 " tell ssh to use Protocol 1\n"
366 "-2, --proto2\n"
367 " tell ssh to use Protocol 2\n"
360 "-4, --use-ipv4\n" 368 "-4, --use-ipv4\n"
361 " tell ssh to use IPv4\n" 369 " tell ssh to use IPv4\n"
362 "-6, --use-ipv6\n" 370 "-6, --use-ipv6\n"