[Nagios-checkins] CVS: nrpe/src Makefile.in,1.1.1.1,1.2 check_nrpe.c,1.1.1.1,1.2 netutils.c,1.1.1.1,1.2 netutils.h,1.1.1.1,1.2 nrpe.c,1.1.1.1,1.2 nrpe.h,1.1.1.1,1.2

Ethan Galstad egalstad at users.sourceforge.net
Thu Feb 21 17:16:16 UTC 2002


Update of /cvsroot/nagios/nrpe/src
In directory usw-pr-cvs1:/tmp/cvs-serv30470/src

Modified Files:
	Makefile.in check_nrpe.c netutils.c netutils.h nrpe.c nrpe.h 
Log Message:
Name and version change

Index: Makefile.in
===================================================================
RCS file: /cvsroot/nagios/nrpe/src/Makefile.in,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** Makefile.in	23 Jun 2001 17:02:57 -0000	1.1.1.1
--- Makefile.in	22 Feb 2002 01:15:34 -0000	1.2
***************
*** 2,6 ****
  # Makefile for NRPE
  #
! # Last Modified: 06/23/2001
  ###############################
  
--- 2,6 ----
  # Makefile for NRPE
  #
! # Last Modified: 12-23-2001
  ###############################
  
***************
*** 26,35 ****
  
  clean:
! 	rm -f core \
! 	nrpe check_nrpe
  
  distclean: clean
- 	rm -f Makefile
  
! devclean: distclean
! 	rm -f *~ */*~
--- 26,34 ----
  
  clean:
! 	rm -f core nrpe check_nrpe
! 	rm -f *~ */*~
! 	rm -f Makefile
  
  distclean: clean
  
! devclean: clean

Index: check_nrpe.c
===================================================================
RCS file: /cvsroot/nagios/nrpe/src/check_nrpe.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** check_nrpe.c	23 Jun 2001 17:02:57 -0000	1.1.1.1
--- check_nrpe.c	22 Feb 2002 01:15:34 -0000	1.2
***************
*** 5,12 ****
   * Program: NRPE plugin for Nagios
   * License: GPL
!  * Copyright (c) 1999-2001 Ethan Galstad (nagios at nagios.org)
   *
!  * Version: 1.3
!  * Last Modified: 06-23-2001
   *
   * Command line: CHECK_NRPE <host_address> [-p port] [-c command] [-wt warn_time] \
--- 5,11 ----
   * Program: NRPE plugin for Nagios
   * License: GPL
!  * Copyright (c) 1999-2002 Ethan Galstad (nagios at nagios.org)
   *
!  * Last Modified: 02-21-2002
   *
   * Command line: CHECK_NRPE <host_address> [-p port] [-c command] [-wt warn_time] \
***************
*** 26,37 ****
  #include "netutils.h"
  
- 
- #define PROGRAM_VERSION "1.3"
- #define MODIFICATION_DATE "06-23-2001"
- 
  #define DEFAULT_NRPE_COMMAND	"_NRPE_CHECK"  /* check version of NRPE daemon */
  
- time_t start_time,end_time;
- 
  int server_port=DEFAULT_SERVER_PORT;
  char server_name[MAX_HOST_ADDRESS_LENGTH];
--- 25,30 ----
***************
*** 40,47 ****
  int socket_timeout=DEFAULT_SOCKET_TIMEOUT;
  
- int warning_time=0;
- int check_warning_time=FALSE;
- int critical_time=0;
- int check_critical_time=FALSE;
  
  
--- 33,36 ----
***************
*** 58,61 ****
--- 47,52 ----
  	packet send_packet;
  	packet receive_packet;
+ 	int bytes_to_send;
+ 	int bytes_to_recv;
  
  	result=process_arguments(argc,argv);
***************
*** 66,70 ****
  		printf("\n");
  		printf("NRPE Plugin for Nagios\n");
! 		printf("Copyright (c) 1999-2001 Ethan Galstad (nagios at nagios.org)\n");
  		printf("Version: %s\n",PROGRAM_VERSION);
  		printf("Last Modified: %s\n",MODIFICATION_DATE);
--- 57,61 ----
  		printf("\n");
  		printf("NRPE Plugin for Nagios\n");
! 		printf("Copyright (c) 1999-2002 Ethan Galstad (nagios at nagios.org)\n");
  		printf("Version: %s\n",PROGRAM_VERSION);
  		printf("Last Modified: %s\n",MODIFICATION_DATE);
***************
*** 78,85 ****
  		printf(" [port]         = The port on which the daemon is running - default is %d\n",DEFAULT_SERVER_PORT);
  		printf(" [command]      = The name of the command that the remote daemon should run\n");
- 		printf(" [warn_time]    = Response time in seconds necessary to result in a warning\n");
- 		printf("                  status\n");
- 		printf(" [crit_time]    = Response time in seconds necessary to result in a critical\n");
- 		printf("                  status\n");
  		printf(" [to_sec]       = Number of seconds before connection attempt times out.\n");
  		printf("                  Default timeout is %d seconds\n",DEFAULT_SOCKET_TIMEOUT);
--- 69,72 ----
***************
*** 104,109 ****
  	alarm(socket_timeout);
  
- 	time(&start_time);
- 
  	/* try to connect to the host at the given port number */
  	result=my_tcp_connect(server_name,server_port,&sd);
--- 91,94 ----
***************
*** 119,126 ****
  		strcpy(&send_packet.buffer[0],query_string);
  
! 		rc=send(sd,(void *)&send_packet,sizeof(send_packet),0);
  
  		if(rc==-1){
! 			printf("CHECK_NRPE: Error sending query to host\n");
  			close(sd);
  			return STATE_UNKNOWN;
--- 104,112 ----
  		strcpy(&send_packet.buffer[0],query_string);
  
! 		bytes_to_send=sizeof(send_packet);
! 		rc=sendall(sd,(char *)&send_packet,&bytes_to_send);
  
  		if(rc==-1){
! 			printf("CHECK_NRPE: Error sending query to host.\n");
  			close(sd);
  			return STATE_UNKNOWN;
***************
*** 128,164 ****
  
  		/* wait for the response packet */
! 		bzero(&receive_packet,sizeof(receive_packet));
! 		rc=recv(sd,(void *)&receive_packet,sizeof(receive_packet),0);
  
! 		if(rc==-1){
! 			printf("CHECK_NRPE: Error receiving data from host\n");
  			close(sd);
  			return STATE_UNKNOWN;
  		        }
  
  		else if(rc==0){
! 			printf("CHECK_NRPE: Received 0 bytes. Is this host authorized to connect with nrpe daemon?\n");
  			close(sd);
  			return STATE_UNKNOWN;
  		        }
  
! 		else if(rc<sizeof(receive_packet)){
! 			printf("CHECK_NRPE: Receive underflow.  Only %d bytes received (%d expected).\n",rc,sizeof(receive_packet));
  			close(sd);
  			return STATE_UNKNOWN;
  		        }
  
- 		time(&end_time);
- 
- 		result=STATE_OK;
- 
- 		if(check_critical_time==TRUE && (end_time-start_time)>critical_time)
- 			result=STATE_CRITICAL;
- 		else if(check_warning_time==TRUE && (end_time-start_time)>warning_time)
- 			result=STATE_WARNING;
- 
- 		if(result!=STATE_OK)
- 			printf("CHECK_NRPE problem - %d second response time: ",(int)(end_time-start_time));
- 
  		/* get the return code from the remote plugin */
  		result=ntohl(receive_packet.result_code);
--- 114,144 ----
  
  		/* wait for the response packet */
! 		bytes_to_recv=sizeof(receive_packet);
! 		rc=recvall(sd,(char *)&receive_packet,&bytes_to_recv,socket_timeout);
  
! 		/* recv() error */
! 		if(rc<0){
! 			printf("CHECK_NRPE: Error receiving data from host.\n");
  			close(sd);
+ 			alarm(0);
  			return STATE_UNKNOWN;
  		        }
  
+ 		/* server disconnected */
  		else if(rc==0){
! 			printf("CHECK_NRPE: Received 0 bytes.  Are we allowed to connect to the host?\n");
  			close(sd);
+ 			alarm(0);
  			return STATE_UNKNOWN;
  		        }
  
! 		/* receive underflow */
! 		else if(bytes_to_recv<sizeof(receive_packet)){
! 			printf("CHECK_NRPE: Receive underflow - only %d bytes received (%d expected).\n",bytes_to_recv,sizeof(receive_packet));
  			close(sd);
+ 			alarm(0);
  			return STATE_UNKNOWN;
  		        }
  
  		/* get the return code from the remote plugin */
  		result=ntohl(receive_packet.result_code);
***************
*** 225,246 ****
  				return ERROR;
  		        }
- 		else if(!strcmp(argv[x-1],"-wt")){
- 			if(x<argc){
- 				warning_time=atoi(argv[x]);
- 				check_warning_time=TRUE;
- 				x++;
- 			        }
- 			else
- 				return ERROR;
- 		        }
- 		else if(!strcmp(argv[x-1],"-ct")){
- 			if(x<argc){
- 				critical_time=atoi(argv[x]);
- 				check_critical_time=TRUE;
- 				x++;
- 			        }
- 			else
- 				return ERROR;
- 		        }
  		else
  			return ERROR;
--- 205,208 ----
***************
*** 254,258 ****
  void alarm_handler(int sig){
  
! 	printf("CHECK_NRPE: Socket timeout after %d seconds\n",socket_timeout);
  
  	exit(STATE_CRITICAL);
--- 216,220 ----
  void alarm_handler(int sig){
  
! 	printf("CHECK_NRPE: Socket timeout after %d seconds.\n",socket_timeout);
  
  	exit(STATE_CRITICAL);

Index: netutils.c
===================================================================
RCS file: /cvsroot/nagios/nrpe/src/netutils.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** netutils.c	23 Jun 2001 17:02:57 -0000	1.1.1.1
--- netutils.c	22 Feb 2002 01:15:34 -0000	1.2
***************
*** 2,8 ****
   *
   * NETUTILS.C - NRPE Network Utilities
!  * Copyright (c) 1999-2001 Ethan Galstad (nagios at nagios.org)
   * License: GPL
!  * Last Modified: 06-23-2001
   *
   * Description:
--- 2,10 ----
   *
   * NETUTILS.C - NRPE Network Utilities
!  *
   * License: GPL
!  * Copyright (c) 1999-2002 Ethan Galstad (nagios at nagios.org)
!  *
!  * Last Modified: 02-21-2002
   *
   * Description:
***************
*** 31,123 ****
  #include "netutils.h"
  
- extern int socket_timeout;    /* this doesn't have to be used, but it is nice to know how many seconds we timed out after */
- 
- extern int errno;
- 
- 
- /* handles socket timeouts */
- void socket_timeout_alarm_handler(int sig){
- 
- 	printf("Socket timeout after %d seconds\n",socket_timeout);
- 
- 	exit(STATE_CRITICAL);
-         }
- 
- 
- /* connects to a host on a specified TCP port, sends a string, and gets a response */
- int process_tcp_request(char *server_address, int server_port, char *send_buffer, char *recv_buffer, int recv_size){
- 	int result;
- 
- 	result=process_request(server_address,server_port,"tcp",send_buffer,recv_buffer,recv_size);
- 
- 	return result;
-         }
- 
- 
- /* connects to a host on a specified UDP port, sends a string, and gets a response */
- int process_udp_request(char *server_address, int server_port, char *send_buffer, char *recv_buffer, int recv_size){
- 	int result;
- 
- 	result=process_request(server_address,server_port,"udp",send_buffer,recv_buffer,recv_size);
- 
- 	return result;
-         }
- 
- 
- /* connects to a host on a specified port, sends a string, and gets a response */
- int process_request(char *server_address, int server_port, char *proto, char *send_buffer, char *recv_buffer, int recv_size){
- 	int result;
- 	int send_result;
- 	int recv_result;
- 	int sd;
- 	struct timeval tv;
- 	fd_set readfds;
- 
- 	result=STATE_OK;
- 
- 	result=my_connect(server_address,server_port,&sd,proto);
- 	if(result!=STATE_OK)
- 		return STATE_CRITICAL;
- 
- 	send_result=send(sd,send_buffer,strlen(send_buffer),0);
- 	if(send_result!=strlen(send_buffer)){
- 		printf("send() failed\n");
- 		result=STATE_WARNING;
- 	        }
- 
- 	/* wait up to the number of seconds for socket timeout minus one for data from the host */
- 	tv.tv_sec=socket_timeout-1;
- 	tv.tv_usec=0;
- 	FD_ZERO(&readfds);
- 	FD_SET(sd,&readfds);
- 	select(sd+1,&readfds,NULL,NULL,&tv);
- 
- 	/* make sure some data has arrived */
- 	if(!FD_ISSET(sd,&readfds)){
- 		strcpy(recv_buffer,"");
- 		printf("No data was recieved from host!\n");
- 		result=STATE_WARNING;
- 	        }
- 
- 	else{
- 		recv_result=recv(sd,recv_buffer,recv_size-1,0);
- 		if(recv_result==-1){
- 			strcpy(recv_buffer,"");
- 			if(!strcmp(proto,"tcp"))
- 				printf("recv() failed\n");
- 			result=STATE_WARNING;
- 	                }
- 		else
- 			recv_buffer[recv_result]='\x0';
- 
- 		/* terminate returned string */
- 		recv_buffer[recv_size-1]='\x0';
- 	        }
- 
- 	close(sd);
- 
- 	return result;
-         }
- 
  
  /* opens a connection to a remote host/tcp port */
--- 33,36 ----
***************
*** 131,144 ****
  
  
- /* opens a connection to a remote host/udp port */
- int my_udp_connect(char *host_name,int port,int *sd){
- 	int result;
- 
- 	result=my_connect(host_name,port,sd,"udp");
- 
- 	return result;
-         }
- 
- 
  /* opens a tcp or udp connection to a remote host */
  int my_connect(char *host_name,int port,int *sd,char *proto){
--- 44,47 ----
***************
*** 317,319 ****
--- 220,296 ----
  
  	return;
+         }
+ 
+ 
+ /* sends all data - thanks to Beej's Guide to Network Programming */
+ int sendall(int s, char *buf, int *len){
+ 	int total=0;
+ 	int bytesleft=*len;
+ 	int n;
+ 
+ 	/* send all the data */
+ 	while(total<*len){
+ 
+ 		/* send some data */
+ 		n=send(s,buf+total,bytesleft,0);
+ 
+ 		/* break on error */
+ 		if(n==-1)
+ 			break;
+ 
+ 		/* apply bytes we sent */
+ 		total+=n;
+ 		bytesleft-=n;
+ 	        }
+ 
+ 	/* return number of bytes actually send here */
+ 	*len=total;
+ 
+ 	/* return -1 on failure, 0 on success */
+ 	return n==-1?-1:0;
+         }
+ 
+ 
+ /* receives all data - modelled after sendall() */
+ int recvall(int s, char *buf, int *len, int timeout){
+ 	int total=0;
+ 	int bytesleft=*len;
+ 	int n;
+ 	time_t start_time;
+ 	time_t current_time;
+ 	
+ 	/* clear the receive buffer */
+ 	bzero(buf,*len);
+ 
+ 	time(&start_time);
+ 
+ 	/* receive all data */
+ 	while(total<*len){
+ 
+ 		/* receive some data */
+ 		n=recv(s,buf+total,bytesleft,0);
+ 
+ 		/* no data has arrived yet (non-blocking socket) */
+ 		if(n==-1 && errno==EAGAIN){
+ 			time(&current_time);
+ 			if(current_time-start_time>timeout)
+ 				break;
+ 			sleep(1);
+ 			continue;
+ 		        }
+ 
+ 		/* receive error or client disconnect */
+ 		else if(n<=0)
+ 			break;
+ 
+ 		/* apply bytes we received */
+ 		total+=n;
+ 		bytesleft-=n;
+ 	        }
+ 
+ 	/* return number of bytes actually received here */
+ 	*len=total;
+ 
+ 	/* return <=0 on failure, bytes received on success */
+ 	return (n<=0)?n:total;
          }

Index: netutils.h
===================================================================
RCS file: /cvsroot/nagios/nrpe/src/netutils.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** netutils.h	23 Jun 2001 17:02:57 -0000	1.1.1.1
--- netutils.h	22 Feb 2002 01:15:34 -0000	1.2
***************
*** 1,7 ****
  /************************************************************************************************
   *
!  * NETUTILS.H - NRPE Network Function Header File
!  * Copyright (c) 1999-2001 Ethan Galstad (nagios at nagios.org)
!  * Last Modified: 06-23-2001
   *
   * Description:
--- 1,10 ----
  /************************************************************************************************
   *
!  * NETUTILS.H - NRPE Network Utilities Include File
!  *
!  * License: GPL
!  * Copyright (c) 1999-2002 Ethan Galstad (nagios at nagios.org)
!  *
!  * Last Modified: 02-21-2002
   *
   * Description:
***************
*** 29,45 ****
  #include "../common/config.h"
  
! void socket_timeout_alarm_handler(int);
! 
! int process_tcp_request(char *address,int port,char *sbuffer,char *rbuffer,int rsize);
! int process_udp_request(char *address,int port,char *sbuffer,char *rbuffer,int rsize);
! int process_request(char *address,int port,char *proto,char *sbuffer,char *rbuffer,int rsize);
  
! int my_tcp_connect(char *address,int port,int *sd);
! int my_udp_connect(char *address,int port,int *sd);
! int my_connect(char *address,int port,int *sd,char *proto);
! 
! int my_inet_aton(register const char *cp, struct in_addr *addr);
  
  void strip(char *);
  
  
--- 32,44 ----
  #include "../common/config.h"
  
! int my_tcp_connect(char *,int,int *);
! int my_connect(char *,int,int *,char *);
  
! int my_inet_aton(register const char *,struct in_addr *);
  
  void strip(char *);
+ 
+ int sendall(int,char *,int *);
+ int recvall(int,char *,int *,int);
  
  

Index: nrpe.c
===================================================================
RCS file: /cvsroot/nagios/nrpe/src/nrpe.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** nrpe.c	23 Jun 2001 17:02:57 -0000	1.1.1.1
--- nrpe.c	22 Feb 2002 01:15:34 -0000	1.2
***************
*** 2,10 ****
   *
   * NRPE.C - Nagios Remote Plugin Executor
!  * Copyright (c) 1999-2001 Ethan Galstad (nagios at nagios.org)
!  * Version: 1.3
   * License: GPL
   *
!  * Last Modified: 06-23-2001
   *
   * Command line: nrpe [-i | -d] <config_file>
--- 2,9 ----
   *
   * NRPE.C - Nagios Remote Plugin Executor
!  * Copyright (c) 1999-2002 Ethan Galstad (nagios at nagios.org)
   * License: GPL
   *
!  * Last Modified: 02-21-2002
   *
   * Command line: nrpe [-i | -d] <config_file>
***************
*** 33,40 ****
  
  
- #define PROGRAM_VERSION "1.3"
- #define MODIFICATION_DATE "06-23-2001"
- 
  #define COMMAND_TIMEOUT		60			/* timeout for execution of plugins */
  
  char allowed_hosts[MAX_INPUT_BUFFER];
--- 32,37 ----
  
  
  #define COMMAND_TIMEOUT		60			/* timeout for execution of plugins */
+ #define MAXFD                   64
  
  char allowed_hosts[MAX_INPUT_BUFFER];
***************
*** 64,67 ****
--- 61,65 ----
  	int error=FALSE;
  	int result;
+ 	int i;
  	char config_file[MAX_INPUT_BUFFER];
  	char buffer[MAX_INPUT_BUFFER];
***************
*** 83,87 ****
  		printf("\n");
  		printf("NRPE - Nagios Remote Plugin Executor\n");
! 		printf("Copyright (c) 1999-2001 Ethan Galstad (nagios at nagios.org)\n");
  		printf("Version: %s\n",PROGRAM_VERSION);
  		printf("Last Modified: %s\n",MODIFICATION_DATE);
--- 81,85 ----
  		printf("\n");
  		printf("NRPE - Nagios Remote Plugin Executor\n");
! 		printf("Copyright (c) 1999-2002 Ethan Galstad (nagios at nagios.org)\n");
  		printf("Version: %s\n",PROGRAM_VERSION);
  		printf("Last Modified: %s\n",MODIFICATION_DATE);
***************
*** 91,96 ****
  		printf("\n");
  		printf("Options:\n");
! 		printf("  -i      Run as a service under inetd\n");
! 		printf("  -d      Run as a standalone daemon without inetd\n");
  		printf("\n");
  		printf("Notes:\n");
--- 89,94 ----
  		printf("\n");
  		printf("Options:\n");
! 		printf("  -i      Run as a service under inetd or xinetd\n");
! 		printf("  -d      Run as a standalone daemon\n");
  		printf("\n");
  		printf("Notes:\n");
***************
*** 150,153 ****
--- 148,171 ----
  	else if(fork()==0){
  
+ 		/* We are in the 1st child, become session leader */
+ 		setsid();
+ 
+ 		/* ignore SIGHUP */
+ 		signal(SIGHUP, SIG_IGN);
+ 
+ 		/* fork again, 1st child exits */
+ 		if(fork()!=0)
+ 			exit(0);
+ 
+ 		/* grandchild process continues... */
+ 	  
+ 		chdir("/");
+ 		umask(0);
+ 
+ 		/*
+ 		for(i=0;i<MAXFD;i++)
+ 			close(i);
+ 		*/
+ 
  		/* wait for connections */
  		wait_for_connections();
***************
*** 477,486 ****
  	packet receive_packet;
  	packet send_packet;
  	char buffer[MAX_INPUT_BUFFER];
  	int result=STATE_OK;
  	int early_timeout=FALSE;
  	int rc;
- 	time_t current_time;
- 	time_t start_time;
  
  
--- 495,504 ----
  	packet receive_packet;
  	packet send_packet;
+ 	int bytes_to_send;
+ 	int bytes_to_recv;
  	char buffer[MAX_INPUT_BUFFER];
  	int result=STATE_OK;
  	int early_timeout=FALSE;
  	int rc;
  
  
***************
*** 492,542 ****
  	fcntl(sock,F_SETFL,O_NONBLOCK);
  
! 	/* clear the request packet buffer */
! 	bzero(&receive_packet,sizeof(receive_packet));
! 
! 	/* get the current time */
! 	time(&start_time);
! 
! 	/* wait for the data from the client */
! 	while(1){
! 
! 		/* read the packet */
! 		rc=recv(sock,(void *)&receive_packet,sizeof(receive_packet),0);
! 
! 		/* we haven't received data, hang around for a bit more */
! 		if(rc==-1 && errno==EAGAIN){
! 			time(&current_time);
! 			if(current_time-start_time>DEFAULT_SOCKET_TIMEOUT){
! 				return;
! 			        }
! 			sleep(1);
! 			continue;
! 		        }
! 
! 		/* the client connection was closed */
! 		else if(rc==0)
! 			return;
! 
! 		/* there was an error receiving data... */
! 		else if(rc==-1){
  
! 			/* log error to syslog facility */
! 			syslog(LOG_ERR,"Could not read request from client, bailing out...");
  
! 			return;
! 	                }
  
! 		/* we couldn't read the correct amount of data, so bail out */
! 		else if(rc!=sizeof(receive_packet)){
  
! 			/* log error to syslog facility */
! 			syslog(LOG_ERR,"Data packet from client was too short, bailing out...");
  
! 			return;
! 		        }
  
! 		/* the packet looks good so far... */
! 		else
! 			break;
  	        }
  
--- 510,532 ----
  	fcntl(sock,F_SETFL,O_NONBLOCK);
  
! 	bytes_to_recv=sizeof(receive_packet);
! 	rc=recvall(sock,(char *)&receive_packet,&bytes_to_recv,socket_timeout);
  
! 	/* recv() error or client disconnect */
! 	if(rc<=0){
  
! 		/* log error to syslog facility */
! 		syslog(LOG_ERR,"Could not read request from client, bailing out...");
  
! 		return;
!                 }
  
! 	/* we couldn't read the correct amount of data, so bail out */
! 	else if(bytes_to_recv!=sizeof(receive_packet)){
  
! 		/* log error to syslog facility */
! 		syslog(LOG_ERR,"Data packet from client was too short, bailing out...");
  
! 		return;
  	        }
  
***************
*** 627,631 ****
  	
  	/* send the response back to the client */
! 	send(sock,(void *)&send_packet,sizeof(send_packet),0);
  
  	/* log info to syslog facility */
--- 617,622 ----
  	
  	/* send the response back to the client */
! 	bytes_to_send=sizeof(send_packet);
! 	sendall(sock,(char *)&send_packet,&bytes_to_send);
  
  	/* log info to syslog facility */
***************
*** 857,863 ****
  	exit(STATE_CRITICAL);
          }
- 
- 
- 
- 
  
--- 848,850 ----

Index: nrpe.h
===================================================================
RCS file: /cvsroot/nagios/nrpe/src/nrpe.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** nrpe.h	23 Jun 2001 17:02:57 -0000	1.1.1.1
--- nrpe.h	22 Feb 2002 01:15:34 -0000	1.2
***************
*** 2,7 ****
   *
   * NRPE.H - NRPE Include File
!  * Copyright (c) 1999-2001 Ethan Galstad (nagios at nagios.org)
!  * Last Modified: 06-23-2001
   *
   * License:
--- 2,7 ----
   *
   * NRPE.H - NRPE Include File
!  * Copyright (c) 1999-2002 Ethan Galstad (nagios at nagios.org)
!  * Last Modified: 02-21-2002
   *
   * License:





More information about the Nagios-commits mailing list