[monitoring-plugins] check_disk: add -n short option for ...

Sven Nierlein git at monitoring-plugins.org
Mon Nov 27 16:00:13 CET 2023


 Module: monitoring-plugins
 Branch: master
 Commit: f59c51601122ceac7ef4571d1993a34728e76813
 Author: Sven Nierlein <sven at consol.de>
   Date: Mon Nov 27 11:35:29 2023 +0100
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=f59c516

check_disk: add -n short option for --ignore-missing

Signed-off-by: Sven Nierlein <sven at consol.de>

---

 plugins/check_disk.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index a4180ca..e9a9ddd 100644
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
@@ -112,8 +112,7 @@ enum
 {
   SYNC_OPTION = CHAR_MAX + 1,
   NO_SYNC_OPTION,
-  BLOCK_SIZE_OPTION,
-  IGNORE_MISSING
+  BLOCK_SIZE_OPTION
 };
 
 #ifdef _AIX
@@ -524,7 +523,7 @@ process_arguments (int argc, char **argv)
     {"ignore-ereg-partition", required_argument, 0, 'i'},
     {"ignore-eregi-path", required_argument, 0, 'I'},
     {"ignore-eregi-partition", required_argument, 0, 'I'},
-    {"ignore-missing", no_argument, 0, IGNORE_MISSING},
+    {"ignore-missing", no_argument, 0, 'n'},
     {"local", no_argument, 0, 'l'},
     {"stat-remote-fs", no_argument, 0, 'L'},
     {"iperfdata", no_argument, 0, 'P'},
@@ -550,7 +549,7 @@ process_arguments (int argc, char **argv)
       strcpy (argv[c], "-t");
 
   while (1) {
-    c = getopt_long (argc, argv, "+?VqhvefCt:c:w:K:W:u:p:x:X:N:mklLPg:R:r:i:I:MEA", longopts, &option);
+    c = getopt_long (argc, argv, "+?VqhvefCt:c:w:K:W:u:p:x:X:N:mklLPg:R:r:i:I:MEAn", longopts, &option);
 
     if (c == -1 || c == EOF)
       break;
@@ -792,7 +791,7 @@ process_arguments (int argc, char **argv)
       cflags = default_cflags;
       break;
 
-    case IGNORE_MISSING:
+    case 'n':
       ignore_missing = true;
       break;
     case 'A':
@@ -1004,7 +1003,7 @@ print_help (void)
   printf ("    %s\n", _("Regular expression to ignore selected path/partition (case insensitive) (may be repeated)"));
   printf (" %s\n", "-i, --ignore-ereg-path=PATH, --ignore-ereg-partition=PARTITION");
   printf ("    %s\n", _("Regular expression to ignore selected path or partition (may be repeated)"));
-  printf (" %s\n", "--ignore-missing");
+  printf (" %s\n", "-n, --ignore-missing");
   printf ("    %s\n", _("Return OK if no filesystem matches, filesystem does not exist or is inaccessible."));
   printf ("    %s\n", _("(Provide this option before -p / -r / --ereg-path if used)"));
   printf (UT_PLUG_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);



More information about the Commits mailing list