Code

Don't try to print `optarg' (which will be a NULL pointer) if an unknown
[nagiosplug.git] / plugins / check_ssh.c
index ba31df09bbc58d038b0d799ed0ca0752bd18e745..afe44c9512d668f9410393cddaf89bf838970dbd 100644 (file)
 *
 * This file contains the check_ssh plugin
 *
+*
+*  Try to connect to an SSH server at specified server and port
+*
+*
 * License Information:
 *
 * This program is free software; you can redistribute it and/or modify
@@ -98,7 +102,8 @@ process_arguments (int argc, char **argv)
        static struct option longopts[] = {
                {"help", no_argument, 0, 'h'},
                {"version", no_argument, 0, 'V'},
-               {"host", required_argument, 0, 'H'},
+               {"host", required_argument, 0, 'H'},    /* backward compatibility */
+               {"hostname", required_argument, 0, 'H'},
                {"port", required_argument, 0, 'p'},
                {"use-ipv4", no_argument, 0, '4'},
                {"use-ipv6", no_argument, 0, '6'},
@@ -123,7 +128,7 @@ process_arguments (int argc, char **argv)
 
                switch (c) {
                case '?':                                                                       /* help */
-                       usage2 (_("Unknown argument"), optarg);
+                       usage5 ();
                case 'V':                                                                       /* version */
                        print_revision (progname, revision);
                        exit (STATE_OK);