]> arthur.barton.de Git - netdata.git/commitdiff
removed nginx_log and gunicorn_log
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 11 Feb 2017 08:16:39 +0000 (10:16 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 11 Feb 2017 08:16:39 +0000 (10:16 +0200)
conf.d/Makefile.am
python.d/Makefile.am
python.d/gunicorn_log.chart.py [deleted file]
python.d/nginx_log.chart.py [deleted file]

index 4f4c88388c2dead0d24070162ad9f5285f9cbde1..c746a909d56e1b6994201238e22dbf375047a837 100644 (file)
@@ -33,7 +33,6 @@ dist_pythonconfig_DATA = \
     python.d/exim.conf \
     python.d/fail2ban.conf \
     python.d/freeradius.conf \
-    python.d/gunicorn_log.conf \
     python.d/haproxy.conf \
     python.d/hddtemp.conf \
     python.d/ipfs.conf \
@@ -42,7 +41,6 @@ dist_pythonconfig_DATA = \
     python.d/memcached.conf \
     python.d/mysql.conf \
     python.d/nginx.conf \
-    python.d/nginx_log.conf \
     python.d/ovpn_status_log.conf \
     python.d/phpfpm.conf \
     python.d/postfix.conf \
index 527e865933a3154ab57fe49492a10dbcfe0f974d..d0c581654e49aebd6aa611d8087ceecebf2ef120 100644 (file)
@@ -19,7 +19,6 @@ dist_python_SCRIPTS = \
     exim.chart.py \
     fail2ban.chart.py \
     freeradius.chart.py \
-    gunicorn_log.chart.py \
     haproxy.chart.py \
     hddtemp.chart.py \
     ipfs.chart.py \
@@ -28,7 +27,6 @@ dist_python_SCRIPTS = \
     memcached.chart.py \
     mysql.chart.py \
     nginx.chart.py \
-    nginx_log.chart.py \
     ovpn_status_log.chart.py \
     phpfpm.chart.py \
     postfix.chart.py \
diff --git a/python.d/gunicorn_log.chart.py b/python.d/gunicorn_log.chart.py
deleted file mode 100644 (file)
index 9459636..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-# -*- coding: utf-8 -*-
-# Description: nginx log netdata python.d module
-# Author: Pawel Krupa (paulfantom)
-# Modified for Gunicorn by: Jeff Willette (deltaskelta)
-
-from base import LogService 
-import re
-
-priority = 60000
-retries = 60
-# update_every = 3
-
-ORDER = ['codes']
-CHARTS = {
-    'codes': {
-        'options': [None, 'gunicorn status codes', 'requests/s', 'requests', 'gunicorn_log.codes', 'stacked'],
-        'lines': [
-            ["2xx", None, "incremental"],
-            ["3xx", None, "incremental"],
-            ["4xx", None, "incremental"],
-            ["5xx", None, "incremental"]
-        ]}
-}
-
-
-class Service(LogService):
-    def __init__(self, configuration=None, name=None):
-        LogService.__init__(self, configuration=configuration, name=name)
-        if len(self.log_path) == 0:
-            self.log_path = "/var/log/gunicorn/access.log"
-        self.order = ORDER
-        self.definitions = CHARTS
-        pattern = r'" ([0-9]{3}) '
-        #pattern = r'(?:" )([0-9][0-9][0-9]) ?'
-        self.regex = re.compile(pattern)
-
-    def _get_data(self):
-        """
-        Parse new log lines
-        :return: dict
-        """
-        data = {'2xx': 0,
-                '3xx': 0,
-                '4xx': 0,
-                '5xx': 0}
-        try:
-            raw = self._get_raw_data()
-            if raw is None:
-                return None
-            elif not raw:
-                return data
-        except (ValueError, AttributeError):
-            return None
-
-        regex = self.regex
-        for line in raw:
-            code = regex.search(line)
-            try:
-                beginning = code.group(1)[0]
-            except AttributeError:
-                continue
-
-            if beginning == '2':
-                data["2xx"] += 1
-            elif beginning == '3':
-                data["3xx"] += 1
-            elif beginning == '4':
-                data["4xx"] += 1
-            elif beginning == '5':
-                data["5xx"] += 1
-
-        return data
diff --git a/python.d/nginx_log.chart.py b/python.d/nginx_log.chart.py
deleted file mode 100644 (file)
index ef964a5..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-# -*- coding: utf-8 -*-
-# Description: nginx log netdata python.d module
-# Author: Pawel Krupa (paulfantom)
-
-from base import LogService
-import re
-
-priority = 60000
-retries = 60
-# update_every = 3
-
-ORDER = ['codes']
-CHARTS = {
-    'codes': {
-        'options': [None, 'nginx status codes', 'requests/s', 'requests', 'nginx_log.codes', 'stacked'],
-        'lines': [
-            ["2xx", None, "incremental"],
-            ["5xx", None, "incremental"],
-            ["3xx", None, "incremental"],
-            ["4xx", None, "incremental"],
-            ["1xx", None, "incremental"],
-            ["other", None, "incremental"]
-        ]}
-}
-
-
-class Service(LogService):
-    def __init__(self, configuration=None, name=None):
-        LogService.__init__(self, configuration=configuration, name=name)
-        if len(self.log_path) == 0:
-            self.log_path = "/var/log/nginx/access.log"
-        self.order = ORDER
-        self.definitions = CHARTS
-        pattern = r'" ([0-9]{3}) ?'
-        #pattern = r'(?:" )([0-9][0-9][0-9]) ?'
-        self.regex = re.compile(pattern)
-
-        self.data = {
-            '1xx': 0,
-            '2xx': 0,
-            '3xx': 0,
-            '4xx': 0,
-            '5xx': 0,
-            'other': 0
-        }
-
-    def _get_data(self):
-        """
-        Parse new log lines
-        :return: dict
-        """
-        try:
-            raw = self._get_raw_data()
-            if raw is None:
-                return None
-            elif not raw:
-                return self.data
-        except (ValueError, AttributeError):
-            return None
-
-        regex = self.regex
-        for line in raw:
-            code = regex.search(line)
-            try:
-                beginning = code.group(1)[0]
-            except AttributeError:
-                continue
-
-            if beginning == '2':
-                self.data["2xx"] += 1
-            elif beginning == '3':
-                self.data["3xx"] += 1
-            elif beginning == '4':
-                self.data["4xx"] += 1
-            elif beginning == '5':
-                self.data["5xx"] += 1
-            elif beginning == '1':
-                self.data["1xx"] += 1
-            else:
-                self.data["other"] += 1
-
-        return self.data