[monitoring-plugins] check_curl: support check_http arguments for ...

Sven Nierlein git at monitoring-plugins.org
Sat Mar 18 23:50:12 CET 2017


 Module: monitoring-plugins
 Branch: feature_check_curl
 Commit: 572a22a2b56837bbc7326a98ae32743a29600147
 Author: Sven Nierlein <sven at nierlein.de>
   Date: Sat Mar 18 22:55:37 2017 +0100
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=572a22a

check_curl: support check_http arguments for backwards compatibility

---

 plugins/check_curl.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index 20ac5b7..ccbc6a8 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -573,6 +573,20 @@ process_arguments (int argc, char **argv)
   if (argc < 2)
     return ERROR;
 
+  /* support check_http compatible arguments */
+  for (c = 1; c < argc; c++) {
+    if (strcmp ("-to", argv[c]) == 0)
+      strcpy (argv[c], "-t");
+    if (strcmp ("-hn", argv[c]) == 0)
+      strcpy (argv[c], "-H");
+    if (strcmp ("-wt", argv[c]) == 0)
+      strcpy (argv[c], "-w");
+    if (strcmp ("-ct", argv[c]) == 0)
+      strcpy (argv[c], "-c");
+    if (strcmp ("-nohtml", argv[c]) == 0)
+      strcpy (argv[c], "-n");
+  }
+
   while (1) {
     c = getopt_long (argc, argv, "Vvh46t:c:w:A:k:H:j:I:a:p:s:R:r:u:f:C:J:K:S::m:NE", longopts, &option);
     if (c == -1 || c == EOF || c == 1)



More information about the Commits mailing list