From b485aab7e71c1625cfc27e0f92c9509f42378458 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 May 2024 13:19:16 +0200 Subject: Adding upstream version 1.45.3+dfsg. Signed-off-by: Daniel Baumann --- collectors/python.d.plugin/memcached/Makefile.inc | 13 -- collectors/python.d.plugin/memcached/README.md | 1 - .../memcached/integrations/memcached.md | 215 ------------------ .../python.d.plugin/memcached/memcached.chart.py | 197 ---------------- .../python.d.plugin/memcached/memcached.conf | 90 -------- collectors/python.d.plugin/memcached/metadata.yaml | 247 --------------------- 6 files changed, 763 deletions(-) delete mode 100644 collectors/python.d.plugin/memcached/Makefile.inc delete mode 120000 collectors/python.d.plugin/memcached/README.md delete mode 100644 collectors/python.d.plugin/memcached/integrations/memcached.md delete mode 100644 collectors/python.d.plugin/memcached/memcached.chart.py delete mode 100644 collectors/python.d.plugin/memcached/memcached.conf delete mode 100644 collectors/python.d.plugin/memcached/metadata.yaml (limited to 'collectors/python.d.plugin/memcached') diff --git a/collectors/python.d.plugin/memcached/Makefile.inc b/collectors/python.d.plugin/memcached/Makefile.inc deleted file mode 100644 index e6035716..00000000 --- a/collectors/python.d.plugin/memcached/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 += memcached/memcached.chart.py -dist_pythonconfig_DATA += memcached/memcached.conf - -# do not install these files, but include them in the distribution -dist_noinst_DATA += memcached/README.md memcached/Makefile.inc - diff --git a/collectors/python.d.plugin/memcached/README.md b/collectors/python.d.plugin/memcached/README.md deleted file mode 120000 index 2cb76d33..00000000 --- a/collectors/python.d.plugin/memcached/README.md +++ /dev/null @@ -1 +0,0 @@ -integrations/memcached.md \ No newline at end of file diff --git a/collectors/python.d.plugin/memcached/integrations/memcached.md b/collectors/python.d.plugin/memcached/integrations/memcached.md deleted file mode 100644 index 113b86c8..00000000 --- a/collectors/python.d.plugin/memcached/integrations/memcached.md +++ /dev/null @@ -1,215 +0,0 @@ - - -# Memcached - - - - - -Plugin: python.d.plugin -Module: memcached - - - -## Overview - -Monitor Memcached metrics for proficient in-memory key-value store operations. Track cache hits, misses, and memory usage for efficient data caching. - -It reads server response to stats command ([stats interface](https://github.com/memcached/memcached/wiki/Commands#stats)). - -This collector is supported on all platforms. - -This collector supports collecting metrics from multiple instances of this integration, including remote instances. - - -### Default Behavior - -#### Auto-Detection - -If no configuration is given, collector will attempt to connect to memcached instance on `127.0.0.1:11211` address. - - -#### Limits - -The default configuration for this integration does not impose any limits on data collection. - -#### Performance Impact - -The default configuration for this integration is not expected to impose a significant performance impact on the system. - - -## Metrics - -Metrics grouped by *scope*. - -The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. - - - -### Per Memcached instance - -These metrics refer to the entire monitored application. - -This scope has no labels. - -Metrics: - -| Metric | Dimensions | Unit | -|:------|:----------|:----| -| memcached.cache | available, used | MiB | -| memcached.net | in, out | kilobits/s | -| memcached.connections | current, rejected, total | connections/s | -| memcached.items | current, total | items | -| memcached.evicted_reclaimed | reclaimed, evicted | items | -| memcached.get | hints, misses | requests | -| memcached.get_rate | rate | requests/s | -| memcached.set_rate | rate | requests/s | -| memcached.delete | hits, misses | requests | -| memcached.cas | hits, misses, bad value | requests | -| memcached.increment | hits, misses | requests | -| memcached.decrement | hits, misses | requests | -| memcached.touch | hits, misses | requests | -| memcached.touch_rate | rate | requests/s | - - - -## Alerts - - -The following alerts are available: - -| Alert name | On metric | Description | -|:------------|:----------|:------------| -| [ memcached_cache_memory_usage ](https://github.com/netdata/netdata/blob/master/health/health.d/memcached.conf) | memcached.cache | cache memory utilization | -| [ memcached_cache_fill_rate ](https://github.com/netdata/netdata/blob/master/health/health.d/memcached.conf) | memcached.cache | average rate the cache fills up (positive), or frees up (negative) space over the last hour | -| [ memcached_out_of_cache_space_time ](https://github.com/netdata/netdata/blob/master/health/health.d/memcached.conf) | memcached.cache | estimated time the cache will run out of space if the system continues to add data at the same rate as the past hour | - - -## Setup - -### Prerequisites - -No action required. - -### Configuration - -#### File - -The configuration file name for this integration is `python.d/memcached.conf`. - - -You can edit the configuration file using the `edit-config` script from the -Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md#the-netdata-config-directory). - -```bash -cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata -sudo ./edit-config python.d/memcached.conf -``` -#### Options - -There are 2 sections: - -* Global variables -* One or more JOBS that can define multiple different instances to monitor. - -The following options can be defined globally: priority, penalty, autodetection_retry, update_every, but can also be defined per JOB to override the global values. - -Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition. - -Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified. - - -
Config options - -| Name | Description | Default | Required | -|:----|:-----------|:-------|:--------:| -| host | the host to connect to. | 127.0.0.1 | no | -| port | the port to connect to. | 11211 | no | -| update_every | Sets the default data collection frequency. | 10 | no | -| priority | Controls the order of charts at the netdata dashboard. | 60000 | no | -| autodetection_retry | Sets the job re-check interval in seconds. | 0 | no | -| penalty | Indicates whether to apply penalty to update_every in case of failures. | yes | no | -| name | Job name. This value will overwrite the `job_name` value. 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. | | no | - -
- -#### Examples - -##### localhost - -An example configuration for localhost. - -```yaml -localhost: - name: 'local' - host: 'localhost' - port: 11211 - -``` -##### localipv4 - -An example configuration for localipv4. - -
Config - -```yaml -localhost: - name: 'local' - host: '127.0.0.1' - port: 11211 - -``` -
- -##### localipv6 - -An example configuration for localipv6. - -
Config - -```yaml -localhost: - name: 'local' - host: '::1' - port: 11211 - -``` -
- - - -## Troubleshooting - -### Debug Mode - -To troubleshoot issues with the `memcached` collector, run the `python.d.plugin` with the debug option enabled. The output -should give you clues as to why the collector isn't working. - -- Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on - your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. - - ```bash - cd /usr/libexec/netdata/plugins.d/ - ``` - -- Switch to the `netdata` user. - - ```bash - sudo -u netdata -s - ``` - -- Run the `python.d.plugin` to debug the collector: - - ```bash - ./python.d.plugin memcached debug trace - ``` - - diff --git a/collectors/python.d.plugin/memcached/memcached.chart.py b/collectors/python.d.plugin/memcached/memcached.chart.py deleted file mode 100644 index adb9560b..00000000 --- a/collectors/python.d.plugin/memcached/memcached.chart.py +++ /dev/null @@ -1,197 +0,0 @@ -# -*- coding: utf-8 -*- -# Description: memcached netdata python.d module -# Author: Pawel Krupa (paulfantom) -# SPDX-License-Identifier: GPL-3.0-or-later - -from bases.FrameworkServices.SocketService import SocketService - -ORDER = [ - 'cache', - 'net', - 'connections', - 'items', - 'evicted_reclaimed', - 'get', - 'get_rate', - 'set_rate', - 'cas', - 'delete', - 'increment', - 'decrement', - 'touch', - 'touch_rate', -] - -CHARTS = { - 'cache': { - 'options': [None, 'Cache Size', 'MiB', 'cache', 'memcached.cache', 'stacked'], - 'lines': [ - ['avail', 'available', 'absolute', 1, 1 << 20], - ['used', 'used', 'absolute', 1, 1 << 20] - ] - }, - 'net': { - 'options': [None, 'Network', 'kilobits/s', 'network', 'memcached.net', 'area'], - 'lines': [ - ['bytes_read', 'in', 'incremental', 8, 1000], - ['bytes_written', 'out', 'incremental', -8, 1000], - ] - }, - 'connections': { - 'options': [None, 'Connections', 'connections/s', 'connections', 'memcached.connections', 'line'], - 'lines': [ - ['curr_connections', 'current', 'incremental'], - ['rejected_connections', 'rejected', 'incremental'], - ['total_connections', 'total', 'incremental'] - ] - }, - 'items': { - 'options': [None, 'Items', 'items', 'items', 'memcached.items', 'line'], - 'lines': [ - ['curr_items', 'current', 'absolute'], - ['total_items', 'total', 'absolute'] - ] - }, - 'evicted_reclaimed': { - 'options': [None, 'Evicted and Reclaimed Items', 'items', 'items', 'memcached.evicted_reclaimed', 'line'], - 'lines': [ - ['reclaimed', 'reclaimed', 'absolute'], - ['evictions', 'evicted', 'absolute'] - ] - }, - 'get': { - 'options': [None, 'Get Requests', 'requests', 'get ops', 'memcached.get', 'stacked'], - 'lines': [ - ['get_hits', 'hits', 'percent-of-absolute-row'], - ['get_misses', 'misses', 'percent-of-absolute-row'] - ] - }, - 'get_rate': { - 'options': [None, 'Get Request Rate', 'requests/s', 'get ops', 'memcached.get_rate', 'line'], - 'lines': [ - ['cmd_get', 'rate', 'incremental'] - ] - }, - 'set_rate': { - 'options': [None, 'Set Request Rate', 'requests/s', 'set ops', 'memcached.set_rate', 'line'], - 'lines': [ - ['cmd_set', 'rate', 'incremental'] - ] - }, - 'delete': { - 'options': [None, 'Delete Requests', 'requests', 'delete ops', 'memcached.delete', 'stacked'], - 'lines': [ - ['delete_hits', 'hits', 'percent-of-absolute-row'], - ['delete_misses', 'misses', 'percent-of-absolute-row'], - ] - }, - 'cas': { - 'options': [None, 'Check and Set Requests', 'requests', 'check and set ops', 'memcached.cas', 'stacked'], - 'lines': [ - ['cas_hits', 'hits', 'percent-of-absolute-row'], - ['cas_misses', 'misses', 'percent-of-absolute-row'], - ['cas_badval', 'bad value', 'percent-of-absolute-row'] - ] - }, - 'increment': { - 'options': [None, 'Increment Requests', 'requests', 'increment ops', 'memcached.increment', 'stacked'], - 'lines': [ - ['incr_hits', 'hits', 'percent-of-absolute-row'], - ['incr_misses', 'misses', 'percent-of-absolute-row'] - ] - }, - 'decrement': { - 'options': [None, 'Decrement Requests', 'requests', 'decrement ops', 'memcached.decrement', 'stacked'], - 'lines': [ - ['decr_hits', 'hits', 'percent-of-absolute-row'], - ['decr_misses', 'misses', 'percent-of-absolute-row'] - ] - }, - 'touch': { - 'options': [None, 'Touch Requests', 'requests', 'touch ops', 'memcached.touch', 'stacked'], - 'lines': [ - ['touch_hits', 'hits', 'percent-of-absolute-row'], - ['touch_misses', 'misses', 'percent-of-absolute-row'] - ] - }, - 'touch_rate': { - 'options': [None, 'Touch Request Rate', 'requests/s', 'touch ops', 'memcached.touch_rate', 'line'], - 'lines': [ - ['cmd_touch', 'rate', 'incremental'] - ] - } -} - - -class Service(SocketService): - def __init__(self, configuration=None, name=None): - SocketService.__init__(self, configuration=configuration, name=name) - self.order = ORDER - self.definitions = CHARTS - self.request = 'stats\r\n' - self.host = 'localhost' - self.port = 11211 - self._keep_alive = True - self.unix_socket = None - - def _get_data(self): - """ - Get data from socket - :return: dict - """ - response = self._get_raw_data() - if response is None: - # error has already been logged - return None - - if response.startswith('ERROR'): - self.error('received ERROR') - return None - - try: - parsed = response.split('\n') - except AttributeError: - self.error('response is invalid/empty') - return None - - # split the response - data = {} - for line in parsed: - if line.startswith('STAT'): - try: - t = line[5:].split(' ') - data[t[0]] = t[1] - except (IndexError, ValueError): - self.debug('invalid line received: ' + str(line)) - - if not data: - self.error("received data doesn't have any records") - return None - - # custom calculations - try: - data['avail'] = int(data['limit_maxbytes']) - int(data['bytes']) - data['used'] = int(data['bytes']) - except (KeyError, ValueError, TypeError): - pass - - return data - - def _check_raw_data(self, data): - if data.endswith('END\r\n'): - self.debug('received full response from memcached') - return True - - self.debug('waiting more data from memcached') - return False - - def check(self): - """ - Parse configuration, check if memcached is available - :return: boolean - """ - self._parse_config() - data = self._get_data() - if data is None: - return False - return True diff --git a/collectors/python.d.plugin/memcached/memcached.conf b/collectors/python.d.plugin/memcached/memcached.conf deleted file mode 100644 index 3286b462..00000000 --- a/collectors/python.d.plugin/memcached/memcached.conf +++ /dev/null @@ -1,90 +0,0 @@ -# netdata python.d.plugin configuration for memcached -# -# 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, memcached also supports the following: -# -# socket: 'path/to/memcached.sock' -# -# or -# host: 'IP or HOSTNAME' # the host to connect to -# port: PORT # the port to connect to -# -# - -# ---------------------------------------------------------------------- -# AUTO-DETECTION JOBS -# only one of them will run (they have the same name) - -localhost: - name : 'local' - host : 'localhost' - port : 11211 - -localipv4: - name : 'local' - host : '127.0.0.1' - port : 11211 - -localipv6: - name : 'local' - host : '::1' - port : 11211 - diff --git a/collectors/python.d.plugin/memcached/metadata.yaml b/collectors/python.d.plugin/memcached/metadata.yaml deleted file mode 100644 index 38c9f685..00000000 --- a/collectors/python.d.plugin/memcached/metadata.yaml +++ /dev/null @@ -1,247 +0,0 @@ -plugin_name: python.d.plugin -modules: - - meta: - plugin_name: python.d.plugin - module_name: memcached - monitored_instance: - name: Memcached - link: https://memcached.org/ - categories: - - data-collection.database-servers - icon_filename: "memcached.svg" - related_resources: - integrations: - list: [] - info_provided_to_referring_integrations: - description: "" - keywords: - - memcached - - memcache - - cache - - database - most_popular: false - overview: - data_collection: - metrics_description: "Monitor Memcached metrics for proficient in-memory key-value store operations. Track cache hits, misses, and memory usage for efficient data caching." - method_description: "It reads server response to stats command ([stats interface](https://github.com/memcached/memcached/wiki/Commands#stats))." - supported_platforms: - include: [] - exclude: [] - multi_instance: true - additional_permissions: - description: "" - default_behavior: - auto_detection: - description: | - If no configuration is given, collector will attempt to connect to memcached instance on `127.0.0.1:11211` address. - limits: - description: "" - performance_impact: - description: "" - setup: - prerequisites: - list: [] - configuration: - file: - name: python.d/memcached.conf - description: "" - options: - description: | - There are 2 sections: - - * Global variables - * One or more JOBS that can define multiple different instances to monitor. - - The following options can be defined globally: priority, penalty, autodetection_retry, update_every, but can also be defined per JOB to override the global values. - - Additionally, the following collapsed table contains all the options that can be configured inside a JOB definition. - - Every configuration JOB starts with a `job_name` value which will appear in the dashboard, unless a `name` parameter is specified. - folding: - title: Config options - enabled: true - list: - - name: host - description: the host to connect to. - default_value: "127.0.0.1" - required: false - - name: port - description: the port to connect to. - default_value: "11211" - required: false - - name: update_every - description: Sets the default data collection frequency. - default_value: 10 - required: false - - name: priority - description: Controls the order of charts at the netdata dashboard. - default_value: 60000 - required: false - - name: autodetection_retry - description: Sets the job re-check interval in seconds. - default_value: 0 - required: false - - name: penalty - description: Indicates whether to apply penalty to update_every in case of failures. - default_value: yes - required: false - - name: name - description: Job name. This value will overwrite the `job_name` value. 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. - default_value: "" - required: false - examples: - folding: - enabled: true - title: "Config" - list: - - name: localhost - description: An example configuration for localhost. - folding: - enabled: false - config: | - localhost: - name: 'local' - host: 'localhost' - port: 11211 - - name: localipv4 - description: An example configuration for localipv4. - folding: - enabled: true - config: | - localhost: - name: 'local' - host: '127.0.0.1' - port: 11211 - - name: localipv6 - description: An example configuration for localipv6. - folding: - enabled: true - config: | - localhost: - name: 'local' - host: '::1' - port: 11211 - troubleshooting: - problems: - list: [] - alerts: - - name: memcached_cache_memory_usage - link: https://github.com/netdata/netdata/blob/master/health/health.d/memcached.conf - metric: memcached.cache - info: cache memory utilization - - name: memcached_cache_fill_rate - link: https://github.com/netdata/netdata/blob/master/health/health.d/memcached.conf - metric: memcached.cache - info: average rate the cache fills up (positive), or frees up (negative) space over the last hour - - name: memcached_out_of_cache_space_time - link: https://github.com/netdata/netdata/blob/master/health/health.d/memcached.conf - metric: memcached.cache - info: estimated time the cache will run out of space if the system continues to add data at the same rate as the past hour - metrics: - folding: - title: Metrics - enabled: false - description: "" - availability: [] - scopes: - - name: global - description: "These metrics refer to the entire monitored application." - labels: [] - metrics: - - name: memcached.cache - description: Cache Size - unit: "MiB" - chart_type: stacked - dimensions: - - name: available - - name: used - - name: memcached.net - description: Network - unit: "kilobits/s" - chart_type: area - dimensions: - - name: in - - name: out - - name: memcached.connections - description: Connections - unit: "connections/s" - chart_type: line - dimensions: - - name: current - - name: rejected - - name: total - - name: memcached.items - description: Items - unit: "items" - chart_type: line - dimensions: - - name: current - - name: total - - name: memcached.evicted_reclaimed - description: Evicted and Reclaimed Items - unit: "items" - chart_type: line - dimensions: - - name: reclaimed - - name: evicted - - name: memcached.get - description: Get Requests - unit: "requests" - chart_type: stacked - dimensions: - - name: hints - - name: misses - - name: memcached.get_rate - description: Get Request Rate - unit: "requests/s" - chart_type: line - dimensions: - - name: rate - - name: memcached.set_rate - description: Set Request Rate - unit: "requests/s" - chart_type: line - dimensions: - - name: rate - - name: memcached.delete - description: Delete Requests - unit: "requests" - chart_type: stacked - dimensions: - - name: hits - - name: misses - - name: memcached.cas - description: Check and Set Requests - unit: "requests" - chart_type: stacked - dimensions: - - name: hits - - name: misses - - name: bad value - - name: memcached.increment - description: Increment Requests - unit: "requests" - chart_type: stacked - dimensions: - - name: hits - - name: misses - - name: memcached.decrement - description: Decrement Requests - unit: "requests" - chart_type: stacked - dimensions: - - name: hits - - name: misses - - name: memcached.touch - description: Touch Requests - unit: "requests" - chart_type: stacked - dimensions: - - name: hits - - name: misses - - name: memcached.touch_rate - description: Touch Request Rate - unit: "requests/s" - chart_type: line - dimensions: - - name: rate -- cgit v1.2.3