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

Return UNKNOWN when check_nrpe cannot communicate with nrpe and -u set

Fix for issue #85
John C. Frickson 9 лет назад
Родитель
Сommit
aa18228375
2 измененных файлов с 3 добавлено и 2 удалено
  1. 1 0
      Changelog
  2. 2 2
      src/check_nrpe.c

+ 1 - 0
Changelog

@@ -33,6 +33,7 @@ FIXES
 - Add reload command to systemd service file (Bas Couwenberg)
 - fix file not found error when updating version (Sven Nierlein)
 - Spelling fixes (Josh Soref)
+- Return UNKNOWN when check_nrpe cannot communicate with nrpe and -u set (John Frickson)
 
 
 3.0.1 - 2016-09-08

+ 2 - 2
src/check_nrpe.c

@@ -674,7 +674,7 @@ void usage(int result)
 		printf(" -6           = bind to ipv6 only\n");
 		printf(" -n           = Do no use SSL\n");
 		printf
-			(" -u           = (DEPRECATED) Make timeouts return UNKNOWN instead of CRITICAL\n");
+			(" -u           = Make connection problems return UNKNOWN instead of CRITICAL\n");
 		printf(" -V           = Show version\n");
 		printf(" -l           = Show license\n");
 		printf(" <dhopt>      = Anonymous Diffie Hellman use:\n");
@@ -917,7 +917,7 @@ int connect_to_remote()
 	/* try to connect to the host at the given port number */
 	if ((sd =
 		 my_connect(server_name, &hostaddr, server_port, address_family, bind_address)) < 0)
-		exit(STATE_CRITICAL);
+		exit(timeout_return_code);
 
 	result = STATE_OK;
 	addrlen = sizeof(addr);