[Nagiosplug-checkins] CVS: nagiosplug/plugins check_swap.c,1.21,1.22

Ton Voon tonvoon at users.sourceforge.net
Tue Nov 11 02:20:04 CET 2003


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

Modified Files:
	check_swap.c 
Log Message:
Fixed if only absolute warn/crit set


Index: check_swap.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_swap.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** check_swap.c	30 Sep 2003 13:54:26 -0000	1.21
--- check_swap.c	11 Nov 2003 10:19:29 -0000	1.22
***************
*** 41,46 ****
  void print_help (void);
  
! int warn_percent = 200;
! int crit_percent = 200;
  long unsigned int warn_size = 0;
  long unsigned int crit_size = 0;
--- 41,46 ----
  void print_help (void);
  
! int warn_percent = 0;
! int crit_percent = 0;
  long unsigned int warn_size = 0;
  long unsigned int crit_size = 0;
***************
*** 234,242 ****
  {
  	int result = STATE_UNKNOWN;
! 	if (usp >= 0 && usp >= (100.0 - crit_percent))
  		result = STATE_CRITICAL;
  	else if (crit_size > 0 && free_swap <= crit_size)
  		result = STATE_CRITICAL;
! 	else if (usp >= 0 && usp >= (100.0 - warn_percent))
  		result = STATE_WARNING;
  	else if (warn_size > 0 && free_swap <= warn_size)
--- 234,243 ----
  {
  	int result = STATE_UNKNOWN;
! 	free_swap = free_swap * 1024;		/* Convert back to bytes as warn and crit specified in bytes */
! 	if (usp >= 0 && crit_percent != 0 && usp >= (100.0 - crit_percent))
  		result = STATE_CRITICAL;
  	else if (crit_size > 0 && free_swap <= crit_size)
  		result = STATE_CRITICAL;
! 	else if (usp >= 0 && warn_percent != 0 && usp >= (100.0 - warn_percent))
  		result = STATE_WARNING;
  	else if (warn_size > 0 && free_swap <= warn_size)





More information about the Commits mailing list