Showing 1 changed files with 7 additions and 2 deletions
+7 -2
monitoring.d/raspberrypi
... ...
@@ -24,12 +24,12 @@ function webapps () {
24 24
             if ($1 == "listen") {
25 25
                 port = ":" gensub(";", "", "1", $2)
26 26
                 proto = gensub(";", "", "1", $3) == "ssl" ? "https" : "http"
27
-                pname = gensub(/^\s*listen\s.+#\s*monitoring\s+/, "1", "")
27
+                pname = gensub(/^\s*listen\s.+#\s*monitoring\s+/, "1", "1")
28 28
                 if (proto == "https" && port == ":443") port = ""
29 29
             }
30 30
             if ($1 == "server_name") {
31 31
                 server_name = gensub(";", "", "1", $2)
32
-                sname = gensub(/^\s*server_name\s.+#\s*monitoring\s+/, "1", "")
32
+                sname = gensub(/^\s*server_name\s.+#\s*monitoring\s+/, "1", "1")
33 33
             }
34 34
             if ($1 == "location" && sname != "" && pname != "" && sname == pname) {
35 35
                 l=gensub(/^\s*location\s[^\/]*(\/.*)\{\s*#\s*monitoring\s+(.+)$/,"\\1,\\2", "1")
... ...
@@ -61,6 +61,11 @@ function webapps () {
61 61
     ' /etc/nginx/sites-enabled/*
62 62
 }
63 63
 
64
+function section () {
65
+    nc -zw5 cloud.paris12.pcf.fr 443 || echo "cloud inaccessible"
66
+    nc -zw5 cloud.paris12.pcf.fr 2200 || echo "section inaccessible"
67
+}
68
+
64 69
 function core_temp () {
65 70
     local min=60
66 71
     local level=("warning" "severe" "danger!")