]> arthur.barton.de Git - netdata.git/commitdiff
move squid autodetection only to configuration file
authorpaulfantom <paulfantom@gmail.com>
Wed, 6 Jul 2016 08:06:58 +0000 (10:06 +0200)
committerpaulfantom <paulfantom@gmail.com>
Wed, 6 Jul 2016 08:06:58 +0000 (10:06 +0200)
conf.d/python.d/squid.conf [new file with mode: 0644]
python.d/squid.chart.py

diff --git a/conf.d/python.d/squid.conf b/conf.d/python.d/squid.conf
new file mode 100644 (file)
index 0000000..8bbbfb5
--- /dev/null
@@ -0,0 +1,29 @@
+# Example configuration of mysql.chart.py
+# YAML format
+
+update_every: 1
+
+tcp1:
+  name     : 'local'
+  host:    : 'localhost'
+  port     : 3128
+  request  : 'cache_object://localhost:3128/counters'
+
+tcp2:
+  name     : 'local'
+  host:    : 'localhost'
+  port     : 8080
+  request  : 'cache_object://localhost:3128/counters'
+
+tcp3:
+  name     : 'local'
+  host:    : 'localhost'
+  port     : 3128
+  request  : 'squid-internal-mgr//counters'
+
+tcp4:
+  name     : 'local'
+  host:    : 'localhost'
+  port     : 8080
+  request  : 'squid-internal-mgr//counters'
+
index a16cb0a4e14f2e39eceb96c97148ed63c5985e25..726822dc418d36ff1ff8058ab769e0fcafcfb790 100644 (file)
@@ -83,20 +83,21 @@ class Service(NetSocketService):
         if not req.endswith(" HTTP/1.0\r\n\r\n"):
             req += " HTTP/1.0\r\n\r\n"
         self.request = req.encode()
-
-        # autodetect squid
-        if type(self.port) is tuple:
-            ports = self.port
-            for port in ports:
-                self.port = port
-                urls = ["cache_object://" + self.host + ":" + str(port) + "/counters",
-                        "/squid-internal-mgr/counters"]
-                for url in urls:
-                    tmp = "GET " + url + " HTTP/1.0\r\n\r\n"
-                    self.request = tmp.encode()
-                    if self._get_data() is not None:
-                        return True
-        else:
+        #
+        # # autodetect squid
+        # if type(self.port) is tuple:
+        #     ports = self.port
+        #     for port in ports:
+        #         self.port = port
+        #         urls = ["cache_object://" + self.host + ":" + str(port) + "/counters",
+        #                 "/squid-internal-mgr/counters"]
+        #         for url in urls:
+        #             tmp = "GET " + url + " HTTP/1.0\r\n\r\n"
+        #             self.request = tmp.encode()
+        #             if self._get_data() is not None:
+        #                 return True
+        # else:
+        if True:
             if self._get_data() is not None:
                 return True
             else: