Code

Add missing long options for check_nt (for use with extra-opts)
[nagiosplug.git] / plugins / check_nt.c
index 681b842e4a655efa4d98687b58b34b6f25ff4725..a0e5c11927b40c22c90b8bdf073dc7578083a355 100644 (file)
@@ -122,6 +122,9 @@ int main(int argc, char **argv){
        bindtextdomain (PACKAGE, LOCALEDIR);
        textdomain (PACKAGE);
 
+       /* Parse extra opts if any */
+       argv=np_extra_opts (&argc, argv, progname);
+
        if(process_arguments(argc,argv) == ERROR)
                usage4 (_("Could not parse arguments"));
 
@@ -473,6 +476,9 @@ int process_arguments(int argc, char **argv){
                {"warning",  required_argument,0,'w'},
                {"variable", required_argument,0,'v'},
                {"hostname", required_argument,0,'H'},
+               {"params",   required_argument,0,'l'},
+               {"secret",   required_argument,0,'s'},
+               {"display",  required_argument,0,'d'},
                {"version",  no_argument,      0,'V'},
                {"help",     no_argument,      0,'h'},
                {0,0,0,0}
@@ -644,14 +650,15 @@ void print_help(void)
        print_usage();
        
   printf (_(UT_HELP_VRSN));
+  printf (_(UT_EXTRA_OPTS));
 
-    printf ("%s\n", _("Options:"));
+  printf ("%s\n", _("Options:"));
   printf (" %s\n", "-H, --hostname=HOST");
   printf ("   %s\n", _("Name of the host to check"));
   printf (" %s\n", "-p, --port=INTEGER");
   printf ("   %s", _("Optional port number (default: "));
   printf ("%d)\n", PORT);
-  printf (" %s\n", "-s <password>");
+  printf (" %s\n", "-s, --secret=<password>");
   printf ("   %s\n", _("Password needed for the request"));
   printf (" %s\n", "-w, --warning=INTEGER");
   printf ("   %s\n", _("Threshold which will result in a warning status"));
@@ -659,6 +666,10 @@ void print_help(void)
   printf ("   %s\n", _("Threshold which will result in a critical status"));
   printf (" %s\n", "-t, --timeout=INTEGER");
   printf ("   %s", _("Seconds before connection attempt times out (default: "));
+  printf (" %s\n", "-l, --params=<parameters>");
+  printf ("   %s", _("Parameters passed to specified check (see below)"));
+  printf (" %s\n", "-d, --display={SHOWALL}");
+  printf ("   %s", _("Display options (currently only SHOWALL works)"));
   printf ("%d)\n", DEFAULT_SOCKET_TIMEOUT);
   printf (" %s\n", "-h, --help");
   printf ("   %s\n", _("Print this help screen"));
@@ -729,6 +740,9 @@ void print_help(void)
   printf ("   %s\n", _("output when this happens contains \"Cannot map xxxxx to protocol number\"."));
   printf ("   %s\n", _("One fix for this is to change the port to something else on check_nt "));
   printf ("   %s\n", _("and on the client service it\'s connecting to."));
+#ifdef NP_EXTRA_OPTS
+  printf (" -%s", _(UT_EXTRA_OPTS_NOTES));
+#endif
 
   printf (_(UT_SUPPORT));
 }
@@ -738,6 +752,6 @@ void print_help(void)
 void print_usage(void)
 {
   printf (_("Usage:"));
-       printf ("%s -H host -v variable [-p port] [-w warning] [-c critical]",progname);
+       printf ("%s -H host -v variable [-p port] [-w warning] [-c critical]\n",progname);
   printf ("[-l params] [-d SHOWALL] [-t timeout]\n");
 }