@cryptotaxi247 / netdata-1 / commits / 61f4d8a78

update python modules readme

paulfantom committed Jul 4, 2016 at 23:49 UTC 61f4d8a783f0b715493a661fe969d7d6c051d03c
2 files changed +245 -18
python.d/README.md
+241 -14
@@ -1,8 +1,8 @@
1 # Disclaimer
2
3 -**Python plugin support is experimental and implementation may change in the future**
3 +**Python support is experimental and implementation may change in the future**
4
5 -Every plugin should be compatible with python2 and python3.
5 +Every module should be compatible with python2 and python3.
6 All third party libraries should be installed system-wide or in `python_modules` directory.
7 Module configurations are written in YAML and **pyYAML is required**.
8
@@ -29,7 +29,6 @@ priority : 20000
29
30 local: # job name
31 update_every : 5 # job update frequency
32 - retries : 2 # job retries
32 other_var1 : some_val # module specific variable
33
34 other_job:
@@ -42,14 +41,121 @@ other_job:
41
42 ---
43
45 -The following python.d plugins are supported:
44 +The following python.d modules are supported:
45 +
46 +# apache
47 +
48 +This module will monitor one or more apache servers depending on configuration.
49 +
50 +**Requirements:**
51 + * apache with enabled `mod_status`
52 +
53 +It produces following charts:
54 +
55 +1. **Requests** in requests/s
56 + * requests
57 +
58 +2. **Connections**
59 + * connections
60 +
61 +3. **Async Connections**
62 + * keepalive
63 + * closing
64 + * writing
65 +
66 +4. **Bandwidth** in kilobytes/s
67 + * sent
68 +
69 +5. **Workers**
70 + * idle
71 + * busy
72 +
73 +6. **Lifetime Avg. Requests/s** in requests/s
74 + * requests_sec
75 +
76 +7. **Lifetime Avg. Bandwidth/s** in kilobytes/s
77 + * size_sec
78 +
79 +8. **Lifetime Avg. Response Size** in bytes/request
80 + * size_req
81 +
82 +### configuration
83 +
84 +Needs only `url` to server's `server-status?auto`
85 +
86 +Here is an example for 2 servers:
87 +
88 +```yaml
89 +update_every : 10
90 +priority : 90100
91 +
92 +local:
93 + url : 'http://localhost/server-status?auto'
94 + retries : 20
95 +
96 +remote:
97 + url : 'http://www.apache.org/server-status?auto'
98 + update_every : 5
99 + retries : 4
100 +```
101 +
102 +Without configuration, module attempts to connect to `http://localhost/server-status?auto`
103 +
104 +---
105 +
106 +# apache_cache
107 +
108 +Module monitors apache mod_cache log and produces only one chart:
109 +
110 +**cached responses** in percent cached
111 + * hit
112 + * miss
113 + * other
114 +
115 +### configuration
116 +
117 +Sample:
118 +
119 +```yaml
120 +update_every : 10
121 +priority : 120000
122 +retries : 5
123 +log_path : '/var/log/apache2/cache.log'
124 +```
125 +
126 +If no configuration is given, module will attempt to read log file at `/var/log/apache2/cache.log`
127 +
128 +---
129 +
130 +# hddtemp
131 +
132 +Module monitors disk temperatures from one or more hddtemp daemons
133 +
134 +**Requirement:**
135 +Running `hddtemp` in daemonized mode with access on tcp port
136 +
137 +It produces one chart **Temperature** with dynamic number of dimensions (one per disk)
138 +
139 +### configuration
140 +
141 +Sample:
142 +
143 +```yaml
144 +update_every: 3
145 +host: "127.0.0.1"
146 +port: 7634
147 +```
148 +
149 +If no configuration is given, module will attempt to connect to hddtemp daemon on `127.0.0.1:7634` address
150 +
151 +---
152
153 # mysql
154
49 -The plugin will monitor one or more mysql servers
155 +Module monitors one or more mysql servers
156
157 **Requirements:**
52 - * python module [MySQLdb](https://github.com/PyMySQL/mysqlclient-python) (faster) or [PyMySQL](https://github.com/PyMySQL/PyMySQL) (slower)
158 + * python library [MySQLdb](https://github.com/PyMySQL/mysqlclient-python) (faster) or [PyMySQL](https://github.com/PyMySQL/PyMySQL) (slower)
159
160 It will produce following charts (if data is available):
161
@@ -99,13 +205,12 @@ It will produce following charts (if data is available):
205
206 You can provide, per server, the following:
207
102 -1. a name, anything you like, but keep it short
103 -2. username which have access to database (deafults to 'root')
104 -3. password (defaults to none)
105 -4. mysql my.cnf configuration file
106 -5. mysql socket (optional)
107 -6. mysql host (ip or hostname)
108 -7. mysql port (defaults to 3306)
208 +1. username which have access to database (deafults to 'root')
209 +2. password (defaults to none)
210 +3. mysql my.cnf configuration file
211 +4. mysql socket (optional)
212 +5. mysql host (ip or hostname)
213 +6. mysql port (defaults to 3306)
214
215 Here is an example for 3 servers:
216
@@ -132,7 +237,129 @@ remote:
237 retries : 20
238 ```
239
135 -If no configuration is given, the plugin will attempt to connect to mysql server via unix socket at `/var/run/mysqld/mysqld.sock` without password and with username `root`
240 +If no configuration is given, module will attempt to connect to mysql server via unix socket at `/var/run/mysqld/mysqld.sock` without password and with username `root`
241 +
242 +---
243 +
244 +# nginx
245 +
246 +This module will monitor one or more nginx servers depending on configuration.
247 +
248 +**Requirements:**
249 + * nginx with configured `stub_status`
250 +
251 +It produces following charts:
252 +
253 +1. **Active Connections**
254 + * active
255 +
256 +2. **Requests** in requests/s
257 + * requests
258 +
259 +3. **Active Connections by Status**
260 + * reading
261 + * writing
262 + * waiting
263 +
264 +4. **Connections Rate** in connections/s
265 + * accepts
266 + * handled
267 +
268 +### configuration
269 +
270 +Needs only `url` to server's `stub_status`
271 +
272 +Here is an example for local server:
273 +
274 +```yaml
275 +update_every : 10
276 +priority : 90100
277 +
278 +local:
279 + url : 'http://localhost/stub_status'
280 + retries : 10
281 +```
282 +
283 +Without configuration, module attempts to connect to `http://localhost/stub_status`
284
285 ---
286
287 +# phpfpm
288 +
289 +This module will monitor one or more php-fpm instances depending on configuration.
290 +
291 +**Requirements:**
292 + * php-fpm with enabled `status` page
293 + * access to `status` page via web server
294 +
295 +It produces following charts:
296 +
297 +1. **Active Connections**
298 + * active
299 + * maxActive
300 + * idle
301 +
302 +2. **Requests** in requests/s
303 + * requests
304 +
305 +3. **Performance**
306 + * reached
307 + * slow
308 +
309 +### configuration
310 +
311 +Needs only `url` to server's `status`
312 +
313 +Here is an example for local instance:
314 +
315 +```yaml
316 +update_every : 3
317 +priority : 90100
318 +
319 +local:
320 + url : 'http://localhost/status'
321 + retries : 10
322 +```
323 +
324 +Without configuration, module attempts to connect to `http://localhost/status`
325 +
326 +---
327 +
328 +# squid
329 +
330 +This module will monitor one or more squid instances depending on configuration.
331 +
332 +It produces following charts:
333 +
334 +1. **Client Bandwidth** in kilobits/s
335 + * in
336 + * out
337 + * hits
338 +
339 +2. **Client Requests** in requests/s
340 + * requests
341 + * hits
342 + * errors
343 +
344 +3. **Server Bandwidth** in kilobits/s
345 + * in
346 + * out
347 +
348 +4. **Server Requests** in requests/s
349 + * requests
350 + * errors
351 +
352 +### configuration
353 +
354 +```yaml
355 +priority : 50000
356 +
357 +local:
358 + request : 'cache_object://localhost:3128/counters'
359 + host : 'localhost'
360 + port : 3128
361 +```
362 +
363 +Without any configuration module will try to autodetect where squid presents its `counters` data
364 +
365 +---
\ No newline at end of file
python.d/squid.chart.py
+4 -4
@@ -14,27 +14,27 @@ ORDER = ['clients_net', 'clients_requests', 'servers_net', 'servers_requests']
14
15 CHARTS = {
16 'clients_net': {
17 - 'options': [None, "Squid Client Bandwidth", "kilobits / sec", "clients", "squid.clients.net" "area"],
17 + 'options': [None, "Squid Client Bandwidth", "kilobits/s", "clients", "squid.clients.net" "area"],
18 'lines': [
19 ["client_http_kbytes_in", "in", "incremental", 8, 1],
20 ["client_http_kbytes_out", "out", "incremental", -8, 1],
21 ["client_http_hit_kbytes_out", "hits", "incremental", -8, 1]
22 ]},
23 'clients_requests': {
24 - 'options': [None, "Squid Client Requests", "requests / sec", "clients", "squid.clients.requests", 'line'],
24 + 'options': [None, "Squid Client Requests", "requests/s", "clients", "squid.clients.requests", 'line'],
25 'lines': [
26 ["client_http_requests", "requests"],
27 ["client_http_hits", "hits"],
28 ["client_http_errors", "errors", "incremental", -1, 1]
29 ]},
30 'servers_net': {
31 - 'options': [None, "Squid Server Bandwidth", "kilobits / sec", "servers", "squid.servers.net" "area"],
31 + 'options': [None, "Squid Server Bandwidth", "kilobits/s", "servers", "squid.servers.net" "area"],
32 'lines': [
33 ["server_all_kbytes_in", "in", "incremental", 8, 1],
34 ["server_all_kbytes_out", "out", "incremental", -8, 1]
35 ]},
36 'servers_requests': {
37 - 'options': [None, "Squid Server Requests", "requests / sec", "servers", "squid.servers.requests", 'line'],
37 + 'options': [None, "Squid Server Requests", "requests/s", "servers", "squid.servers.requests", 'line'],
38 'lines': [
39 ["server_all_requests", "requests"],
40 ["server_all_errors", "errors", "incremental", -1, 1]