Browse Source

"nginx" module update

lgz 7 years ago
parent
commit
6b1f33b5cf
2 changed files with 9 additions and 7 deletions
  1. 1 1
      conf.d/python.d/nginx.conf
  2. 8 6
      python.d/nginx.chart.py

+ 1 - 1
conf.d/python.d/nginx.conf

@@ -99,5 +99,5 @@ localipv4:
 
 localipv6:
   name : 'local'
-  url  : 'http://::1/stub_status'
+  url  : 'http://[::1]/stub_status'
 

+ 8 - 6
python.d/nginx.chart.py

@@ -2,7 +2,7 @@
 # Description: nginx netdata python.d module
 # Author: Pawel Krupa (paulfantom)
 
-from base import UrlService
+from bases.FrameworkServices.UrlService import UrlService
 
 # default module values (can be overridden per job in `config`)
 # update_every = 2
@@ -22,7 +22,8 @@ ORDER = ['connections', 'requests', 'connection_status', 'connect_rate']
 
 CHARTS = {
     'connections': {
-        'options': [None, 'nginx Active Connections', 'connections', 'active connections', 'nginx.connections', 'line'],
+        'options': [None, 'nginx Active Connections', 'connections', 'active connections',
+                    'nginx.connections', 'line'],
         'lines': [
             ["active"]
         ]},
@@ -32,14 +33,16 @@ CHARTS = {
             ["requests", None, 'incremental']
         ]},
     'connection_status': {
-        'options': [None, 'nginx Active Connections by Status', 'connections', 'status', 'nginx.connection_status', 'line'],
+        'options': [None, 'nginx Active Connections by Status', 'connections', 'status',
+                    'nginx.connection_status', 'line'],
         'lines': [
             ["reading"],
             ["writing"],
             ["waiting", "idle"]
         ]},
     'connect_rate': {
-        'options': [None, 'nginx Connections Rate', 'connections/s', 'connections rate', 'nginx.connect_rate', 'line'],
+        'options': [None, 'nginx Connections Rate', 'connections/s', 'connections rate',
+                    'nginx.connect_rate', 'line'],
         'lines': [
             ["accepts", "accepted", "incremental"],
             ["handled", None, "incremental"]
@@ -50,8 +53,7 @@ CHARTS = {
 class Service(UrlService):
     def __init__(self, configuration=None, name=None):
         UrlService.__init__(self, configuration=configuration, name=name)
-        if len(self.url) == 0:
-            self.url = "http://localhost/stub_status"
+        self.url = self.configuration.get('url', 'http://localhost/stub_status')
         self.order = ORDER
         self.definitions = CHARTS