remove deprecated python.d collectors announced in v1.37.0 deprecation notice (#14072)

This commit is contained in:
Ilya Mashchenko 2022-12-09 17:33:25 +02:00 committed by GitHub
parent fd6bff560f
commit ab28a99a48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 3 additions and 473 deletions

View File

@ -96,7 +96,7 @@ configure any of these collectors according to your setup and infrastructure.
- [Docker containers](/collectors/cgroups.plugin/README.md): Monitor the health and performance of individual Docker
containers using the cgroups collector plugin.
- [DockerD](/collectors/python.d.plugin/dockerd/README.md): Collect container health statistics.
- [DockerD](https://learn.netdata.cloud/docs/agent/collectors/go.d.plugin/modules/docker/): Collect container health statistics.
- [Docker Engine](https://learn.netdata.cloud/docs/agent/collectors/go.d.plugin/modules/docker_engine/): Collect
runtime statistics from the `docker` daemon using the `metrics-address` feature.
- [Docker Hub](https://learn.netdata.cloud/docs/agent/collectors/go.d.plugin/modules/dockerhub/): Collect statistics
@ -460,7 +460,7 @@ The Netdata Agent can collect these system- and hardware-level metrics using a v
### Users
- [systemd-logind](/collectors/python.d.plugin/logind/README.md): Monitor active sessions, users, and seats tracked
- [systemd-logind](https://learn.netdata.cloud/docs/agent/collectors/go.d.plugin/modules/logind/): Monitor active sessions, users, and seats tracked
by `systemd-logind` or `elogind`.
- [User/group usage](/collectors/apps.plugin/README.md): Gather CPU, disk, memory, network, and other metrics per user
and user group using the `apps.plugin` collector.

View File

@ -48,7 +48,6 @@ include bind_rndc/Makefile.inc
include boinc/Makefile.inc
include ceph/Makefile.inc
include changefinder/Makefile.inc
include dockerd/Makefile.inc
include dovecot/Makefile.inc
include example/Makefile.inc
include exim/Makefile.inc
@ -61,7 +60,6 @@ include hpssa/Makefile.inc
include icecast/Makefile.inc
include ipfs/Makefile.inc
include litespeed/Makefile.inc
include logind/Makefile.inc
include megacli/Makefile.inc
include memcached/Makefile.inc
include mongodb/Makefile.inc

View File

@ -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 += dockerd/dockerd.chart.py
dist_pythonconfig_DATA += dockerd/dockerd.conf
# do not install these files, but include them in the distribution
dist_noinst_DATA += dockerd/README.md dockerd/Makefile.inc

View File

@ -1,46 +0,0 @@
<!--
title: "Docker Engine monitoring with Netdata"
custom_edit_url: https://github.com/netdata/netdata/edit/master/collectors/python.d.plugin/dockerd/README.md
sidebar_label: "Docker Engine"
-->
# Docker Engine monitoring with Netdata
Collects docker container health metrics.
**Requirement:**
- `docker` package, required version 3.2.0+
Following charts are drawn:
1. **running containers**
- count
2. **healthy containers**
- count
3. **unhealthy containers**
- count
## Configuration
Edit the `python.d/dockerd.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/dockerd.conf
```
```yaml
update_every : 1
priority : 60000
```
---

View File

@ -1,86 +0,0 @@
# -*- coding: utf-8 -*-
# Description: docker netdata python.d module
# Author: Kévin Darcel (@tuxity)
try:
import docker
HAS_DOCKER = True
except ImportError:
HAS_DOCKER = False
from distutils.version import StrictVersion
from bases.FrameworkServices.SimpleService import SimpleService
# charts order (can be overridden if you want less charts, or different order)
ORDER = [
'running_containers',
'healthy_containers',
'unhealthy_containers'
]
CHARTS = {
'running_containers': {
'options': [None, 'Number of running containers', 'containers', 'running containers',
'docker.running_containers', 'line'],
'lines': [
['running_containers', 'running']
]
},
'healthy_containers': {
'options': [None, 'Number of healthy containers', 'containers', 'healthy containers',
'docker.healthy_containers', 'line'],
'lines': [
['healthy_containers', 'healthy']
]
},
'unhealthy_containers': {
'options': [None, 'Number of unhealthy containers', 'containers', 'unhealthy containers',
'docker.unhealthy_containers', 'line'],
'lines': [
['unhealthy_containers', 'unhealthy']
]
}
}
MIN_REQUIRED_VERSION = '3.2.0'
class Service(SimpleService):
def __init__(self, configuration=None, name=None):
SimpleService.__init__(self, configuration=configuration, name=name)
self.order = ORDER
self.definitions = CHARTS
self.client = None
def check(self):
if not HAS_DOCKER:
self.error("'docker' package is needed to use dockerd module")
return False
if StrictVersion(docker.__version__) < StrictVersion(MIN_REQUIRED_VERSION):
self.error("installed 'docker' package version {0}, minimum required version {1}, please upgrade".format(
docker.__version__,
MIN_REQUIRED_VERSION,
))
return False
self.client = docker.DockerClient(base_url=self.configuration.get('url', 'unix://var/run/docker.sock'))
try:
self.client.ping()
except docker.errors.APIError as error:
self.error(error)
return False
return True
def get_data(self):
data = dict()
data['running_containers'] = len(self.client.containers.list(sparse=True))
data['healthy_containers'] = len(self.client.containers.list(filters={'health': 'healthy'}, sparse=True))
data['unhealthy_containers'] = len(self.client.containers.list(filters={'health': 'unhealthy'}, sparse=True))
return data or None

View File

@ -1,77 +0,0 @@
# netdata python.d.plugin configuration for dockerd health data API
#
# 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, dockerd plugin also supports the following:
#
# url: '<scheme>://<host>:<port>/<health_page_api>'
# # http://localhost:8080/health
#
# 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)
#
local:
url: 'unix://var/run/docker.sock'

View File

@ -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 += logind/logind.chart.py
dist_pythonconfig_DATA += logind/logind.conf
# do not install these files, but include them in the distribution
dist_noinst_DATA += logind/README.md logind/Makefile.inc

View File

@ -1,86 +0,0 @@
<!--
title: "systemd-logind monitoring with Netdata"
custom_edit_url: https://github.com/netdata/netdata/edit/master/collectors/python.d.plugin/logind/README.md
sidebar_label: "systemd-logind"
-->
# Systemd-Logind monitoring with Netdata
Monitors active sessions, users, and seats tracked by `systemd-logind` or `elogind`.
It provides the following charts:
1. **Sessions** Tracks the total number of sessions.
- Graphical: Local graphical sessions (running X11, or Wayland, or something else).
- Console: Local console sessions.
- Remote: Remote sessions.
2. **Users** Tracks total number of unique user logins of each type.
- Graphical
- Console
- Remote
3. **Seats** Total number of seats in use.
- Seats
## Enable the collector
The `logind` collector is disabled by default. To enable it, use `edit-config` from the Netdata [config
directory](/docs/configure/nodes.md), which is typically at `/etc/netdata`, to edit the `python.d.conf` file.
```bash
cd /etc/netdata # Replace this path with your Netdata config directory, if different
sudo ./edit-config python.d.conf
```
Change the value of the `logind` setting to `yes`. Save the file and restart the Netdata Agent with `sudo systemctl
restart netdata`, or the appropriate method for your system, to finish enabling the `logind` collector.
## Configuration
This module needs no configuration. Just make sure the `netdata` user
can run the `loginctl` command and get a session list without having to
specify a path.
This will work with any command that can output data in the _exact_
same format as `loginctl list-sessions --no-legend`. If you have some
other command you want to use that outputs data in this format, you can
specify it using the `command` key like so:
```yaml
command: '/path/to/other/command'
```
Edit the `python.d/logind.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/logind.conf
```
## Notes
- This module's ability to track logins is dependent on what PAM services
are configured to register sessions with logind. In particular, for
most systems, it will only track TTY logins, local desktop logins,
and logins through remote shell connections.
- The users chart counts _usernames_ not UID's. This is potentially
important in configurations where multiple users have the same UID.
- The users chart counts any given user name up to once for _each_ type
of login. So if the same user has a graphical and a console login on a
system, they will show up once in the graphical count, and once in the
console count.
- Because the data collection process is rather expensive, this plugin
is currently disabled by default, and needs to be explicitly enabled in
`/etc/netdata/python.d.conf` before it will run.
---

View File

@ -1,85 +0,0 @@
# -*- coding: utf-8 -*-
# Description: logind netdata python.d module
# Author: Austin S. Hemmelgarn (Ferroin)
# SPDX-License-Identifier: GPL-3.0-or-later
from bases.FrameworkServices.ExecutableService import ExecutableService
priority = 59999
disabled_by_default = True
LOGINCTL_COMMAND = 'loginctl list-sessions --no-legend'
ORDER = [
'sessions',
'users',
'seats',
]
CHARTS = {
'sessions': {
'options': [None, 'Logind Sessions', 'sessions', 'sessions', 'logind.sessions', 'stacked'],
'lines': [
['sessions_graphical', 'Graphical', 'absolute', 1, 1],
['sessions_console', 'Console', 'absolute', 1, 1],
['sessions_remote', 'Remote', 'absolute', 1, 1]
]
},
'users': {
'options': [None, 'Logind Users', 'users', 'users', 'logind.users', 'stacked'],
'lines': [
['users_graphical', 'Graphical', 'absolute', 1, 1],
['users_console', 'Console', 'absolute', 1, 1],
['users_remote', 'Remote', 'absolute', 1, 1]
]
},
'seats': {
'options': [None, 'Logind Seats', 'seats', 'seats', 'logind.seats', 'line'],
'lines': [
['seats', 'Active Seats', 'absolute', 1, 1]
]
}
}
class Service(ExecutableService):
def __init__(self, configuration=None, name=None):
ExecutableService.__init__(self, configuration=configuration, name=name)
self.order = ORDER
self.definitions = CHARTS
self.command = LOGINCTL_COMMAND
def _get_data(self):
ret = {
'sessions_graphical': 0,
'sessions_console': 0,
'sessions_remote': 0,
}
users = {
'graphical': list(),
'console': list(),
'remote': list()
}
seats = list()
data = self._get_raw_data()
for item in data:
fields = item.split()
if len(fields) == 3:
users['remote'].append(fields[2])
ret['sessions_remote'] += 1
elif len(fields) == 4:
users['graphical'].append(fields[2])
ret['sessions_graphical'] += 1
seats.append(fields[3])
elif len(fields) == 5:
users['console'].append(fields[2])
ret['sessions_console'] += 1
seats.append(fields[3])
ret['users_graphical'] = len(set(users['graphical']))
ret['users_console'] = len(set(users['console']))
ret['users_remote'] = len(set(users['remote']))
ret['seats'] = len(set(seats))
return ret

View File

@ -1,60 +0,0 @@
# netdata python.d.plugin configuration for logind
#
# 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

View File

@ -34,7 +34,6 @@ gc_interval: 300
# boinc: yes
# ceph: yes
# changefinder: no
# dockerd: yes
# dovecot: yes
# this is just an example
@ -51,7 +50,6 @@ hpssa: no
# icecast: yes
# ipfs: yes
# litespeed: yes
logind: no
# megacli: yes
# memcached: yes
# mongodb: yes

View File

@ -22,7 +22,7 @@ services running inside of pods in your k8s cluster. Read more about [Kubernetes
monitoring](#collect-kubernetes-metrics) below.
A handful of additional collectors gather metrics from container-related services, such as
[dockerd](/collectors/python.d.plugin/dockerd/README.md) or [Docker
[dockerd](https://learn.netdata.cloud/docs/agent/collectors/go.d.plugin/modules/docker/) or [Docker
Engine](https://learn.netdata.cloud/docs/agent/collectors/go.d.plugin/modules/docker_engine/). You can find all
container collectors in our supported collectors list under the
[containers/VMs](/collectors/COLLECTORS.md#containers-and-vms) and