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

check_nrpe version 2.15 (Return code of 255 is out of bounds)

Fix for issue http://api.nagios.com/tps/viewtask.php?task_id=4887
check_nrpe was exiting with 255 if my_connect() failed. Now it
returns STATE_CRITICAL.
John C. Frickson 10 лет назад
Родитель
Сommit
83a60cfc9e
2 измененных файлов с 2 добавлено и 1 удалено
  1. 1 0
      Changelog
  2. 1 1
      src/check_nrpe.c

+ 1 - 0
Changelog

@@ -13,6 +13,7 @@ FIXES
 - Replaced all instances of signal() with sigaction() + blocking (John Frickson)
 - Replaced all instances of signal() with sigaction() + blocking (John Frickson)
 - check_nrpe does not parse passed arguments correctly (John Frickson)
 - check_nrpe does not parse passed arguments correctly (John Frickson)
 - NRPE should not start if cannot write pid file (John Frickson)
 - NRPE should not start if cannot write pid file (John Frickson)
+- Fixed out-of-bounds error (return code 255) for some failures (John Frickson)
 
 
 2.15 - 09/06/2013
 2.15 - 09/06/2013
 -----------------
 -----------------

+ 1 - 1
src/check_nrpe.c

@@ -251,7 +251,7 @@ int main(int argc, char **argv){
 	/* try to connect to the host at the given port number */
 	/* try to connect to the host at the given port number */
 	if((sd=my_connect(server_name, &hostaddr, server_port, address_family, 
 	if((sd=my_connect(server_name, &hostaddr, server_port, address_family, 
 			bind_address)) < 0 ) {
 			bind_address)) < 0 ) {
-		exit (255);
+		exit (STATE_CRITICAL);
 		}
 		}
 	else {
 	else {
 		result=STATE_OK;
 		result=STATE_OK;