Showing 1 changed files with 6 additions and 6 deletions
+6 -6
monitoring.d/raspberrypi
... ...
@@ -22,17 +22,17 @@ function webapps () {
22 22
     awk -v sq="'" '
23 23
         /^[^#]+#\s*monitoring\s/ {
24 24
             if ($1 == "listen") {
25
-                port = ":" gensub(";", "", "", $2)
26
-                proto = gensub(";", "", "", $3) == "ssl" ? "https" : "http"
27
-                pname = gensub(/^\s*listen\s.+#\s*monitoring\s+/,"", "")
25
+                port = ":" gensub(";", "", "1", $2)
26
+                proto = gensub(";", "", "1", $3) == "ssl" ? "https" : "http"
27
+                pname = gensub(/^\s*listen\s.+#\s*monitoring\s+/, "1", "")
28 28
                 if (proto == "https" && port == ":443") port = ""
29 29
             }
30 30
             if ($1 == "server_name") {
31
-                server_name = gensub(";", "", "", $2)
32
-                sname = gensub(/^\s*server_name\s.+#\s*monitoring\s+/,"", "")
31
+                server_name = gensub(";", "", "1", $2)
32
+                sname = gensub(/^\s*server_name\s.+#\s*monitoring\s+/, "1", "")
33 33
             }
34 34
             if ($1 == "location" && sname != "" && pname != "" && sname == pname) {
35
-                l=gensub(/^\s*location\s[^\/]*(\/.*)\{\s*#\s*monitoring\s+(.+)$/,"\\1,\\2", "")
35
+                l=gensub(/^\s*location\s[^\/]*(\/.*)\{\s*#\s*monitoring\s+(.+)$/,"\\1,\\2", "1")
36 36
                 split(l, location, /\s*,\s*/)
37 37
                 if (location[2] == sname) {
38 38
                     monitoring[location[2]][location[1]]["monitoring"] = location[3]