[Nagiosplug-checkins] CVS: nagiosplug/plugins check_load.c,1.5,1.6

Ton Voon tonvoon at users.sourceforge.net
Tue Feb 18 14:12:09 CET 2003


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

Modified Files:
	check_load.c 
Log Message:
Fixed the output messages (Bug 688729 - Jayjay)


Index: check_load.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_load.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** check_load.c	13 Jan 2003 12:15:16 -0000	1.5
--- check_load.c	18 Feb 2003 22:10:55 -0000	1.6
***************
*** 55,58 ****
--- 55,60 ----
  float cload1 = -1, cload5 = -1, cload15 = -1;
  
+ char *status_line = "";
+ 
  int
  main (int argc, char **argv)
***************
*** 131,144 ****
  		return STATE_UNKNOWN;
  	}
! 	printf ("load average: %.2f, %.2f, %.2f", la1, la5, la15);
  	if ((la1 >= cload1) || (la5 >= cload5) || (la15 >= cload15)) {
! 		printf (" CRITICAL\n");
  		return STATE_CRITICAL;
  	}
  	if ((la1 >= wload1) || (la5 >= wload5) || (la15 >= wload15)) {
! 		printf (" WARNING\n");
  		return STATE_WARNING;
  	}
! 	printf ("\n");
  	return STATE_OK;
  }
--- 133,146 ----
  		return STATE_UNKNOWN;
  	}
! 	asprintf(&status_line, "load average: %.2f, %.2f, %.2f", la1, la5, la15);
  	if ((la1 >= cload1) || (la5 >= cload5) || (la15 >= cload15)) {
! 		printf("CRITICAL - %s\n", status_line);
  		return STATE_CRITICAL;
  	}
  	if ((la1 >= wload1) || (la5 >= wload5) || (la15 >= wload15)) {
! 		printf ("WARNING - %s\n", status_line);
  		return STATE_WARNING;
  	}
! 	printf ("OK - %s\n", status_line);
  	return STATE_OK;
  }





More information about the Commits mailing list