summaryrefslogtreecommitdiffstats
path: root/collectors/slabinfo.plugin
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-17 09:30:23 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-17 09:30:23 +0000
commit517a443636daa1e8085cb4e5325524a54e8a8fd7 (patch)
tree5352109cc7cd5122274ab0cfc1f887b685f04edf /collectors/slabinfo.plugin
parentReleasing debian version 1.42.4-1. (diff)
downloadnetdata-517a443636daa1e8085cb4e5325524a54e8a8fd7.tar.xz
netdata-517a443636daa1e8085cb4e5325524a54e8a8fd7.zip
Merging upstream version 1.43.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/slabinfo.plugin')
l---------[-rw-r--r--]collectors/slabinfo.plugin/README.md37
-rw-r--r--collectors/slabinfo.plugin/integrations/linux_kernel_slab_allocator_statistics.md130
-rw-r--r--collectors/slabinfo.plugin/metadata.yaml4
-rw-r--r--collectors/slabinfo.plugin/slabinfo.c2
4 files changed, 136 insertions, 37 deletions
diff --git a/collectors/slabinfo.plugin/README.md b/collectors/slabinfo.plugin/README.md
index abcbe1e3f..4d4629a77 100644..120000
--- a/collectors/slabinfo.plugin/README.md
+++ b/collectors/slabinfo.plugin/README.md
@@ -1,36 +1 @@
-<!--
-title: "slabinfo.plugin"
-custom_edit_url: "https://github.com/netdata/netdata/edit/master/collectors/slabinfo.plugin/README.md"
-sidebar_label: "slabinfo.plugin"
-learn_status: "Published"
-learn_topic_type: "References"
-learn_rel_path: "Integrations/Monitor/System metrics"
--->
-
-# slabinfo.plugin
-
-SLAB is a cache mechanism used by the Kernel to avoid fragmentation.
-
-Each internal structure (process, file descriptor, inode...) is stored within a SLAB.
-
-## configuring Netdata for slabinfo
-
-The plugin is disabled by default because it collects and displays a huge amount of metrics.
-To enable it set `slabinfo = yes` in the `plugins` section of the `netdata.conf` configuration file.
-
-If you are using [our official native DEB/RPM packages](https://github.com/netdata/netdata/blob/master/packaging/installer/methods/packages.md), you will additionally need to install the `netdata-plugin-slabinfo`
-package using your system package manager.
-
-There is currently no configuration needed for the plugin itself.
-
-As `/proc/slabinfo` is only readable by root, this plugin is setuid root.
-
-## For what use
-
-This slabinfo details allows to have clues on actions done on your system.
-In the following screenshot, you can clearly see a `find` done on a ext4 filesystem (the number of `ext4_inode_cache` & `dentry` are rising fast), and a few seconds later, an admin issued a `echo 3 > /proc/sys/vm/drop_cached` as their count dropped.
-
-![netdata_slabinfo](https://user-images.githubusercontent.com/9157986/64433811-7f06e500-d0bf-11e9-8e1e-087497e61033.png)
-
-
-
+integrations/linux_kernel_slab_allocator_statistics.md \ No newline at end of file
diff --git a/collectors/slabinfo.plugin/integrations/linux_kernel_slab_allocator_statistics.md b/collectors/slabinfo.plugin/integrations/linux_kernel_slab_allocator_statistics.md
new file mode 100644
index 000000000..54ccf605f
--- /dev/null
+++ b/collectors/slabinfo.plugin/integrations/linux_kernel_slab_allocator_statistics.md
@@ -0,0 +1,130 @@
+<!--startmeta
+custom_edit_url: "https://github.com/netdata/netdata/edit/master/collectors/slabinfo.plugin/README.md"
+meta_yaml: "https://github.com/netdata/netdata/edit/master/collectors/slabinfo.plugin/metadata.yaml"
+sidebar_label: "Linux kernel SLAB allocator statistics"
+learn_status: "Published"
+learn_rel_path: "Data Collection/Linux Systems/Kernel"
+message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
+endmeta-->
+
+# Linux kernel SLAB allocator statistics
+
+
+<img src="https://netdata.cloud/img/linuxserver.svg" width="150"/>
+
+
+Plugin: slabinfo.plugin
+Module: slabinfo.plugin
+
+<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
+
+## Overview
+
+Collects metrics on kernel SLAB cache utilization to monitor the low-level performance impact of workloads in the kernel.
+
+
+The plugin parses `/proc/slabinfo`
+
+This collector is only supported on the following platforms:
+
+- Linux
+
+This collector only supports collecting metrics from a single instance of this integration.
+
+This integration requires read access to `/proc/slabinfo`, which is accessible only to the root user by default. Netdata uses Linux Capabilities to give the plugin access to this file. `CAP_DAC_READ_SEARCH` is added automatically during installation. This capability allows bypassing file read permission checks and directory read and execute permission checks. If file capabilities are not usable, then the plugin is instead installed with the SUID bit set in permissions sVko that it runs as root.
+
+
+### Default Behavior
+
+#### Auto-Detection
+
+Due to the large number of metrics generated by this integration, it is disabled by default and must be manually enabled inside `/etc/netdata/netdata.conf`
+
+
+#### 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.
+
+SLAB cache utilization metrics for the whole system.
+
+### Per Linux kernel SLAB allocator statistics instance
+
+
+
+This scope has no labels.
+
+Metrics:
+
+| Metric | Dimensions | Unit |
+|:------|:----------|:----|
+| mem.slabmemory | a dimension per cache | B |
+| mem.slabfilling | a dimension per cache | % |
+| mem.slabwaste | a dimension per cache | B |
+
+
+
+## Alerts
+
+There are no alerts configured by default for this integration.
+
+
+## Setup
+
+### Prerequisites
+
+#### Minimum setup
+
+If you installed `netdata` using a package manager, it is also necessary to install the package `netdata-plugin-slabinfo`.
+
+
+### Configuration
+
+#### File
+
+The configuration file name for this integration is `netdata.conf`.
+Configuration for this specific integration is located in the `[plugins]` section within that file.
+
+The file format is a modified INI syntax. The general structure is:
+
+```ini
+[section1]
+ option1 = some value
+ option2 = some other value
+
+[section2]
+ option3 = some third value
+```
+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 netdata.conf
+```
+#### Options
+
+
+
+<details><summary>The main configuration file.</summary>
+
+| Name | Description | Default | Required |
+|:----|:-----------|:-------|:--------:|
+| Enable plugin | As described above plugin is disabled by default, this option is used to enable plugin. | no | True |
+
+</details>
+
+#### Examples
+There are no configuration examples.
+
+
diff --git a/collectors/slabinfo.plugin/metadata.yaml b/collectors/slabinfo.plugin/metadata.yaml
index 7d135d611..f19778297 100644
--- a/collectors/slabinfo.plugin/metadata.yaml
+++ b/collectors/slabinfo.plugin/metadata.yaml
@@ -50,7 +50,9 @@ modules:
description: ""
setup:
prerequisites:
- list: []
+ list:
+ - title: Minimum setup
+ description: "If you installed `netdata` using a package manager, it is also necessary to install the package `netdata-plugin-slabinfo`."
configuration:
file:
name: "netdata.conf"
diff --git a/collectors/slabinfo.plugin/slabinfo.c b/collectors/slabinfo.plugin/slabinfo.c
index 25b96e386..366cba643 100644
--- a/collectors/slabinfo.plugin/slabinfo.c
+++ b/collectors/slabinfo.plugin/slabinfo.c
@@ -343,6 +343,8 @@ int main(int argc, char **argv) {
program_version = "0.1";
error_log_syslog = 0;
+ log_set_global_severity_for_external_plugins();
+
int update_every = 1, i, n, freq = 0;
for (i = 1; i < argc; i++) {