[Nagiosplug-checkins] CVS: nagiosplug/plugins check_mrtgtraf.c,1.3,1.4

Ton Voon tonvoon at users.sourceforge.net
Wed Jan 29 12:58:03 CET 2003


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

Modified Files:
	check_mrtgtraf.c 
Log Message:
Fixed error and success codes (638656 - Paul Dlug)


Index: check_mrtgtraf.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_mrtgtraf.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** check_mrtgtraf.c	13 Jan 2003 12:15:16 -0000	1.3
--- check_mrtgtraf.c	29 Jan 2003 20:57:09 -0000	1.4
***************
*** 198,204 ****
  			|| outgoing_rate > outgoing_critical_threshold) {
  		result = STATE_CRITICAL;
! 		asprintf (&error_message, "%s. In = %0.1f %s, %s. Out = %0.1f %s",
! 						 (use_average == TRUE) ? "Ave" : "Max", adjusted_incoming_rate,
! 						 incoming_speed_rating, (use_average == TRUE) ? "Ave" : "Max",
  						 adjusted_outgoing_rate, outgoing_speed_rating);
  	}
--- 198,204 ----
  			|| outgoing_rate > outgoing_critical_threshold) {
  		result = STATE_CRITICAL;
! 		asprintf (&error_message, "Traffic CRITICAL %s. In = %0.1f %s, %s. Out = %0.1f %s",
! 						 (use_average == TRUE) ? "Avg" : "Max", adjusted_incoming_rate,
! 						 incoming_speed_rating, (use_average == TRUE) ? "Avg" : "Max",
  						 adjusted_outgoing_rate, outgoing_speed_rating);
  	}
***************
*** 206,222 ****
  					 || outgoing_rate > outgoing_warning_threshold) {
  		result = STATE_WARNING;
! 		asprintf (&error_message, "%s. In = %0.1f %s, %s. Out = %0.1f %s",
! 						 (use_average == TRUE) ? "Ave" : "Max", adjusted_incoming_rate,
! 						 incoming_speed_rating, (use_average == TRUE) ? "Ave" : "Max",
  						 adjusted_outgoing_rate, outgoing_speed_rating);
  	}
! 
! 	if (result == STATE_OK)
! 		printf ("Traffic ok - %s. In = %0.1f %s, %s. Out = %0.1f %s\n",
! 						(use_average == TRUE) ? "Ave" : "Max", adjusted_incoming_rate,
! 						incoming_speed_rating, (use_average == TRUE) ? "Ave" : "Max",
  						adjusted_outgoing_rate, outgoing_speed_rating);
  	else
! 		printf ("%s\n", error_message);
  
  	return result;
--- 206,221 ----
  					 || outgoing_rate > outgoing_warning_threshold) {
  		result = STATE_WARNING;
! 		asprintf (&error_message, "Traffic WARNING %s. In = %0.1f %s, %s. Out = %0.1f %s",
! 						 (use_average == TRUE) ? "Avg" : "Max", adjusted_incoming_rate,
! 						 incoming_speed_rating, (use_average == TRUE) ? "Avg" : "Max",
  						 adjusted_outgoing_rate, outgoing_speed_rating);
  	}
! 	else if (result == STATE_OK)
! 		printf ("Traffic OK - %s. In = %0.1f %s, %s. Out = %0.1f %s\n",
! 						(use_average == TRUE) ? "Avg" : "Max", adjusted_incoming_rate,
! 						incoming_speed_rating, (use_average == TRUE) ? "Avg" : "Max",
  						adjusted_outgoing_rate, outgoing_speed_rating);
  	else
! 		printf ("UNKNOWN %s\n", error_message);
  
  	return result;





More information about the Commits mailing list