From 89f3604407aff8f4cb2ed958252c61e23c767e24 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 9 Jun 2022 06:52:39 +0200 Subject: Adding upstream version 1.35.0. Signed-off-by: Daniel Baumann --- collectors/python.d.plugin/apache/Makefile.inc | 13 -- collectors/python.d.plugin/apache/README.md | 82 ----------- collectors/python.d.plugin/apache/apache.chart.py | 159 ---------------------- collectors/python.d.plugin/apache/apache.conf | 85 ------------ 4 files changed, 339 deletions(-) delete mode 100644 collectors/python.d.plugin/apache/Makefile.inc delete mode 100644 collectors/python.d.plugin/apache/README.md delete mode 100644 collectors/python.d.plugin/apache/apache.chart.py delete mode 100644 collectors/python.d.plugin/apache/apache.conf (limited to 'collectors/python.d.plugin/apache') diff --git a/collectors/python.d.plugin/apache/Makefile.inc b/collectors/python.d.plugin/apache/Makefile.inc deleted file mode 100644 index 70a421550..000000000 --- a/collectors/python.d.plugin/apache/Makefile.inc +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: GPL-3.0-or-later - -# THIS IS NOT A COMPLETE Makefile -# IT IS INCLUDED BY ITS PARENT'S Makefile.am -# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT - -# install these files -dist_python_DATA += apache/apache.chart.py -dist_pythonconfig_DATA += apache/apache.conf - -# do not install these files, but include them in the distribution -dist_noinst_DATA += apache/README.md apache/Makefile.inc - diff --git a/collectors/python.d.plugin/apache/README.md b/collectors/python.d.plugin/apache/README.md deleted file mode 100644 index c6086835f..000000000 --- a/collectors/python.d.plugin/apache/README.md +++ /dev/null @@ -1,82 +0,0 @@ - - -# Apache monitoring with Netdata - -Monitors one or more Apache servers depending on configuration. - -## Requirements - -- apache with enabled `mod_status` - -It produces the following charts: - -1. **Requests** in requests/s - - - requests - -2. **Connections** - - - connections - -3. **Async Connections** - - - keepalive - - closing - - writing - -4. **Bandwidth** in kilobytes/s - - - sent - -5. **Workers** - - - idle - - busy - -6. **Lifetime Avg. Requests/s** in requests/s - - - requests_sec - -7. **Lifetime Avg. Bandwidth/s** in kilobytes/s - - - size_sec - -8. **Lifetime Avg. Response Size** in bytes/request - - - size_req - -## Configuration - -Edit the `python.d/apache.conf` configuration file using `edit-config` from the Netdata [config -directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`. - -```bash -cd /etc/netdata # Replace this path with your Netdata config directory, if different -sudo ./edit-config python.d/apache.conf -``` - -Needs only `url` to server's `server-status?auto` - -Example for two servers: - -```yaml -update_every : 10 -priority : 90100 - -local: - url : 'http://localhost/server-status?auto' - -remote: - url : 'http://www.apache.org/server-status?auto' - update_every : 5 -``` - -Without configuration, module attempts to connect to `http://localhost/server-status?auto` - ---- - - diff --git a/collectors/python.d.plugin/apache/apache.chart.py b/collectors/python.d.plugin/apache/apache.chart.py deleted file mode 100644 index ceac9ecd5..000000000 --- a/collectors/python.d.plugin/apache/apache.chart.py +++ /dev/null @@ -1,159 +0,0 @@ -# -*- coding: utf-8 -*- -# Description: apache netdata python.d module -# Author: Pawel Krupa (paulfantom) -# SPDX-License-Identifier: GPL-3.0-or-later - -from bases.FrameworkServices.UrlService import UrlService - -ORDER = [ - 'requests', - 'connections', - 'conns_async', - 'net', - 'workers', - 'reqpersec', - 'bytespersec', - 'bytesperreq', -] - -CHARTS = { - 'bytesperreq': { - 'options': [None, 'Lifetime Avg. Request Size', 'KiB', - 'statistics', 'apache.bytesperreq', 'area'], - 'lines': [ - ['size_req', 'size', 'absolute', 1, 1024 * 100000] - ]}, - 'workers': { - 'options': [None, 'Workers', 'workers', 'workers', 'apache.workers', 'stacked'], - 'lines': [ - ['idle'], - ['busy'], - ]}, - 'reqpersec': { - 'options': [None, 'Lifetime Avg. Requests/s', 'requests/s', 'statistics', - 'apache.reqpersec', 'area'], - 'lines': [ - ['requests_sec', 'requests', 'absolute', 1, 100000] - ]}, - 'bytespersec': { - 'options': [None, 'Lifetime Avg. Bandwidth/s', 'kilobits/s', 'statistics', - 'apache.bytespersec', 'area'], - 'lines': [ - ['size_sec', None, 'absolute', 8, 1000 * 100000] - ]}, - 'requests': { - 'options': [None, 'Requests', 'requests/s', 'requests', 'apache.requests', 'line'], - 'lines': [ - ['requests', None, 'incremental'] - ]}, - 'net': { - 'options': [None, 'Bandwidth', 'kilobits/s', 'bandwidth', 'apache.net', 'area'], - 'lines': [ - ['sent', None, 'incremental', 8, 1] - ]}, - 'connections': { - 'options': [None, 'Connections', 'connections', 'connections', 'apache.connections', 'line'], - 'lines': [ - ['connections'] - ]}, - 'conns_async': { - 'options': [None, 'Async Connections', 'connections', 'connections', 'apache.conns_async', 'stacked'], - 'lines': [ - ['keepalive'], - ['closing'], - ['writing'] - ]} -} - -ASSIGNMENT = { - 'BytesPerReq': 'size_req', - 'IdleWorkers': 'idle', - 'IdleServers': 'idle_servers', - 'BusyWorkers': 'busy', - 'BusyServers': 'busy_servers', - 'ReqPerSec': 'requests_sec', - 'BytesPerSec': 'size_sec', - 'Total Accesses': 'requests', - 'Total kBytes': 'sent', - 'ConnsTotal': 'connections', - 'ConnsAsyncKeepAlive': 'keepalive', - 'ConnsAsyncClosing': 'closing', - 'ConnsAsyncWriting': 'writing' -} - -FLOAT_VALUES = [ - 'BytesPerReq', - 'ReqPerSec', - 'BytesPerSec', -] - -LIGHTTPD_MARKER = 'idle_servers' - - -class Service(UrlService): - def __init__(self, configuration=None, name=None): - UrlService.__init__(self, configuration=configuration, name=name) - self.order = ORDER - self.definitions = CHARTS - self.url = self.configuration.get('url', 'http://localhost/server-status?auto') - - def check(self): - self._manager = self._build_manager() - - data = self._get_data() - - if not data: - return None - - if LIGHTTPD_MARKER in data: - self.turn_into_lighttpd() - - return True - - def _get_data(self): - """ - Format data received from http request - :return: dict - """ - raw_data = self._get_raw_data() - - if not raw_data: - return None - - data = dict() - - for line in raw_data.split('\n'): - try: - parse_line(line, data) - except ValueError: - continue - - return data or None - - def turn_into_lighttpd(self): - self.module_name = 'lighttpd' - for chart in self.definitions: - if chart == 'workers': - lines = self.definitions[chart]['lines'] - lines[0] = ['idle_servers', 'idle'] - lines[1] = ['busy_servers', 'busy'] - opts = self.definitions[chart]['options'] - opts[1] = opts[1].replace('apache', 'lighttpd') - opts[4] = opts[4].replace('apache', 'lighttpd') - - -def parse_line(line, data): - parts = line.split(':') - - if len(parts) != 2: - return - - key, value = parts[0], parts[1] - - if key not in ASSIGNMENT: - return - - if key in FLOAT_VALUES: - data[ASSIGNMENT[key]] = int((float(value) * 100000)) - else: - data[ASSIGNMENT[key]] = int(value) diff --git a/collectors/python.d.plugin/apache/apache.conf b/collectors/python.d.plugin/apache/apache.conf deleted file mode 100644 index 84e12a57c..000000000 --- a/collectors/python.d.plugin/apache/apache.conf +++ /dev/null @@ -1,85 +0,0 @@ -# netdata python.d.plugin configuration for apache -# -# This file is in YaML format. Generally the format is: -# -# name: value -# -# There are 2 sections: -# - global variables -# - one or more JOBS -# -# JOBS allow you to collect values from multiple sources. -# Each source will have its own set of charts. -# -# JOB parameters have to be indented (using spaces only, example below). - -# ---------------------------------------------------------------------- -# Global Variables -# These variables set the defaults for all JOBs, however each JOB -# may define its own, overriding the defaults. - -# update_every sets the default data collection frequency. -# If unset, the python.d.plugin default is used. -# update_every: 1 - -# priority controls the order of charts at the netdata dashboard. -# Lower numbers move the charts towards the top of the page. -# If unset, the default for python.d.plugin is used. -# priority: 60000 - -# penalty indicates whether to apply penalty to update_every in case of failures. -# Penalty will increase every 5 failed updates in a row. Maximum penalty is 10 minutes. -# penalty: yes - -# autodetection_retry sets the job re-check interval in seconds. -# The job is not deleted if check fails. -# Attempts to start the job are made once every autodetection_retry. -# This feature is disabled by default. -# autodetection_retry: 0 - -# ---------------------------------------------------------------------- -# JOBS (data collection sources) -# -# The default JOBS share the same *name*. JOBS with the same name -# are mutually exclusive. Only one of them will be allowed running at -# any time. This allows autodetection to try several alternatives and -# pick the one that works. -# -# Any number of jobs is supported. -# -# All python.d.plugin JOBS (for all its modules) support a set of -# predefined parameters. These are: -# -# job_name: -# name: myname # the JOB's name as it will appear at the -# # dashboard (by default is the job_name) -# # JOBs sharing a name are mutually exclusive -# update_every: 1 # the JOB's data collection frequency -# priority: 60000 # the JOB's order on the dashboard -# penalty: yes # the JOB's penalty -# autodetection_retry: 0 # the JOB's re-check interval in seconds -# -# Additionally to the above, apache also supports the following: -# -# url: 'URL' # the URL to fetch apache's mod_status stats -# -# if the URL is password protected, the following are supported: -# -# user: 'username' -# pass: 'password' - -# ---------------------------------------------------------------------- -# AUTO-DETECTION JOBS -# only one of them will run (they have the same name) - -localhost: - name : 'local' - url : 'http://localhost/server-status?auto' - -localipv4: - name : 'local' - url : 'http://127.0.0.1/server-status?auto' - -localipv6: - name : 'local' - url : 'http://[::1]/server-status?auto' -- cgit v1.2.3