"nginx" module update
lgz committed
Oct 15, 2017 at 00:29 UTC
6b1f33b5cfe838fc5aa968616ec7baf96963a09c
2 files changed
+9
-7
conf.d/python.d/nginx.conf
+1
-1
@@ -99,5 +99,5 @@ localipv4:
99
100
localipv6:
101
name : 'local'
102
- url : 'http://::1/stub_status'
102
+ url : 'http://[::1]/stub_status'
103
python.d/nginx.chart.py
+8
-6
@@ -2,7 +2,7 @@
2
# Description: nginx netdata python.d module
3
# Author: Pawel Krupa (paulfantom)
4
5
-from base import UrlService
5
+from bases.FrameworkServices.UrlService import UrlService
6
7
# default module values (can be overridden per job in `config`)
8
# update_every = 2
@@ -22,7 +22,8 @@ ORDER = ['connections', 'requests', 'connection_status', 'connect_rate']
22
23
CHARTS = {
24
'connections': {
25
- 'options': [None, 'nginx Active Connections', 'connections', 'active connections', 'nginx.connections', 'line'],
25
+ 'options': [None, 'nginx Active Connections', 'connections', 'active connections',
26
+ 'nginx.connections', 'line'],
27
'lines': [
28
["active"]
29
]},
@@ -32,14 +33,16 @@ CHARTS = {
33
["requests", None, 'incremental']
34
]},
35
'connection_status': {
35
- 'options': [None, 'nginx Active Connections by Status', 'connections', 'status', 'nginx.connection_status', 'line'],
36
+ 'options': [None, 'nginx Active Connections by Status', 'connections', 'status',
37
+ 'nginx.connection_status', 'line'],
38
'lines': [
39
["reading"],
40
["writing"],
41
["waiting", "idle"]
42
]},
43
'connect_rate': {
42
- 'options': [None, 'nginx Connections Rate', 'connections/s', 'connections rate', 'nginx.connect_rate', 'line'],
44
+ 'options': [None, 'nginx Connections Rate', 'connections/s', 'connections rate',
45
+ 'nginx.connect_rate', 'line'],
46
'lines': [
47
["accepts", "accepted", "incremental"],
48
["handled", None, "incremental"]
@@ -50,8 +53,7 @@ CHARTS = {
53
class Service(UrlService):
54
def __init__(self, configuration=None, name=None):
55
UrlService.__init__(self, configuration=configuration, name=name)
53
- if len(self.url) == 0:
54
- self.url = "http://localhost/stub_status"
56
+ self.url = self.configuration.get('url', 'http://localhost/stub_status')
57
self.order = ORDER
58
self.definitions = CHARTS
59