[Nagiosplug-checkins] CVS: nagiosplug/plugins check_hpjd.c,1.9,1.10 check_nt.c,1.10,1.11

Ton Voon tonvoon at users.sourceforge.net
Tue Apr 8 13:38:03 CEST 2003


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv22997

Modified Files:
	check_hpjd.c check_nt.c 
Log Message:
Changed // to /* */ comments as some compilers do not like them


Index: check_hpjd.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_hpjd.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** check_hpjd.c	11 Mar 2003 22:22:09 -0000	1.9
--- check_hpjd.c	8 Apr 2003 20:37:12 -0000	1.10
***************
*** 520,527 ****
  	}
  
! 	// get the IP address of the JetDirect device
  	strcpy(address,argv[1]);
  	
! 	// get the community name to use for SNMP communication
  	if(argc>=3)
  	strcpy(community,argv[2]);
--- 520,527 ----
  	}
  
! 	/* get the IP address of the JetDirect device */
  	strcpy(address,argv[1]);
  	
! 	/* get the community name to use for SNMP communication */
  	if(argc>=3)
  	strcpy(community,argv[2]);

Index: check_nt.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_nt.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** check_nt.c	24 Mar 2003 00:26:31 -0000	1.10
--- check_nt.c	8 Apr 2003 20:37:13 -0000	1.11
***************
*** 29,33 ****
   *****************************************************************************/
  
- //#include "stdlib.h"
  #include "config.h"
  #include "common.h"
--- 29,32 ----
***************
*** 122,126 ****
  		if (check_value_list==TRUE) {																			
  			if (strtolarray(&lvalue_list,value_list,",")==TRUE) {
! 				// -l parameters is present with only integers
  				return_code=STATE_OK;
  				asprintf(&temp_string,"CPU Load");
--- 121,125 ----
  		if (check_value_list==TRUE) {																			
  			if (strtolarray(&lvalue_list,value_list,",")==TRUE) {
! 				/* -l parameters is present with only integers */
  				return_code=STATE_OK;
  				asprintf(&temp_string,"CPU Load");
***************
*** 128,134 ****
  							lvalue_list[1+offset]>=0 && lvalue_list[1+offset]<=100 && 
  							lvalue_list[2+offset]>=0 && lvalue_list[2+offset]<=100) {
! 					// loop until one of the parameters is wrong or not present
  
! 					// Send request and retrieve data
  					asprintf(&send_buffer,"%s&2&%lu",req_password,lvalue_list[0+offset]);
  					result=process_tcp_request(server_address,server_port,send_buffer,recv_buffer,sizeof(recv_buffer));
--- 127,133 ----
  							lvalue_list[1+offset]>=0 && lvalue_list[1+offset]<=100 && 
  							lvalue_list[2+offset]>=0 && lvalue_list[2+offset]<=100) {
! 					/* loop until one of the parameters is wrong or not present */
  
! 					/* Send request and retrieve data */
  					asprintf(&send_buffer,"%s&2&%lu",req_password,lvalue_list[0+offset]);
  					result=process_tcp_request(server_address,server_port,send_buffer,recv_buffer,sizeof(recv_buffer));
***************
*** 143,147 ****
  					utilization=strtoul(recv_buffer,NULL,10);
  
! 					// Check if any of the request is in a warning or critical state
  					if(utilization >= lvalue_list[2+offset])
  						return_code=STATE_CRITICAL;
--- 142,146 ----
  					utilization=strtoul(recv_buffer,NULL,10);
  
! 					/* Check if any of the request is in a warning or critical state */
  					if(utilization >= lvalue_list[2+offset])
  						return_code=STATE_CRITICAL;
***************
*** 151,158 ****
  					asprintf(&output_message," %lu%% (%lu min average)", utilization, lvalue_list[0+offset]);
  					asprintf(&temp_string,"%s%s",temp_string,output_message);
! 					offset+=3;	//move across the array 
  				}		
  				if (strlen(temp_string)>10) {
! 					// we had at least on loop
  					asprintf(&output_message,"%s",temp_string);
  				}	
--- 150,157 ----
  					asprintf(&output_message," %lu%% (%lu min average)", utilization, lvalue_list[0+offset]);
  					asprintf(&temp_string,"%s%s",temp_string,output_message);
! 					offset+=3;	/* move across the array */
  				}		
  				if (strlen(temp_string)>10) {
! 					/* we had at least on loop */
  					asprintf(&output_message,"%s",temp_string);
  				}	
***************
*** 237,241 ****
  
  		if (check_value_list==TRUE) {
! 			preparelist(value_list);		// replace , between services with & to send the request
  			asprintf(&send_buffer,"%s&%u&%s&%s", req_password,(vars_to_check==CHECK_SERVICESTATE)?5:6,
  				(show_all==TRUE)?"ShowAll":"ShowFail",value_list);
--- 236,240 ----
  
  		if (check_value_list==TRUE) {
! 			preparelist(value_list);		/* replace , between services with & to send the request */
  			asprintf(&send_buffer,"%s&%u&%s&%s", req_password,(vars_to_check==CHECK_SERVICESTATE)?5:6,
  				(show_all==TRUE)?"ShowAll":"ShowFail",value_list);
***************
*** 287,291 ****
  
  		if (check_value_list==TRUE) {																			
! 			preparelist(value_list);		// replace , between services with & to send the request
  			asprintf(&send_buffer,"%s&8&%s", req_password,value_list);
  			result=process_tcp_request(server_address,server_port,send_buffer,recv_buffer,sizeof(recv_buffer));
--- 286,290 ----
  
  		if (check_value_list==TRUE) {																			
! 			preparelist(value_list);		/* replace , between services with & to send the request */
  			asprintf(&send_buffer,"%s&8&%s", req_password,value_list);
  			result=process_tcp_request(server_address,server_port,send_buffer,recv_buffer,sizeof(recv_buffer));
***************
*** 298,302 ****
  			}
  
! 			strtok(value_list,"&");			// burn the first parameters
  			description = strtok(NULL,"&");
  			counter_value = atof(recv_buffer);
--- 297,301 ----
  			}
  
! 			strtok(value_list,"&");			/* burn the first parameters */
  			description = strtok(NULL,"&");
  			counter_value = atof(recv_buffer);
***************
*** 307,311 ****
  	
  			if (critical_value > warning_value) {
! 				// Normal thresholds		
  				if(check_critical_value==TRUE && counter_value >= critical_value)
  					return_code=STATE_CRITICAL;
--- 306,310 ----
  	
  			if (critical_value > warning_value) {
! 				/* Normal thresholds */
  				if(check_critical_value==TRUE && counter_value >= critical_value)
  					return_code=STATE_CRITICAL;
***************
*** 316,320 ****
  			} 
  			else {
! 				// inverse thresholds		
  				if(check_critical_value==TRUE && counter_value <= critical_value)
  					return_code=STATE_CRITICAL;
--- 315,319 ----
  			} 
  			else {
! 				/* inverse thresholds */
  				if(check_critical_value==TRUE && counter_value <= critical_value)
  					return_code=STATE_CRITICAL;
***************
*** 334,338 ****
  
  		if (check_value_list==TRUE) {																			
! 			preparelist(value_list);		// replace , between services with & to send the request
  			asprintf(&send_buffer,"%s&9&%s", req_password,value_list);
  			result=process_tcp_request(server_address,server_port,send_buffer,recv_buffer,sizeof(recv_buffer));
--- 333,337 ----
  
  		if (check_value_list==TRUE) {																			
! 			preparelist(value_list);		/* replace , between services with & to send the request */
  			asprintf(&send_buffer,"%s&9&%s", req_password,value_list);
  			result=process_tcp_request(server_address,server_port,send_buffer,recv_buffer,sizeof(recv_buffer));
***************
*** 350,354 ****
  	
  			if (critical_value > warning_value) {
! 				// Normal thresholds		
  				if(check_critical_value==TRUE && age_in_minutes >= critical_value)
  					return_code=STATE_CRITICAL;
--- 349,353 ----
  	
  			if (critical_value > warning_value) {
! 				/* Normal thresholds */
  				if(check_critical_value==TRUE && age_in_minutes >= critical_value)
  					return_code=STATE_CRITICAL;
***************
*** 359,363 ****
  			} 
  			else {
! 				// inverse thresholds		
  				if(check_critical_value==TRUE && age_in_minutes <= critical_value)
  					return_code=STATE_CRITICAL;
--- 358,362 ----
  			} 
  			else {
! 				/* inverse thresholds */
  				if(check_critical_value==TRUE && age_in_minutes <= critical_value)
  					return_code=STATE_CRITICAL;
***************
*** 564,568 ****
  
  int strtolarray(unsigned long *array, char *string, char *delim) {
! 	// split a <delim> delimited string into a long array
  	int idx=0;
  	char *t1;
--- 563,567 ----
  
  int strtolarray(unsigned long *array, char *string, char *delim) {
! 	/* split a <delim> delimited string into a long array */
  	int idx=0;
  	char *t1;
***************
*** 583,587 ****
  
  void preparelist(char *string) {
! 	// Replace all , with & which is the delimiter for the request
  	int i;
  
--- 582,586 ----
  
  void preparelist(char *string) {
! 	/* Replace all , with & which is the delimiter for the request */
  	int i;
  





More information about the Commits mailing list