[Nagiosplug-checkins] CVS: nagiosplug/plugins check_disk.c,1.8,1.9

Ton Voon tonvoon at users.sourceforge.net
Sun Mar 9 02:40:03 CET 2003


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

Modified Files:
	check_disk.c 
Log Message:
Implement error-only option for check_disk (Ian Duggan)


Index: check_disk.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_disk.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** check_disk.c	8 Mar 2003 12:08:24 -0000	1.8
--- check_disk.c	9 Mar 2003 10:39:49 -0000	1.9
***************
*** 55,58 ****
--- 55,59 ----
  char *exclude_device = "";
  int verbose = 0;
+ int erronly = FALSE;
  int display_mntp = FALSE;
  
***************
*** 118,121 ****
--- 119,125 ----
  				strncpy (file_system, mntp, MAX_INPUT_BUFFER-1);
  
+ 			if (disk_result==STATE_OK && erronly && !verbose)
+ 				continue;
+ 
  			if (disk_result!=STATE_OK || verbose>=0) 
  				asprintf (&output, "%s [%d kB (%d%%) free on %s]", output,
***************
*** 173,176 ****
--- 177,181 ----
  		{"verbose", no_argument, 0, 'v'},
  		{"version", no_argument, 0, 'V'},
+ 		{"errors-only", no_argument, 0, 'e'},
  		{"help", no_argument, 0, 'h'},
  		{"mountpoint", no_argument, 0, 'm'},
***************
*** 192,198 ****
  #ifdef HAVE_GETOPT_H
  		c =
!  			getopt_long (argc, argv, "+?Vqhvt:c:w:p:x:m", long_options, &option_index);
  #else
!  		c = getopt (argc, argv, "+?Vqhvt:c:w:p:x:m");
  #endif
  
--- 197,203 ----
  #ifdef HAVE_GETOPT_H
  		c =
!  			getopt_long (argc, argv, "+?Vqhvet:c:w:p:x:m", long_options, &option_index);
  #else
!  		c = getopt (argc, argv, "+?Vqhvet:c:w:p:x:m");
  #endif
  
***************
*** 249,252 ****
--- 254,260 ----
  		case 'q':									/* verbose */
  			verbose--;
+ 			break;
+ 		case 'e':
+ 			erronly = TRUE;
  			break;
  		case 'm': /* display mountpoint */





More information about the Commits mailing list