summaryrefslogtreecommitdiffstats
path: root/web/attachments/309099-check_disk.txt
blob: 500ab185abc555610cb3590e4de2238800737285 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
*** plugins/check_disk.c.orig	Thu Jul 10 11:03:55 2008
--- plugins/check_disk.c	Wed Jan 14 11:49:37 2009
***************
*** 155,160 ****
--- 155,161 ----
  int path_selected = FALSE;
  char *group = NULL;
  struct stat *stat_buf;
+ int no_match_ok = 0;
  
  
  int
***************
*** 493,498 ****
--- 494,500 ----
      {"ignore-ereg-partition", required_argument, 0, 'i'},
      {"ignore-eregi-path", required_argument, 0, 'I'},
      {"ignore-eregi-partition", required_argument, 0, 'I'},
+     {"no-match-ok", no_argument, 0, 'n'},
      {"local", no_argument, 0, 'l'},
      {"stat-remote-fs", no_argument, 0, 'L'},
      {"mountpoint", no_argument, 0, 'M'},
***************
*** 517,523 ****
        strcpy (argv[c], "-t");
  
    while (1) {
!     c = getopt_long (argc, argv, "+?VqhveCt:c:w:K:W:u:p:x:X:mklLg:R:r:i:I:MEA", longopts, &option);
  
      if (c == -1 || c == EOF)
        break;
--- 519,525 ----
        strcpy (argv[c], "-t");
  
    while (1) {
!     c = getopt_long (argc, argv, "+?VqhveCt:c:w:K:W:u:p:x:X:mklLg:R:r:i:I:MEAn", longopts, &option);
  
      if (c == -1 || c == EOF)
        break;
***************
*** 669,674 ****
--- 671,679 ----
          die (STATE_UNKNOWN, "DISK %s: %s", _("UNKNOWN"), _("Must set group value before selecting pathes \n"));
        group = optarg;
        break;
+     case 'n':                 /* Don't complain if a regular expression doesn't match anything */
+       no_match_ok = 1;
+       break;
      case 'I':
        cflags |= REG_ICASE;
      case 'i':
***************
*** 741,747 ****
          }
        }
  
!       if (!fnd)
          die (STATE_UNKNOWN, "DISK %s: %s - %s\n",_("UNKNOWN"),
              _("Regular expression did not match any path or disk"), optarg);
  
--- 746,752 ----
          }
        }
  
!       if (!fnd && !no_match_ok)
          die (STATE_UNKNOWN, "DISK %s: %s - %s\n",_("UNKNOWN"),
              _("Regular expression did not match any path or disk"), optarg);