--- nagios-2-x-cvs/base/utils.c.orig	2007-03-29 15:41:48.000000000 +0200
+++ nagios-2-x-cvs/base/utils.c	2007-03-29 15:47:39.000000000 +0200
@@ -2832,8 +2832,18 @@
 			/* report an error if we couldn't close the command */
 			if(status==-1)
 				result=STATE_CRITICAL;
-			else
+			else {
 				result=WEXITSTATUS(status);
+				if(result==0 && WIFSIGNALED(status)) {
+					/* like bash */
+					result=128 + WTERMSIG(status);
+					snprintf(buffer,sizeof(buffer)-1,
+					"(Plugin received signal %d!)\n", WTERMSIG(status));
+					buffer[sizeof(buffer)-1]='\x0';
+					write(fd[1],buffer,strlen(buffer)+1);
+					buffer[0]='\x0';
+				}
+			}
 
 			/* write the output back to the parent process */
 			write(fd[1],buffer,strlen(buffer)+1);
--- nagios-2-x-cvs/base/checks.c.orig	2007-03-29 16:43:12.000000000 +0200
+++ nagios-2-x-cvs/base/checks.c	2007-03-29 16:55:50.000000000 +0200
@@ -523,6 +523,16 @@
 				svc_msg.exited_ok=FALSE;
 				svc_msg.early_timeout=FALSE;
 			        }
+			else if(WEXITSTATUS(pclose_result)==0
+				&& WIFSIGNALED(pclose_result) ){
+				snprintf(svc_msg.output,sizeof(svc_msg.output)-1,"(Plugin received signal %d!)\n",WTERMSIG(pclose_result));
+				svc_msg.output[sizeof(svc_msg.output)-1]='\x0';
+				svc_msg.exited_ok=TRUE;
+				svc_msg.early_timeout=FALSE;
+				/* like bash */
+				pclose_result=128+WTERMSIG(pclose_result);
+				svc_msg.return_code=pclose_result;
+				}
 
 			/* write check result to message queue */
 			write_svc_message(&svc_msg);
