From 3f5345f32294ea57037b24fec765079ddeb6270b Mon Sep 17 00:00:00 2001 From: paulfantom Date: Wed, 22 Jun 2016 15:09:29 +0200 Subject: [PATCH] fixed some issues from previous commits --- conf.d/Makefile.am | 1 + conf.d/python.d.conf | 2 ++ plugins.d/python.d.plugin | 7 ++++--- python.d/Makefile.am | 3 +++ python.d/apache.chart.py | 13 +++++++------ python.d/nginx.chart.py | 7 ++++--- python.d/phpfpm.chart.py | 4 ++-- 7 files changed, 23 insertions(+), 14 deletions(-) diff --git a/conf.d/Makefile.am b/conf.d/Makefile.am index f60faaa5..5dbc29e1 100644 --- a/conf.d/Makefile.am +++ b/conf.d/Makefile.am @@ -21,6 +21,7 @@ pythonconfigdir=$(configdir)/python.d dist_pythonconfig_DATA = \ python.d/example.conf \ python.d/mysql.conf \ + python.d/phpfpm.conf \ $(NULL) diff --git a/conf.d/python.d.conf b/conf.d/python.d.conf index b303cde4..d416cf9c 100644 --- a/conf.d/python.d.conf +++ b/conf.d/python.d.conf @@ -8,3 +8,5 @@ enabled: no example: yes mysql: yes phpfpm: yes +apache: yes +nginx: yes diff --git a/plugins.d/python.d.plugin b/plugins.d/python.d.plugin index 0a0e65ae..2fde6d29 100755 --- a/plugins.d/python.d.plugin +++ b/plugins.d/python.d.plugin @@ -198,8 +198,8 @@ class PythonCharts(object): # scan directory specified in path and load all modules from there names = os.listdir(path) for mod in names: - if mod.strip(MODULE_EXTENSION) in disabled: - error(mod + ": disabled module ", mod.strip(MODULE_EXTENSION)) + if mod.replace(MODULE_EXTENSION,"") in disabled: + error(mod + ": disabled module ", mod.replace(MODULE_EXTENSION,"")) continue m = self._import_module(path + mod) if m is not None: @@ -526,7 +526,7 @@ def parse_cmdline(directory, *commands): pass if changed_update and DEBUG_FLAG: OVERRIDE_UPDATE_EVERY = True - debug(PROGRAM, "overriding update interval to", str(int(cmd))) + debug(PROGRAM, "overriding update interval to", str(BASE_CONFIG['update_every'])) debug("started from", commands[0], "with options:", *commands[1:]) @@ -576,6 +576,7 @@ def run(): ", ONLY_MODULES=" + str(modules)) # run plugins + modules = ['apache', 'nginx'] charts = PythonCharts(modules, MODULES_DIR, CONFIG_DIR + "python.d/", disabled) charts.check() charts.create() diff --git a/python.d/Makefile.am b/python.d/Makefile.am index eef6594b..b1de3ecc 100644 --- a/python.d/Makefile.am +++ b/python.d/Makefile.am @@ -7,6 +7,9 @@ SUFFIXES = .in dist_python_SCRIPTS = \ example.chart.py \ mysql.chart.py \ + phpfpm.chart.py \ + apache.chart.py \ + nginx.chart.py \ python-modules-installer.sh \ $(NULL) diff --git a/python.d/apache.chart.py b/python.d/apache.chart.py index 9dfc52dc..140f80ae 100644 --- a/python.d/apache.chart.py +++ b/python.d/apache.chart.py @@ -6,8 +6,8 @@ from base import UrlService # default module values (can be overridden per job in `config`) # update_every = 2 -# priority = 60000 -# retries = 5 +priority = 60000 +retries = 5 # default job configuration (overridden by python.d.plugin) # config = {'local': { @@ -25,7 +25,7 @@ CHARTS = { 'options': "'' 'apache Lifetime Avg. Response Size' 'bytes/request' statistics apache.bytesperreq area", 'lines': [ {"name": "size_req", - "options": "'' absolute 1"}, + "options": "'' absolute 1"} ]}, 'workers': { 'options': "'' 'apache Workers' 'workers' workers apache.workers stacked", @@ -45,7 +45,7 @@ CHARTS = { 'options': "'' 'apache Lifetime Avg. Response Size' 'bytes/request' statistics apache.bytesperreq area", 'lines': [ {"name": "size_sec", - "options": "'' absolute 8 1000000*1000"} + "options": "'' absolute 8 1000000000"} ]}, 'requests': { 'options': "''' 'apache Requests' 'requests/s' requests apache.requests line", @@ -73,13 +73,14 @@ CHARTS = { {"name": "closing", "options": "'' absolute 1 1"}, {"name": "writing", - "options": "'' absolute 1 1"}, + "options": "'' absolute 1 1"} ]} } class Service(UrlService): - url = "http://localhost/server-status?auto" + # url = "http://localhost/server-status?auto" + url = "http://www.apache.org/server-status?auto" order = ORDER charts = CHARTS assignment = {"BytesPerReq": 'size_req', diff --git a/python.d/nginx.chart.py b/python.d/nginx.chart.py index e0acdda0..6675a69d 100644 --- a/python.d/nginx.chart.py +++ b/python.d/nginx.chart.py @@ -6,8 +6,8 @@ from base import UrlService # default module values (can be overridden per job in `config`) # update_every = 2 -# priority = 60000 -# retries = 5 +priority = 60000 +retries = 5 # default job configuration (overridden by python.d.plugin) # config = {'local': { @@ -55,7 +55,8 @@ CHARTS = { class Service(UrlService): - url = "http://localhost/stub_status" + # url = "http://localhost/stub_status" + url = "http://toothless.dragon/stub_status" order = ORDER charts = CHARTS diff --git a/python.d/phpfpm.chart.py b/python.d/phpfpm.chart.py index 0ccf6800..da8eea39 100755 --- a/python.d/phpfpm.chart.py +++ b/python.d/phpfpm.chart.py @@ -6,8 +6,8 @@ from base import UrlService # default module values (can be overridden per job in `config`) # update_every = 2 -# priority = 60000 -# retries = 5 +priority = 60000 +retries = 5 # default job configuration (overridden by python.d.plugin) # config = {'local': { -- 2.39.2