Просмотр исходного кода

check_uptime: fixed backward help text for thresholds

Fix for issue # 198
John C. Frickson 9 лет назад
Родитель
Сommit
32e8a6cf9a
2 измененных файлов с 24 добавлено и 23 удалено
  1. 1 0
      NEWS
  2. 23 23
      plugins/check_uptime.c

+ 1 - 0
NEWS

@@ -6,6 +6,7 @@ x.x.x xxxx-xx-xx
 	check_http: reports warning where it should report ok with -e
 	check_http: reports warning where it should report ok with -e
 	check_snmp: does not work with -6 --ipv6 flags
 	check_snmp: does not work with -6 --ipv6 flags
 	check_swap: threshold calculation in bytes requires subtracting 65
 	check_swap: threshold calculation in bytes requires subtracting 65
+	check_uptime: fixed backward help text for thresholds
 
 
 
 
 2.2.0 2017-01-19
 2.2.0 2017-01-19

+ 23 - 23
plugins/check_uptime.c

@@ -129,20 +129,20 @@ int getuptime () {
 static int process_arguments (int argc, char **argv) {
 static int process_arguments (int argc, char **argv) {
 
 
 	int c;
 	int c;
-        int escape = 0;
-        char *temp;
+	int escape = 0;
+	char *temp;
 	
 	
-        int option = 0;
-        static struct option longopts[] = {
-                {"critical", required_argument, 0, 'c'},
-                {"warning", required_argument, 0, 'w'},
-    		{"timeout", required_argument, 0, 't'},
-                {"timeunit", required_argument, 0, 'u'},
-                {"verbose", no_argument, 0, 'v'},
-                {"version", no_argument, 0, 'V'},
-                {"help", no_argument, 0, 'h'},
-                {0, 0, 0, 0}
-        };
+	int option = 0;
+	static struct option longopts[] = {
+		{"critical", required_argument, 0, 'c'},
+		{"warning", required_argument, 0, 'w'},
+		{"timeout", required_argument, 0, 't'},
+		{"timeunit", required_argument, 0, 'u'},
+		{"verbose", no_argument, 0, 'v'},
+		{"version", no_argument, 0, 'V'},
+		{"help", no_argument, 0, 'h'},
+		{0, 0, 0, 0}
+	};
 
 
 	while ( 1 ) {
 	while ( 1 ) {
 
 
@@ -162,9 +162,9 @@ static int process_arguments (int argc, char **argv) {
 					printf("Verbose mode enabled\n");
 					printf("Verbose mode enabled\n");
 				}
 				}
 				break;
 				break;
-    			case 'V':
-      				print_revision (progname, NP_VERSION);
-      				exit (STATE_OK);
+			case 'V':
+				print_revision (progname, NP_VERSION);
+				exit (STATE_OK);
 			case 'u':
 			case 'u':
 				timeunit = optarg;
 				timeunit = optarg;
 				break;
 				break;
@@ -221,7 +221,7 @@ void print_help (void) {
 	print_revision ( progname, NP_VERSION );
 	print_revision ( progname, NP_VERSION );
 
 
 	printf ( COPYRIGHT, copyright, developer, email );
 	printf ( COPYRIGHT, copyright, developer, email );
-	printf ( "%s\n", _("This plugin checks the system uptime and alerts if less than the threshold.") );
+	printf ( "%s\n", _("This plugin checks the system uptime and alerts if more than the threshold.") );
 	printf ( "%s\n", _("Threshold unit of measurement specified with \"-u\".") );
 	printf ( "%s\n", _("Threshold unit of measurement specified with \"-u\".") );
 	printf ( "%s\n", _("\"-u\" switch supports: seconds|minutes|hours|days.") );
 	printf ( "%s\n", _("\"-u\" switch supports: seconds|minutes|hours|days.") );
 
 
@@ -229,13 +229,13 @@ void print_help (void) {
 	printf ( UT_HELP_VRSN );
 	printf ( UT_HELP_VRSN );
 	printf ( UT_EXTRA_OPTS );
 	printf ( UT_EXTRA_OPTS );
 
 
-        printf ( "%s\n", _("-t, Plugin timeout, default 10 seconds") );
-        printf ( "%s\n", _("-c, Critcal threshold") );
-	printf ( "%s\n", _("-w, Warning threshold") );
 	printf ( "%s\n", _("-u, Time unit of measurement (seconds|minutes|hours|days) (default: minutes)") );
 	printf ( "%s\n", _("-u, Time unit of measurement (seconds|minutes|hours|days) (default: minutes)") );
-        printf ( "%s\n", _("-vvv, Enable verbose output") );
-        //printf ( "%s\n", _("-h, Print help and usage") );
+	printf ( "%s\n", _("-w, Warning threshold") );
+	printf ( "%s\n", _("-c, Critcal threshold") );
+	printf ( "%s\n", _("-t, Plugin timeout, default 10 seconds") );
+	printf ( "%s\n", _("-vvv, Enable verbose output") );
+	//printf ( "%s\n", _("-h, Print help and usage") );
 
 
-       printf ( UT_SUPPORT );
+	printf ( UT_SUPPORT );
 
 
 } // end print_help
 } // end print_help