소스 검색

Merge branch 'pr/1363'

* pr/1363:
  use unknown exit code for help/version in plugins-root as well
  use unknown exit code for help/version in plugins
  change exit code to unknown on help and version info
  use exit code 3 for version and help
Holger Weiss 10 년 전
부모
커밋
3f17f18416
57개의 변경된 파일121개의 추가작업 그리고 114개의 파일을 삭제
  1. 2 0
      NEWS
  2. 7 2
      doc/developer-guidelines.sgml
  3. 2 2
      plugins-root/check_dhcp.c
  4. 2 2
      plugins-root/check_icmp.c
  5. 2 2
      plugins-scripts/check_breeze.pl
  6. 2 2
      plugins-scripts/check_disk_smb.pl
  7. 2 2
      plugins-scripts/check_file_age.pl
  8. 2 2
      plugins-scripts/check_flexlm.pl
  9. 3 3
      plugins-scripts/check_ifoperstatus.pl
  10. 4 4
      plugins-scripts/check_ifstatus.pl
  11. 2 2
      plugins-scripts/check_ircd.pl
  12. 2 2
      plugins-scripts/check_mailq.pl
  13. 1 1
      plugins-scripts/check_mssql.pl
  14. 3 3
      plugins-scripts/check_netdns.pl
  15. 2 2
      plugins-scripts/check_ntp.pl
  16. 2 2
      plugins-scripts/check_rpc.pl
  17. 2 2
      plugins-scripts/check_wave.pl
  18. 1 1
      plugins-scripts/t/check_rpc.t
  19. 2 2
      plugins/check_apt.c
  20. 2 2
      plugins/check_by_ssh.c
  21. 1 1
      plugins/check_cluster.c
  22. 2 2
      plugins/check_dbi.c
  23. 2 2
      plugins/check_dig.c
  24. 2 2
      plugins/check_disk.c
  25. 2 2
      plugins/check_dns.c
  26. 2 2
      plugins/check_dummy.c
  27. 2 2
      plugins/check_fping.c
  28. 2 2
      plugins/check_game.c
  29. 2 2
      plugins/check_hpjd.c
  30. 2 2
      plugins/check_http.c
  31. 3 3
      plugins/check_ide_smart.c
  32. 2 2
      plugins/check_ldap.c
  33. 2 2
      plugins/check_load.c
  34. 2 2
      plugins/check_mrtg.c
  35. 2 2
      plugins/check_mrtgtraf.c
  36. 2 2
      plugins/check_mysql.c
  37. 2 2
      plugins/check_mysql_query.c
  38. 2 2
      plugins/check_nagios.c
  39. 2 2
      plugins/check_nt.c
  40. 2 2
      plugins/check_ntp.c
  41. 2 2
      plugins/check_ntp_peer.c
  42. 2 2
      plugins/check_ntp_time.c
  43. 2 2
      plugins/check_nwstat.c
  44. 2 2
      plugins/check_overcr.c
  45. 2 2
      plugins/check_pgsql.c
  46. 2 2
      plugins/check_ping.c
  47. 2 2
      plugins/check_procs.c
  48. 2 2
      plugins/check_radius.c
  49. 2 2
      plugins/check_real.c
  50. 2 2
      plugins/check_smtp.c
  51. 2 2
      plugins/check_snmp.c
  52. 2 2
      plugins/check_ssh.c
  53. 2 2
      plugins/check_swap.c
  54. 2 2
      plugins/check_tcp.c
  55. 2 2
      plugins/check_time.c
  56. 2 2
      plugins/check_ups.c
  57. 2 2
      plugins/check_users.c

+ 2 - 0
NEWS

@@ -19,6 +19,8 @@ This file documents the major additions and syntax changes between releases.
 	The format of the performance data emitted by check_mrtgtraf has been
 	The format of the performance data emitted by check_mrtgtraf has been
 	  changed to comply with the development guidelines
 	  changed to comply with the development guidelines
         check_ssh not returns CRITICAL for protocal/version errors
         check_ssh not returns CRITICAL for protocal/version errors
+	If a plugin is invoked with -h/--help or -V/--version, the exit status
+	  is now UNKNOWN
 
 
 2.1.1 2nd December 2014
 2.1.1 2nd December 2014
 	FIXES
 	FIXES

+ 7 - 2
doc/developer-guidelines.sgml

@@ -194,13 +194,15 @@
 					<row>
 					<row>
 						<entry align="center"><para>3</para></entry>
 						<entry align="center"><para>3</para></entry>
 						<entry valign="middle"><para>Unknown</para></entry>
 						<entry valign="middle"><para>Unknown</para></entry>
-						<entry><para>Invalid command line arguments were supplied to the 
+						<entry><para>Invalid command line arguments were supplied to the
 						plugin or low-level failures internal to the plugin (such as unable to fork,
 						plugin or low-level failures internal to the plugin (such as unable to fork,
 						or open a tcp socket) that prevent it from performing the specified
 						or open a tcp socket) that prevent it from performing the specified
 						operation. Higher-level errors (such as name resolution errors,
 						operation. Higher-level errors (such as name resolution errors,
 						socket timeouts, etc) are outside of the control of plugins and should
 						socket timeouts, etc) are outside of the control of plugins and should
 						generally NOT be reported as UNKNOWN states.
 						generally NOT be reported as UNKNOWN states.
-						</para></entry>
+						</para>
+						<para>The --help or --version output should also result in Unknown state.</para>
+						</entry>
 					</row>
 					</row>
 				</tbody>
 				</tbody>
 			</tgroup>
 			</tgroup>
@@ -610,6 +612,9 @@
 		<para>The option -v or --verbose should be present in all plugins.
 		<para>The option -v or --verbose should be present in all plugins.
 		The user should be allowed to specify -v multiple times to increase
 		The user should be allowed to specify -v multiple times to increase
 		the verbosity level, as described in <xref linkend="verboselevels">.</para>
 		the verbosity level, as described in <xref linkend="verboselevels">.</para>
+
+		The exit code for version information or help should be UNKNOWN
+		(3).</para>
     </section>
     </section>
 
 
     <section>
     <section>

+ 2 - 2
plugins-root/check_dhcp.c

@@ -1163,11 +1163,11 @@ int call_getopt(int argc, char **argv){
 
 
 		case 'V': /* version */
 		case 'V': /* version */
 			print_revision(progname, NP_VERSION);
 			print_revision(progname, NP_VERSION);
-			exit(STATE_OK);
+			exit(STATE_UNKNOWN);
 
 
 		case 'h': /* help */
 		case 'h': /* help */
 			print_help();
 			print_help();
-			exit(STATE_OK);
+			exit(STATE_UNKNOWN);
 
 
 		case 'v': /* verbose */
 		case 'v': /* verbose */
 			verbose=1;
 			verbose=1;

+ 2 - 2
plugins-root/check_icmp.c

@@ -526,10 +526,10 @@ main(int argc, char **argv)
 				break;
 				break;
 			case 'V': /* version */
 			case 'V': /* version */
 				print_revision (progname, NP_VERSION);
 				print_revision (progname, NP_VERSION);
-				exit (STATE_OK);
+				exit (STATE_UNKNOWN);
 			case 'h': /* help */
 			case 'h': /* help */
 				print_help ();
 				print_help ();
-				exit (STATE_OK);
+				exit (STATE_UNKNOWN);
 			}
 			}
 		}
 		}
 	}
 	}

+ 2 - 2
plugins-scripts/check_breeze.pl

@@ -28,10 +28,10 @@ GetOptions
 
 
 if ($opt_V) {
 if ($opt_V) {
 	print_revision($PROGNAME,'@NP_VERSION@');
 	print_revision($PROGNAME,'@NP_VERSION@');
-	exit $ERRORS{'OK'};
+	exit $ERRORS{'UNKNOWN'};
 }
 }
 
 
-if ($opt_h) {print_help(); exit $ERRORS{'OK'};}
+if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};}
 
 
 ($opt_H) || usage("Host name/address not specified\n");
 ($opt_H) || usage("Host name/address not specified\n");
 my $host = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/);
 my $host = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/);

+ 2 - 2
plugins-scripts/check_disk_smb.pl

@@ -54,10 +54,10 @@ GetOptions
 
 
 if ($opt_V) {
 if ($opt_V) {
 	print_revision($PROGNAME,'@NP_VERSION@'); #'
 	print_revision($PROGNAME,'@NP_VERSION@'); #'
-	exit $ERRORS{'OK'};
+	exit $ERRORS{'UNKNOWN'};
 }
 }
 
 
-if ($opt_h) {print_help(); exit $ERRORS{'OK'};}
+if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};}
 
 
 my $smbclient = $utils::PATH_TO_SMBCLIENT;
 my $smbclient = $utils::PATH_TO_SMBCLIENT;
 $smbclient    || usage("check requires smbclient, smbclient not set\n");
 $smbclient    || usage("check requires smbclient, smbclient not set\n");

+ 2 - 2
plugins-scripts/check_file_age.pl

@@ -60,12 +60,12 @@ GetOptions(
 
 
 if ($opt_V) {
 if ($opt_V) {
 	print_revision($PROGNAME, '@NP_VERSION@');
 	print_revision($PROGNAME, '@NP_VERSION@');
-	exit $ERRORS{'OK'};
+	exit $ERRORS{'UNKNOWN'};
 }
 }
 
 
 if ($opt_h) {
 if ($opt_h) {
 	print_help();
 	print_help();
-	exit $ERRORS{'OK'};
+	exit $ERRORS{'UNKNOWN'};
 }
 }
 
 
 $opt_f = shift unless ($opt_f);
 $opt_f = shift unless ($opt_f);

+ 2 - 2
plugins-scripts/check_flexlm.pl

@@ -58,7 +58,7 @@ GetOptions
 
 
 if ($opt_V) {
 if ($opt_V) {
 	print_revision($PROGNAME,'@NP_VERSION@');
 	print_revision($PROGNAME,'@NP_VERSION@');
-	exit $ERRORS{'OK'};
+	exit $ERRORS{'UNKNOWN'};
 }
 }
 
 
 unless (defined $opt_t) {
 unless (defined $opt_t) {
@@ -66,7 +66,7 @@ unless (defined $opt_t) {
 }
 }
 
 
 
 
-if ($opt_h) {print_help(); exit $ERRORS{'OK'};}
+if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};}
 
 
 unless (defined $opt_F) {
 unless (defined $opt_F) {
 	print "Missing license.dat file\n";
 	print "Missing license.dat file\n";

+ 3 - 3
plugins-scripts/check_ifoperstatus.pl

@@ -367,17 +367,17 @@ sub process_arguments() {
 
 
 	if ($status == 0){
 	if ($status == 0){
 		print_help();
 		print_help();
-		exit $ERRORS{'OK'};
+		exit $ERRORS{'UNKNOWN'};
 	}
 	}
 
 
 	if ($opt_V) {
 	if ($opt_V) {
 		print_revision($PROGNAME,'@NP_VERSION@');
 		print_revision($PROGNAME,'@NP_VERSION@');
-		exit $ERRORS{'OK'};
+		exit $ERRORS{'UNKNOWN'};
 	}
 	}
 
 
 	if ($opt_h) {
 	if ($opt_h) {
 		print_help();
 		print_help();
-		exit $ERRORS{'OK'};
+		exit $ERRORS{'UNKNOWN'};
 	}
 	}
 
 
 	if (! utils::is_hostname($hostname)){
 	if (! utils::is_hostname($hostname)){

+ 4 - 4
plugins-scripts/check_ifstatus.pl

@@ -119,7 +119,7 @@ $status = process_arguments();
 if ($status != 0)
 if ($status != 0)
 {
 {
 	print_help() ;
 	print_help() ;
-	exit $ERRORS{'OK'};
+	exit $ERRORS{'UNKNOWN'};
 }
 }
 
 
 
 
@@ -313,17 +313,17 @@ sub process_arguments() {
 		
 		
 	if ($status == 0){
 	if ($status == 0){
 		print_help();
 		print_help();
-		exit $ERRORS{'OK'};
+		exit $ERRORS{'UNKNOWN'};
 	}
 	}
 
 
 	if ($opt_V) {
 	if ($opt_V) {
 		print_revision($PROGNAME,'@NP_VERSION@');
 		print_revision($PROGNAME,'@NP_VERSION@');
-		exit $ERRORS{'OK'};
+		exit $ERRORS{'UNKNOWN'};
 	}
 	}
 
 
 	if ($opt_h) {
 	if ($opt_h) {
 		print_help();
 		print_help();
-		exit $ERRORS{'OK'};
+		exit $ERRORS{'UNKNOWN'};
 	}
 	}
 
 
 	unless (defined $timeout) {
 	unless (defined $timeout) {

+ 2 - 2
plugins-scripts/check_ircd.pl

@@ -181,10 +181,10 @@ MAIN:
 
 
 	if ($opt_V) {
 	if ($opt_V) {
 		print_revision($PROGNAME,'@NP_VERSION@');
 		print_revision($PROGNAME,'@NP_VERSION@');
-		exit $ERRORS{'OK'};
+		exit $ERRORS{'UNKNOWN'};
 	}
 	}
 
 
-	if ($opt_h) {print_help(); exit $ERRORS{'OK'};}
+	if ($opt_h) {print_help(); exit $ERRORS{'UNKNOWN'};}
 
 
 	($opt_H) || ($opt_H = shift @ARGV) || usage("Host name/address not specified\n");
 	($opt_H) || ($opt_H = shift @ARGV) || usage("Host name/address not specified\n");
 	my $remotehost = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/);
 	my $remotehost = $1 if ($opt_H =~ /([-.A-Za-z0-9]+)/);

+ 2 - 2
plugins-scripts/check_mailq.pl

@@ -573,12 +573,12 @@ sub process_arguments(){
 
 
 	if ($opt_V) {
 	if ($opt_V) {
 		print_revision($PROGNAME,'@NP_VERSION@');
 		print_revision($PROGNAME,'@NP_VERSION@');
-		exit $ERRORS{'OK'};
+		exit $ERRORS{'UNKNOWN'};
 	}
 	}
 
 
 	if ($opt_h) {
 	if ($opt_h) {
 		print_help();
 		print_help();
-		exit $ERRORS{'OK'};
+		exit $ERRORS{'UNKNOWN'};
 	}
 	}
 
 
 	if (defined $opt_v ){
 	if (defined $opt_v ){

+ 1 - 1
plugins-scripts/check_mssql.pl

@@ -130,7 +130,7 @@ sub process_arguments {
 
 
 	if (defined $opt_V) {
 	if (defined $opt_V) {
 		print_revision($PROGNAME,'@NP_VERSION@');
 		print_revision($PROGNAME,'@NP_VERSION@');
-		exit $ERRORS{'OK'};
+		exit $ERRORS{'UNKNOWN'};
 	}
 	}
 
 
 	syntax("Help:") if ($help);
 	syntax("Help:") if ($help);

+ 3 - 3
plugins-scripts/check_netdns.pl

@@ -48,10 +48,10 @@ GetOptions("V" => $opt_V,         "version" => $opt_V,
 					 "H=s" => $opt_H,       "hostname=s" => $opt_H);
 					 "H=s" => $opt_H,       "hostname=s" => $opt_H);
 
 
 # -h means display verbose help screen
 # -h means display verbose help screen
-if($opt_h){ print_help(); exit 0; }
+if($opt_h){ print_help(); exit 3; }
 
 
 # -V means display version number
 # -V means display version number
-if ($opt_V) { print_version(); exit 0; }
+if ($opt_V) { print_version(); exit 3; }
 
 
 # -H means host name
 # -H means host name
 $opt_H = shift unless ($opt_H);
 $opt_H = shift unless ($opt_H);
@@ -73,7 +73,7 @@ if ($opt_s) {
 		$server = $1;
 		$server = $1;
 	} else {
 	} else {
 		print "$opt_s is not a valid host name";
 		print "$opt_s is not a valid host name";
-		exit -1;
+		exit 3;
 	}
 	}
 }
 }
 
 

+ 2 - 2
plugins-scripts/check_ntp.pl

@@ -98,12 +98,12 @@ GetOptions
 
 
 if ($opt_V) {
 if ($opt_V) {
 	print_revision($PROGNAME,'@NP_VERSION@');
 	print_revision($PROGNAME,'@NP_VERSION@');
-	exit $ERRORS{'OK'};
+	exit $ERRORS{'UNKNOWN'};
 }
 }
 
 
 if ($opt_h) {
 if ($opt_h) {
 	print_help();
 	print_help();
-	exit $ERRORS{'OK'};
+	exit $ERRORS{'UNKNOWN'};
 }
 }
 
 
 # jitter test params specified
 # jitter test params specified

+ 2 - 2
plugins-scripts/check_rpc.pl

@@ -63,12 +63,12 @@ GetOptions(
 );
 );
 
 
 # -h means display verbose help screen
 # -h means display verbose help screen
-if ($opt_h) { print_help(); exit $ERRORS{'OK'}; }
+if ($opt_h) { print_help(); exit $ERRORS{'UNKNOWN'}; }
 
 
 # -V means display version number
 # -V means display version number
 if ($opt_V) {
 if ($opt_V) {
 	print_revision($PROGNAME,'@NP_VERSION@');
 	print_revision($PROGNAME,'@NP_VERSION@');
-	exit $ERRORS{'OK'};
+	exit $ERRORS{'UNKNOWN'};
 }
 }
 
 
 # Hash containing all RPC program names and numbers
 # Hash containing all RPC program names and numbers

+ 2 - 2
plugins-scripts/check_wave.pl

@@ -31,12 +31,12 @@ GetOptions
 
 
 if ($opt_V) {
 if ($opt_V) {
 	print_revision($PROGNAME,'@NP_VERSION@'); #'
 	print_revision($PROGNAME,'@NP_VERSION@'); #'
-	exit $ERRORS{'OK'};
+	exit $ERRORS{'UNKNOWN'};
 }
 }
 
 
 if ($opt_h) {
 if ($opt_h) {
 	print_help();
 	print_help();
-	exit $ERRORS{'OK'};
+	exit $ERRORS{'UNKNOWN'};
 }
 }
 
 
 $opt_H = shift unless ($opt_H);
 $opt_H = shift unless ($opt_H);

+ 1 - 1
plugins-scripts/t/check_rpc.t

@@ -15,7 +15,7 @@ my $successOutput = '/^check_rpc/';
 
 
 my $t;
 my $t;
 
 
-$t += checkCmd( "./check_rpc -V",   0, $successOutput );
+$t += checkCmd( "./check_rpc -V",   3, $successOutput );
 
 
 exit(0) if defined($Test::Harness::VERSION);
 exit(0) if defined($Test::Harness::VERSION);
 exit($tests - $t);
 exit($tests - $t);

+ 2 - 2
plugins/check_apt.c

@@ -160,10 +160,10 @@ int process_arguments (int argc, char **argv) {
 		switch(c) {
 		switch(c) {
 		case 'h':
 		case 'h':
 			print_help();
 			print_help();
-			exit(STATE_OK);
+			exit(STATE_UNKNOWN);
 		case 'V':
 		case 'V':
 			print_revision(progname, NP_VERSION);
 			print_revision(progname, NP_VERSION);
-			exit(STATE_OK);
+			exit(STATE_UNKNOWN);
 		case 'v':
 		case 'v':
 			verbose++;
 			verbose++;
 			break;
 			break;

+ 2 - 2
plugins/check_by_ssh.c

@@ -209,10 +209,10 @@ process_arguments (int argc, char **argv)
 		switch (c) {
 		switch (c) {
 		case 'V':									/* version */
 		case 'V':									/* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'h':									/* help */
 		case 'h':									/* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'v':									/* help */
 		case 'v':									/* help */
 			verbose = TRUE;
 			verbose = TRUE;
 			break;
 			break;

+ 1 - 1
plugins/check_cluster.c

@@ -200,7 +200,7 @@ int process_arguments(int argc, char **argv){
 
 
 		case 'V': /* version */
 		case 'V': /* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 			break;
 			break;
 
 
 		case 'H': /* help */
 		case 'H': /* help */

+ 2 - 2
plugins/check_dbi.c

@@ -368,10 +368,10 @@ process_arguments (int argc, char **argv)
 			usage5 ();
 			usage5 ();
 		case 'h':     /* help */
 		case 'h':     /* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'V':     /* version */
 		case 'V':     /* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 
 
 		case 'c':     /* critical range */
 		case 'c':     /* critical range */
 			critical_range = optarg;
 			critical_range = optarg;

+ 2 - 2
plugins/check_dig.c

@@ -223,10 +223,10 @@ process_arguments (int argc, char **argv)
     switch (c) {
     switch (c) {
     case 'h':                 /* help */
     case 'h':                 /* help */
       print_help ();
       print_help ();
-      exit (STATE_OK);
+      exit (STATE_UNKNOWN);
     case 'V':                 /* version */
     case 'V':                 /* version */
       print_revision (progname, NP_VERSION);
       print_revision (progname, NP_VERSION);
-      exit (STATE_OK);
+      exit (STATE_UNKNOWN);
     case 'H':                 /* hostname */
     case 'H':                 /* hostname */
       host_or_die(optarg);
       host_or_die(optarg);
       dns_server = optarg;
       dns_server = optarg;

+ 2 - 2
plugins/check_disk.c

@@ -766,10 +766,10 @@ process_arguments (int argc, char **argv)
       break;
       break;
     case 'V':                 /* version */
     case 'V':                 /* version */
       print_revision (progname, NP_VERSION);
       print_revision (progname, NP_VERSION);
-      exit (STATE_OK);
+      exit (STATE_UNKNOWN);
     case 'h':                 /* help */
     case 'h':                 /* help */
       print_help ();
       print_help ();
-      exit (STATE_OK);
+      exit (STATE_UNKNOWN);
     case '?':                 /* help */
     case '?':                 /* help */
       usage (_("Unknown argument"));
       usage (_("Unknown argument"));
     }
     }

+ 2 - 2
plugins/check_dns.c

@@ -395,10 +395,10 @@ process_arguments (int argc, char **argv)
     switch (c) {
     switch (c) {
     case 'h': /* help */
     case 'h': /* help */
       print_help ();
       print_help ();
-      exit (STATE_OK);
+      exit (STATE_UNKNOWN);
     case 'V': /* version */
     case 'V': /* version */
       print_revision (progname, NP_VERSION);
       print_revision (progname, NP_VERSION);
-      exit (STATE_OK);
+      exit (STATE_UNKNOWN);
     case 'v': /* version */
     case 'v': /* version */
       verbose = TRUE;
       verbose = TRUE;
       break;
       break;

+ 2 - 2
plugins/check_dummy.c

@@ -52,11 +52,11 @@ main (int argc, char **argv)
     usage4 (_("Could not parse arguments"));
     usage4 (_("Could not parse arguments"));
   else if (strcmp (argv[1], "-V") == 0 || strcmp (argv[1], "--version") == 0) {
   else if (strcmp (argv[1], "-V") == 0 || strcmp (argv[1], "--version") == 0) {
     print_revision (progname, NP_VERSION);
     print_revision (progname, NP_VERSION);
-    exit (STATE_OK);
+    exit (STATE_UNKNOWN);
   }
   }
   else if (strcmp (argv[1], "-h") == 0 || strcmp (argv[1], "--help") == 0) {
   else if (strcmp (argv[1], "-h") == 0 || strcmp (argv[1], "--help") == 0) {
     print_help ();
     print_help ();
-    exit (STATE_OK);
+    exit (STATE_UNKNOWN);
   }
   }
   else if (!is_integer (argv[1]))
   else if (!is_integer (argv[1]))
     usage4 (_("Arguments to check_dummy must be an integer"));
     usage4 (_("Arguments to check_dummy must be an integer"));

+ 2 - 2
plugins/check_fping.c

@@ -314,10 +314,10 @@ process_arguments (int argc, char **argv)
       usage5 ();
       usage5 ();
     case 'h':                 /* help */
     case 'h':                 /* help */
       print_help ();
       print_help ();
-      exit (STATE_OK);
+      exit (STATE_UNKNOWN);
     case 'V':                 /* version */
     case 'V':                 /* version */
       print_revision (progname, NP_VERSION);
       print_revision (progname, NP_VERSION);
-      exit (STATE_OK);
+      exit (STATE_UNKNOWN);
     case 'v':                 /* verbose mode */
     case 'v':                 /* verbose mode */
       verbose = TRUE;
       verbose = TRUE;
       break;
       break;

+ 2 - 2
plugins/check_game.c

@@ -196,10 +196,10 @@ process_arguments (int argc, char **argv)
     switch (c) {
     switch (c) {
     case 'h': /* help */
     case 'h': /* help */
       print_help ();
       print_help ();
-      exit (STATE_OK);
+      exit (STATE_UNKNOWN);
     case 'V': /* version */
     case 'V': /* version */
       print_revision (progname, NP_VERSION);
       print_revision (progname, NP_VERSION);
-      exit (STATE_OK);
+      exit (STATE_UNKNOWN);
     case 'v': /* version */
     case 'v': /* version */
       verbose = TRUE;
       verbose = TRUE;
       break;
       break;

+ 2 - 2
plugins/check_hpjd.c

@@ -350,10 +350,10 @@ process_arguments (int argc, char **argv)
 			break;
 			break;
 		case 'V':									/* version */
 		case 'V':									/* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'h':									/* help */
 		case 'h':									/* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case '?':									/* help */
 		case '?':									/* help */
 			usage5 ();
 			usage5 ();
 		}
 		}

+ 2 - 2
plugins/check_http.c

@@ -267,11 +267,11 @@ process_arguments (int argc, char **argv)
       break;
       break;
     case 'h': /* help */
     case 'h': /* help */
       print_help ();
       print_help ();
-      exit (STATE_OK);
+      exit (STATE_UNKNOWN);
       break;
       break;
     case 'V': /* version */
     case 'V': /* version */
       print_revision (progname, NP_VERSION);
       print_revision (progname, NP_VERSION);
-      exit (STATE_OK);
+      exit (STATE_UNKNOWN);
       break;
       break;
     case 't': /* timeout period */
     case 't': /* timeout period */
       if (!is_intnonneg (optarg))
       if (!is_intnonneg (optarg))

+ 3 - 3
plugins/check_ide_smart.c

@@ -234,10 +234,10 @@ main (int argc, char *argv[])
 			break;
 			break;
 		case 'h':
 		case 'h':
 			print_help ();
 			print_help ();
-			return STATE_OK;
+			return STATE_UNKNOWN;
 		case 'V':
 		case 'V':
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			return STATE_OK;
+			return STATE_UNKNOWN;
 		default:
 		default:
 			usage5 ();
 			usage5 ();
 		}
 		}
@@ -249,7 +249,7 @@ main (int argc, char *argv[])
 
 
 	if (!device) {
 	if (!device) {
 		print_help ();
 		print_help ();
-		return STATE_OK;
+		return STATE_UNKNOWN;
 	}
 	}
 
 
 	fd = open (device, OPEN_MODE);
 	fd = open (device, OPEN_MODE);

+ 2 - 2
plugins/check_ldap.c

@@ -325,10 +325,10 @@ process_arguments (int argc, char **argv)
 		switch (c) {
 		switch (c) {
 		case 'h':									/* help */
 		case 'h':									/* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'V':									/* version */
 		case 'V':									/* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 't':									/* timeout period */
 		case 't':									/* timeout period */
 			if (!is_intnonneg (optarg))
 			if (!is_intnonneg (optarg))
 				usage2 (_("Timeout interval must be a positive integer"), optarg);
 				usage2 (_("Timeout interval must be a positive integer"), optarg);

+ 2 - 2
plugins/check_load.c

@@ -251,10 +251,10 @@ process_arguments (int argc, char **argv)
 			break;
 			break;
 		case 'V':									/* version */
 		case 'V':									/* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'h':									/* help */
 		case 'h':									/* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case '?':									/* help */
 		case '?':									/* help */
 			usage5 ();
 			usage5 ();
 		}
 		}

+ 2 - 2
plugins/check_mrtg.c

@@ -234,10 +234,10 @@ process_arguments (int argc, char **argv)
 			break;
 			break;
 		case 'V':									/* version */
 		case 'V':									/* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'h':									/* help */
 		case 'h':									/* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case '?':									/* help */
 		case '?':									/* help */
 			usage5 ();
 			usage5 ();
 		}
 		}

+ 2 - 2
plugins/check_mrtgtraf.c

@@ -270,10 +270,10 @@ process_arguments (int argc, char **argv)
 			break;
 			break;
 		case 'V':									/* version */
 		case 'V':									/* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'h':									/* help */
 		case 'h':									/* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case '?':									/* help */
 		case '?':									/* help */
 			usage5 ();
 			usage5 ();
 		}
 		}

+ 2 - 2
plugins/check_mysql.c

@@ -444,10 +444,10 @@ process_arguments (int argc, char **argv)
 			break;
 			break;
 		case 'V':									/* version */
 		case 'V':									/* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'h':									/* help */
 		case 'h':									/* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'v':
 		case 'v':
 			verbose++;
 			verbose++;
 			break;
 			break;

+ 2 - 2
plugins/check_mysql_query.c

@@ -250,10 +250,10 @@ process_arguments (int argc, char **argv)
 			break;
 			break;
 		case 'V':									/* version */
 		case 'V':									/* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'h':									/* help */
 		case 'h':									/* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'q':
 		case 'q':
 			xasprintf(&sql_query, "%s", optarg);
 			xasprintf(&sql_query, "%s", optarg);
 			break;
 			break;

+ 2 - 2
plugins/check_nagios.c

@@ -235,10 +235,10 @@ process_arguments (int argc, char **argv)
 		switch (c) {
 		switch (c) {
 		case 'h':									/* help */
 		case 'h':									/* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'V':									/* version */
 		case 'V':									/* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'F':									/* status log */
 		case 'F':									/* status log */
 			status_log = optarg;
 			status_log = optarg;
 			break;
 			break;

+ 2 - 2
plugins/check_nt.c

@@ -553,10 +553,10 @@ int process_arguments(int argc, char **argv){
 			usage5 ();
 			usage5 ();
 			case 'h': /* help */
 			case 'h': /* help */
 				print_help();
 				print_help();
-				exit(STATE_OK);
+				exit(STATE_UNKNOWN);
 			case 'V': /* version */
 			case 'V': /* version */
 				print_revision(progname, NP_VERSION);
 				print_revision(progname, NP_VERSION);
-				exit(STATE_OK);
+				exit(STATE_UNKNOWN);
 			case 'H': /* hostname */
 			case 'H': /* hostname */
 				server_address = optarg;
 				server_address = optarg;
 				break;
 				break;

+ 2 - 2
plugins/check_ntp.c

@@ -691,11 +691,11 @@ int process_arguments(int argc, char **argv){
 		switch (c) {
 		switch (c) {
 		case 'h':
 		case 'h':
 			print_help();
 			print_help();
-			exit(STATE_OK);
+			exit(STATE_UNKNOWN);
 			break;
 			break;
 		case 'V':
 		case 'V':
 			print_revision(progname, NP_VERSION);
 			print_revision(progname, NP_VERSION);
-			exit(STATE_OK);
+			exit(STATE_UNKNOWN);
 			break;
 			break;
 		case 'v':
 		case 'v':
 			verbose++;
 			verbose++;

+ 2 - 2
plugins/check_ntp_peer.c

@@ -448,11 +448,11 @@ int process_arguments(int argc, char **argv){
 		switch (c) {
 		switch (c) {
 		case 'h':
 		case 'h':
 			print_help();
 			print_help();
-			exit(STATE_OK);
+			exit(STATE_UNKNOWN);
 			break;
 			break;
 		case 'V':
 		case 'V':
 			print_revision(progname, NP_VERSION);
 			print_revision(progname, NP_VERSION);
-			exit(STATE_OK);
+			exit(STATE_UNKNOWN);
 			break;
 			break;
 		case 'v':
 		case 'v':
 			verbose++;
 			verbose++;

+ 2 - 2
plugins/check_ntp_time.c

@@ -477,11 +477,11 @@ int process_arguments(int argc, char **argv){
 		switch (c) {
 		switch (c) {
 		case 'h':
 		case 'h':
 			print_help();
 			print_help();
-			exit(STATE_OK);
+			exit(STATE_UNKNOWN);
 			break;
 			break;
 		case 'V':
 		case 'V':
 			print_revision(progname, NP_VERSION);
 			print_revision(progname, NP_VERSION);
-			exit(STATE_OK);
+			exit(STATE_UNKNOWN);
 			break;
 			break;
 		case 'v':
 		case 'v':
 			verbose++;
 			verbose++;

+ 2 - 2
plugins/check_nwstat.c

@@ -1354,10 +1354,10 @@ int process_arguments(int argc, char **argv) {
 			usage5 ();
 			usage5 ();
 			case 'h': /* help */
 			case 'h': /* help */
 				print_help();
 				print_help();
-				exit(STATE_OK);
+				exit(STATE_UNKNOWN);
 			case 'V': /* version */
 			case 'V': /* version */
 				print_revision(progname, NP_VERSION);
 				print_revision(progname, NP_VERSION);
-				exit(STATE_OK);
+				exit(STATE_UNKNOWN);
 			case 'H': /* hostname */
 			case 'H': /* hostname */
 				server_address=optarg;
 				server_address=optarg;
 				break;
 				break;

+ 2 - 2
plugins/check_overcr.c

@@ -340,10 +340,10 @@ process_arguments (int argc, char **argv)
 			usage5 ();
 			usage5 ();
 		case 'h':									/* help */
 		case 'h':									/* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'V':									/* version */
 		case 'V':									/* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'H':									/* hostname */
 		case 'H':									/* hostname */
 			server_address = optarg;
 			server_address = optarg;
 			break;
 			break;

+ 2 - 2
plugins/check_pgsql.c

@@ -302,10 +302,10 @@ process_arguments (int argc, char **argv)
 			usage5 ();
 			usage5 ();
 		case 'h':     /* help */
 		case 'h':     /* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'V':     /* version */
 		case 'V':     /* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 't':     /* timeout period */
 		case 't':     /* timeout period */
 			if (!is_integer (optarg))
 			if (!is_integer (optarg))
 				usage2 (_("Timeout interval must be a positive integer"), optarg);
 				usage2 (_("Timeout interval must be a positive integer"), optarg);

+ 2 - 2
plugins/check_ping.c

@@ -224,11 +224,11 @@ process_arguments (int argc, char **argv)
 			usage5 ();
 			usage5 ();
 		case 'h':	/* help */
 		case 'h':	/* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 			break;
 			break;
 		case 'V':	/* version */
 		case 'V':	/* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 			break;
 			break;
 		case 't':	/* timeout period */
 		case 't':	/* timeout period */
 			timeout_interval = atoi (optarg);
 			timeout_interval = atoi (optarg);

+ 2 - 2
plugins/check_procs.c

@@ -428,10 +428,10 @@ process_arguments (int argc, char **argv)
 			usage5 ();
 			usage5 ();
 		case 'h':									/* help */
 		case 'h':									/* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'V':									/* version */
 		case 'V':									/* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 't':									/* timeout period */
 		case 't':									/* timeout period */
 			if (!is_integer (optarg))
 			if (!is_integer (optarg))
 				usage2 (_("Timeout interval must be a positive integer"), optarg);
 				usage2 (_("Timeout interval must be a positive integer"), optarg);

+ 2 - 2
plugins/check_radius.c

@@ -259,10 +259,10 @@ process_arguments (int argc, char **argv)
 			usage5 ();
 			usage5 ();
 		case 'h':									/* help */
 		case 'h':									/* help */
 			print_help ();
 			print_help ();
-			exit (OK);
+			exit (STATE_UNKNOWN);
 		case 'V':									/* version */
 		case 'V':									/* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (OK);
+			exit (STATE_UNKNOWN);
 		case 'v':									/* verbose mode */
 		case 'v':									/* verbose mode */
 			verbose = TRUE;
 			verbose = TRUE;
 			break;
 			break;

+ 2 - 2
plugins/check_real.c

@@ -359,10 +359,10 @@ process_arguments (int argc, char **argv)
 			break;
 			break;
 		case 'V':									/* version */
 		case 'V':									/* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'h':									/* help */
 		case 'h':									/* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case '?':									/* usage */
 		case '?':									/* usage */
 			usage5 ();
 			usage5 ();
 		}
 		}

+ 2 - 2
plugins/check_smtp.c

@@ -623,10 +623,10 @@ process_arguments (int argc, char **argv)
 			break;
 			break;
 		case 'V':									/* version */
 		case 'V':									/* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'h':									/* help */
 		case 'h':									/* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case '?':									/* help */
 		case '?':									/* help */
 			usage5 ();
 			usage5 ();
 		}
 		}

+ 2 - 2
plugins/check_snmp.c

@@ -709,10 +709,10 @@ process_arguments (int argc, char **argv)
 			usage5 ();
 			usage5 ();
 		case 'h':	/* help */
 		case 'h':	/* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'V':	/* version */
 		case 'V':	/* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'v': /* verbose */
 		case 'v': /* verbose */
 			verbose++;
 			verbose++;
 			break;
 			break;

+ 2 - 2
plugins/check_ssh.c

@@ -128,10 +128,10 @@ process_arguments (int argc, char **argv)
 			usage5 ();
 			usage5 ();
 		case 'V':									/* version */
 		case 'V':									/* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'h':									/* help */
 		case 'h':									/* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'v':									/* verbose */
 		case 'v':									/* verbose */
 			verbose = TRUE;
 			verbose = TRUE;
 			break;
 			break;

+ 2 - 2
plugins/check_swap.c

@@ -470,10 +470,10 @@ process_arguments (int argc, char **argv)
 			break;
 			break;
 		case 'V':									/* version */
 		case 'V':									/* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'h':									/* help */
 		case 'h':									/* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case '?':									/* error */
 		case '?':									/* error */
 			usage5 ();
 			usage5 ();
 		}
 		}

+ 2 - 2
plugins/check_tcp.c

@@ -463,10 +463,10 @@ process_arguments (int argc, char **argv)
 			usage5 ();
 			usage5 ();
 		case 'h':                 /* help */
 		case 'h':                 /* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'V':                 /* version */
 		case 'V':                 /* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'v':                 /* verbose mode */
 		case 'v':                 /* verbose mode */
 			flags |= FLAG_VERBOSE;
 			flags |= FLAG_VERBOSE;
 			match_flags |= NP_MATCH_VERBOSE;
 			match_flags |= NP_MATCH_VERBOSE;

+ 2 - 2
plugins/check_time.c

@@ -231,10 +231,10 @@ process_arguments (int argc, char **argv)
 			usage5 ();
 			usage5 ();
 		case 'h':									/* help */
 		case 'h':									/* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'V':									/* version */
 		case 'V':									/* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'H':									/* hostname */
 		case 'H':									/* hostname */
 			if (is_host (optarg) == FALSE)
 			if (is_host (optarg) == FALSE)
 				usage2 (_("Invalid hostname/address"), optarg);
 				usage2 (_("Invalid hostname/address"), optarg);

+ 2 - 2
plugins/check_ups.c

@@ -558,10 +558,10 @@ process_arguments (int argc, char **argv)
 			break;
 			break;
 		case 'V':									/* version */
 		case 'V':									/* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'h':									/* help */
 		case 'h':									/* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		}
 		}
 	}
 	}
 
 

+ 2 - 2
plugins/check_users.c

@@ -210,10 +210,10 @@ process_arguments (int argc, char **argv)
 			usage5 ();
 			usage5 ();
 		case 'h':									/* help */
 		case 'h':									/* help */
 			print_help ();
 			print_help ();
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'V':									/* version */
 		case 'V':									/* version */
 			print_revision (progname, NP_VERSION);
 			print_revision (progname, NP_VERSION);
-			exit (STATE_OK);
+			exit (STATE_UNKNOWN);
 		case 'c':									/* critical */
 		case 'c':									/* critical */
 			if (!is_intnonneg (optarg))
 			if (!is_intnonneg (optarg))
 				usage4 (_("Critical threshold must be a positive integer"));
 				usage4 (_("Critical threshold must be a positive integer"));