[Nagiosplug-checkins] CVS: nagiosplug/plugins check_disk.c,1.7.2.1,1.7.2.2
Ton Voon
tonvoon at users.sourceforge.net
Sun Mar 9 02:37:01 CET 2003
Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv27394
Modified Files:
Tag: r1_3_0
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.7.2.1
retrieving revision 1.7.2.2
diff -C2 -r1.7.2.1 -r1.7.2.2
*** check_disk.c 8 Mar 2003 12:05:14 -0000 1.7.2.1
--- check_disk.c 9 Mar 2003 10:36:02 -0000 1.7.2.2
***************
*** 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