Bladeren bron

Fix long options parsing in check_disk, check_dns, check_mrtg and check_mrtgtraf (check_tcp was done in an earlier commit)

git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2078 f882894a-f735-0410-b71e-b25c423dba1c
Thomas Guyot-Sionnest 17 jaren geleden
bovenliggende
commit
4e366f82de
8 gewijzigde bestanden met toevoegingen van 14 en 15 verwijderingen
  1. 1 1
      NEWS
  2. 2 2
      plugins/check_disk.c
  3. 2 2
      plugins/check_dns.c
  4. 2 1
      plugins/check_ide_smart.c
  5. 2 2
      plugins/check_mrtg.c
  6. 3 5
      plugins/check_mrtgtraf.c
  7. 1 1
      plugins/check_mysql_query.c
  8. 1 1
      plugins/check_nt.c

+ 1 - 1
NEWS

@@ -11,7 +11,7 @@ This file documents the major additions and syntax changes between releases.
 	Extra-opts (C plugins) does not allow trailing comments anymore (like N::P)
 	Fixed dependency issue on libtap when ./configure --enable-libtap used. Warning: will install libtap
 	Fixed segfault in extra-opts under some circumstance when reading multiple sections
-	Fix long options parsing in check_tcp
+	Fix long options parsing in check_disk, check_dns, check_mrtg, check_mrtgtraf and check_tcp.
 	check_icmp now reports min and max round trip time perfdata (Steve Rader)
 	Fixed bug where additional headers with redirection caused a segfault (Dieter Van de Walle - 2089159)
 

+ 2 - 2
plugins/check_disk.c

@@ -477,8 +477,8 @@ process_arguments (int argc, char **argv)
     {"iwarning", required_argument, 0, 'W'},
     /* Dang, -C is taken. We might want to reshuffle this. */
     {"icritical", required_argument, 0, 'K'},
-    {"kilobytes", required_argument, 0, 'k'},
-    {"megabytes", required_argument, 0, 'm'},
+    {"kilobytes", no_argument, 0, 'k'},
+    {"megabytes", no_argument, 0, 'm'},
     {"units", required_argument, 0, 'u'},
     {"path", required_argument, 0, 'p'},
     {"partition", required_argument, 0, 'p'},

+ 2 - 2
plugins/check_dns.c

@@ -340,8 +340,8 @@ process_arguments (int argc, char **argv)
     {"reverse-server", required_argument, 0, 'r'},
     {"expected-address", required_argument, 0, 'a'},
     {"expect-authority", no_argument, 0, 'A'},
-    {"warning", no_argument, 0, 'w'},
-    {"critical", no_argument, 0, 'c'},
+    {"warning", required_argument, 0, 'w'},
+    {"critical", required_argument, 0, 'c'},
     {0, 0, 0, 0}
   };
 

+ 2 - 1
plugins/check_ide_smart.c

@@ -173,7 +173,8 @@ main (int argc, char *argv[])
 		{"auto-off", no_argument, 0, '0'}, 
 		{"nagios", no_argument, 0, 'n'}, 
 		{"help", no_argument, 0, 'h'}, 
-		{"version", no_argument, 0, 'V'}, {0, 0, 0, 0} 
+		{"version", no_argument, 0, 'V'},
+		{0, 0, 0, 0}
 	};
 
 	setlocale (LC_ALL, "");

+ 2 - 2
plugins/check_mrtg.c

@@ -181,7 +181,7 @@ process_arguments (int argc, char **argv)
 		{"warning", required_argument, 0, 'w'},
 		{"label", required_argument, 0, 'l'},
 		{"units", required_argument, 0, 'u'},
-		{"verbose", no_argument, 0, 'v'},
+		{"variable", required_argument, 0, 'v'},
 		{"version", no_argument, 0, 'V'},
 		{"help", no_argument, 0, 'h'},
 		{0, 0, 0, 0}
@@ -334,7 +334,7 @@ print_help (void)
 
 	printf (" %s\n", "-F, --logfile=FILE");
   printf ("   %s\n", _("The MRTG log file containing the data you want to monitor"));
-  printf ("-e, --expires=MINUTES");
+  printf (" %s\n", "-e, --expires=MINUTES");
   printf ("   %s\n", _("Minutes before MRTG data is considered to be too old"));
   printf (" %s\n", "-a, --aggregation=AVG|MAX");
   printf ("   %s\n", _("Should we check average or maximum values?"));

+ 3 - 5
plugins/check_mrtgtraf.c

@@ -223,13 +223,11 @@ process_arguments (int argc, char **argv)
 
 	int option = 0;
 	static struct option longopts[] = {
-		{"logfile", required_argument, 0, 'F'},
+		{"filename", required_argument, 0, 'F'},
 		{"expires", required_argument, 0, 'e'},
 		{"aggregation", required_argument, 0, 'a'},
-		{"variable", required_argument, 0, 'v'},
 		{"critical", required_argument, 0, 'c'},
 		{"warning", required_argument, 0, 'w'},
-		{"verbose", no_argument, 0, 'v'},
 		{"version", no_argument, 0, 'V'},
 		{"help", no_argument, 0, 'h'},
 		{0, 0, 0, 0}
@@ -385,6 +383,6 @@ void
 print_usage (void)
 {
 	printf (_("Usage"));
-  printf (" %s -F <log_file> -a <AVG | MAX> -v <variable> -w <warning_pair>",progname);
-  printf ("-c <critical_pair> [-e expire_minutes] [-t timeout] [-v]\n");
+  printf (" %s -F <log_file> -a <AVG | MAX> -w <warning_pair>\n",progname);
+  printf ("-c <critical_pair> [-e expire_minutes]\n");
 }

+ 1 - 1
plugins/check_mysql_query.c

@@ -192,7 +192,7 @@ process_arguments (int argc, char **argv)
 		return ERROR;
 
 	while (1) {
-		c = getopt_long (argc, argv, "hvVSP:p:u:d:H:s:q:w:c:", longopts, &option);
+		c = getopt_long (argc, argv, "hvVP:p:u:d:H:s:q:w:c:", longopts, &option);
 
 		if (c == -1 || c == EOF)
 			break;

+ 1 - 1
plugins/check_nt.c

@@ -745,6 +745,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");
 }