mirror of
https://github.com/netdata/netdata.git
synced 2025-04-03 04:55:33 +00:00
Updated copyright notices (#19256)
* updated copyright notices everywhere (I hope) * Update makeself.lsm * Update coverity-scan.sh * make all newlines be linux, not windows * remove copyright from all files (the take it from the repo), unless it is printed to users
This commit is contained in:
parent
c5b05b4545
commit
5928070239
107 changed files with 1749 additions and 1941 deletions
.github/scripts
REDISTRIBUTED.mddocs
developer-and-contributor-corner
diagrams
netdata-agent
packaging
check-for-go-toolchain.sh
cmake
Modules
FindGo.cmakeNetdataCompilerFlags.cmakeNetdataDashboard.cmakeNetdataDetectSystemd.cmakeNetdataEBPFCORE.cmakeNetdataEBPFLegacy.cmakeNetdataFetchContentExtra.cmakeNetdataGoTools.cmakeNetdataJSONC.cmakeNetdataLibBPF.cmakeNetdataProtobuf.cmakeNetdataSentry.cmakeNetdataUtil.cmakeNetdataVersion.cmakeNetdataYAML.cmake
pkg-files
docker
installer
makeself
utils
src
aclk/mqtt_websockets
claim
collectors
apps.plugin
cgroups.plugin
charts.d.plugin
common-contexts
common-contexts.hdisk-avgsz.hdisk-await.hdisk-busy.hdisk-io.hdisk-iotime.hdisk-ops.hdisk-qops.hdisk-svctm.hdisk-util.hmem-available.hmem-pgfaults.hmem-swap.hsystem-interrupts.hsystem-io.hsystem-ipc.hsystem-processes.h
cups.plugin
ebpf.plugin
freeipmi.plugin
ioping.plugin
nfacct.plugin
perf.plugin
python.d.plugin
python.d.plugin.in
python_modules/bases/FrameworkServices
systemd-journal.plugin
tc.plugin
utils
windows-events.plugin
xenstat.plugin
daemon
health/notifications
libnetdata
avl
os
parsers
spawn_server
web/gui
5
.github/scripts/package_cloud_wrapper.sh
vendored
5
.github/scripts/package_cloud_wrapper.sh
vendored
|
@ -1,4 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# This is a tool to help removal of packages from packagecloud.io
|
||||
# It utilizes the package_cloud utility provided from packagecloud.io
|
||||
|
@ -10,10 +11,8 @@
|
|||
# 1) PKG_CLOUD_TOKEN variable exported
|
||||
# 2) To properly install package_cloud when not found, it requires: ruby gcc gcc-c++ ruby-devel
|
||||
#
|
||||
# Copyright: SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# Author : Pavlos Emm. Katsoulakis (paul@netdata.cloud)
|
||||
#shellcheck disable=SC2068,SC2145
|
||||
|
||||
set -e
|
||||
PKG_CLOUD_CONFIG="$HOME/.package_cloud_configuration.cfg"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Redistributed software
|
||||
|
||||
Netdata copyright info:<br/>
|
||||
Copyright 2023, Netdata Inc.<br/>
|
||||
Copyright 2018-2025 Netdata Inc.<br/>
|
||||
Released under [GPL v3 or later](https://raw.githubusercontent.com/netdata/netdata/master/LICENSE).
|
||||
|
||||
Netdata uses SPDX license tags to identify the license for its files.
|
||||
|
|
|
@ -160,15 +160,15 @@ capitalization. In summary:
|
|||
Docker, Apache, NGINX)
|
||||
- Avoid camel case (NetData) or all caps (NETDATA).
|
||||
|
||||
Whenever you refer to the company Netdata, Inc., or the open-source monitoring Agent the company develops, capitalize both words.
|
||||
Whenever you refer to the company Netdata Inc., or the open-source monitoring Agent the company develops, capitalize both words.
|
||||
|
||||
However, if you’re referring to a process, user, or group on a Linux system, use lowercase and fence the word in an
|
||||
inline code block: `` `netdata` ``.
|
||||
|
||||
| | |
|
||||
|-----------------|------------------------------------------------------------------------------------------------|
|
||||
| Not recommended | The netdata agent, which spawns the netdata process, is actively maintained by netdata, inc. |
|
||||
| **Recommended** | The Netdata Agent, which spawns the `netdata` process, is actively maintained by Netdata, Inc. |
|
||||
| Not recommended | The netdata agent, which spawns the netdata process, is actively maintained by Netdata Inc. |
|
||||
| **Recommended** | The Netdata Agent, which spawns the `netdata` process, is actively maintained by Netdata Inc. |
|
||||
|
||||
#### Capitalization of document titles and page headings
|
||||
|
||||
|
|
|
@ -294,7 +294,7 @@
|
|||
<mxCell id="110" value="" style="shadow=0;dashed=0;html=1;strokeColor=none;labelPosition=center;verticalLabelPosition=bottom;verticalAlign=top;shape=mxgraph.mscae.cloud.api_management;fillColor=#0079D6;fontSize=20;align=center;" parent="1" vertex="1">
|
||||
<mxGeometry x="91" y="562" width="35" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<UserObject label="<div style="text-align: right"><b><font style="font-size: 24px">netdata</font></b></div><div style="text-align: right">simple. effective. awesome!</div><div style="text-align: right"><b>https://netdata.cloud</b></div><div style="text-align: right"><span style="font-size: 14px"><br>(C) Copyright 2023<br></span><span style="font-size: 14px">Netdata, Inc.</span></div>" link="https://netdata.cloud" id="111">
|
||||
<UserObject label="<div style="text-align: right"><b><font style="font-size: 24px">netdata</font></b></div><div style="text-align: right">simple. effective. awesome!</div><div style="text-align: right"><b>https://netdata.cloud</b></div><div style="text-align: right"><span style="font-size: 14px"><br>(C) Copyright 2018-2025<br></span><span style="font-size: 14px">Netdata Inc.</span></div>" link="https://netdata.cloud" id="111">
|
||||
<mxCell style="text;html=1;resizable=0;points=[];autosize=1;align=left;verticalAlign=top;spacingTop=-4;fontSize=20;" parent="1" vertex="1">
|
||||
<mxGeometry x="994" y="1763.666748046875" width="270" height="160" as="geometry" />
|
||||
</mxCell>
|
||||
|
|
|
@ -1,130 +1,130 @@
|
|||
# Securing Netdata Agents
|
||||
|
||||
By default, the Agent exposes its **local dashboard** on port `19999`. If the node has a public IP address, the dashboard and metrics are accessible to anyone at `http://NODE:19999`.
|
||||
|
||||
Protect your Agents by implementing any of these security measures:
|
||||
|
||||
**Recommended**:
|
||||
|
||||
- [Disable the local dashboard](#disable-the-local-dashboard): Best for users who monitor their systems through Netdata Cloud dashboards.
|
||||
- [Use Netdata Parents as Web Application Firewalls](#use-netdata-parents-as-web-application-firewalls): Deploy Parent nodes as border gateways to isolate production systems from direct internet exposure, even when using Netdata Cloud.
|
||||
|
||||
**Alternative Approaches**:
|
||||
|
||||
- [Restrict dashboard access to private LAN](#restrict-dashboard-access-to-private-lan): Suitable for accessing the local dashboard via a LAN connection.
|
||||
- [Configure granular access control](#configure-granular-access-control): Limit local dashboard access to specific IP addresses, such as trusted static IPs or management LAN connections.
|
||||
- [Deploy a reverse proxy](#deploy-a-reverse-proxy): Secure your dashboard with password protection and TLS encryption.
|
||||
|
||||
## Disable the local dashboard
|
||||
|
||||
Secure your nodes by disabling local dashboard access while maintaining Cloud monitoring capabilities:
|
||||
|
||||
- Eliminates public exposure of metrics and system information.
|
||||
- Maintains secure metrics viewing through Netdata Cloud via [ACLK](/src/aclk/README.md).
|
||||
|
||||
Edit the `[web]` section in `netdata.conf` using the [`edit-config`](/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script:
|
||||
|
||||
```text
|
||||
[web]
|
||||
mode = none
|
||||
```
|
||||
|
||||
Restart your Agent to apply changes. After restart, the local dashboard (http://NODE:19999) will no longer be accessible, but all metrics remain available through Netdata Cloud.
|
||||
|
||||
> **Note**
|
||||
>
|
||||
> For Docker deployments, set `NETDATA_HEALTHCHECK_TARGET=cli` in your environment variables.
|
||||
|
||||
## Use Netdata Parents as Web Application Firewalls
|
||||
|
||||
Enhance security by deploying Parent nodes as border gateways, eliminating the need for direct internet access from production Agents. Parent nodes:
|
||||
|
||||
- Act as application firewalls.
|
||||
- Receive metrics from Child Agents securely.
|
||||
- Serve dashboard requests using local data.
|
||||
- Maintain Netdata Cloud connectivity through encrypted connection.
|
||||
|
||||
For more information, see [Observability Centralization Points](/docs/observability-centralization-points/README.md).
|
||||
|
||||
## Restrict dashboard access to private LAN
|
||||
|
||||
Enhance security by binding the Agent to your organization's private management network interface. This limits dashboard access to your administrative LAN only.
|
||||
|
||||
Edit the `[web]` section in `netdata.conf` using the [`edit-config`](/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script:
|
||||
|
||||
```text
|
||||
[web]
|
||||
bind to = 10.1.1.1:19999 localhost:19999
|
||||
```
|
||||
|
||||
The Agent supports binding to multiple IPs and ports. When using hostnames, all resolved IPs will be used (for example, `localhost` typically resolves to both `127.0.0.1` and `::1`).
|
||||
|
||||
<details><summary>More info for cloud-based installations</summary>
|
||||
|
||||
For cloud environments without private LAN capabilities or multi-cloud deployments, you can create a virtual management network using mesh VPN tools like `tincd` or `gvpe`. These tools enable secure, private communication between servers while allowing administration stations to access management functions across your cloud infrastructure.
|
||||
|
||||
For `gvpe` specifically, we maintain a [deployment tool](https://github.com/netdata/netdata-demo-site/tree/master/gvpe) that includes:
|
||||
|
||||
- Pre-compiled binaries for Linux and FreeBSD.
|
||||
- macOS compilation script.
|
||||
- Configuration templates.
|
||||
|
||||
We use this tool to manage our Netdata demo sites across multiple hosting providers.
|
||||
|
||||
</details>
|
||||
|
||||
## Configure granular access control
|
||||
|
||||
Restrict access to your local dashboard while maintaining Netdata Cloud connectivity by using [access lists](/src/web/server/README.md#access-lists).
|
||||
|
||||
Edit the `[web]` section in `netdata.conf` using the [`edit-config`](/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script.
|
||||
|
||||
Use the `allow connections from` setting to permit specific IP addresses or hostnames:
|
||||
|
||||
```text
|
||||
[web]
|
||||
# Allow only localhost connections
|
||||
allow connections from = localhost
|
||||
|
||||
# Allow only from management LAN running on `10.X.X.X`
|
||||
allow connections from = 10.*
|
||||
|
||||
# Allow connections only from a specific FQDN/hostname
|
||||
allow connections from = example*
|
||||
```
|
||||
|
||||
The default setting `localhost *` allows both localhost and all external connections. You can customize this using Netdata's [simple patterns](/src/libnetdata/simple_pattern/README.md).
|
||||
|
||||
While `allow connections from` globally controls access to all Netdata services, you can set specific permissions for individual features:
|
||||
|
||||
```text
|
||||
[web]
|
||||
allow connections from = localhost *
|
||||
allow dashboard from = localhost *
|
||||
allow badges from = *
|
||||
allow streaming from = *
|
||||
allow netdata.conf from = localhost fd* 10.* 192.168.* 172.16.* 172.17.* 172.18.* 172.19.* 172.20.* 172.21.* 172.22.* 172.23.* 172.24.* 172.25.* 172.26.* 172.27.* 172.28.* 172.29.* 172.30.* 172.31.*
|
||||
allow management from = localhost
|
||||
```
|
||||
|
||||
For additional security:
|
||||
|
||||
- Review detailed access list options in the [Web Server documentation](/src/web/server/README.md#access-lists).
|
||||
- Consider [enabling SSL](/src/web/server/README.md#enable-httpstls-support) to encrypt local dashboard traffic (Netdata Cloud connections are always TLS-encrypted).
|
||||
|
||||
## Deploy a reverse proxy
|
||||
|
||||
Secure multiple Agents using a single authenticating web server as a reverse proxy. This provides:
|
||||
|
||||
- Unified access through URLs like `http://{HOST}/netdata/{NETDATA_HOSTNAME}/`.
|
||||
- Single sign-on across all Agents.
|
||||
- Optional TLS encryption.
|
||||
|
||||
We provide detailed configuration guides for popular web servers:
|
||||
|
||||
- [nginx](/docs/netdata-agent/configuration/running-the-netdata-agent-behind-a-reverse-proxy/Running-behind-nginx.md)
|
||||
- [HAProxy](/docs/netdata-agent/configuration/running-the-netdata-agent-behind-a-reverse-proxy/Running-behind-haproxy.md)
|
||||
- [Apache](/docs/netdata-agent/configuration/running-the-netdata-agent-behind-a-reverse-proxy/Running-behind-apache.md)
|
||||
- [Lighttpd](/docs/netdata-agent/configuration/running-the-netdata-agent-behind-a-reverse-proxy/Running-behind-lighttpd.md)
|
||||
- [Caddy](/docs/netdata-agent/configuration/running-the-netdata-agent-behind-a-reverse-proxy/Running-behind-caddy.md)
|
||||
- [H2O](/docs/netdata-agent/configuration/running-the-netdata-agent-behind-a-reverse-proxy/Running-behind-h2o.md)
|
||||
# Securing Netdata Agents
|
||||
|
||||
By default, the Agent exposes its **local dashboard** on port `19999`. If the node has a public IP address, the dashboard and metrics are accessible to anyone at `http://NODE:19999`.
|
||||
|
||||
Protect your Agents by implementing any of these security measures:
|
||||
|
||||
**Recommended**:
|
||||
|
||||
- [Disable the local dashboard](#disable-the-local-dashboard): Best for users who monitor their systems through Netdata Cloud dashboards.
|
||||
- [Use Netdata Parents as Web Application Firewalls](#use-netdata-parents-as-web-application-firewalls): Deploy Parent nodes as border gateways to isolate production systems from direct internet exposure, even when using Netdata Cloud.
|
||||
|
||||
**Alternative Approaches**:
|
||||
|
||||
- [Restrict dashboard access to private LAN](#restrict-dashboard-access-to-private-lan): Suitable for accessing the local dashboard via a LAN connection.
|
||||
- [Configure granular access control](#configure-granular-access-control): Limit local dashboard access to specific IP addresses, such as trusted static IPs or management LAN connections.
|
||||
- [Deploy a reverse proxy](#deploy-a-reverse-proxy): Secure your dashboard with password protection and TLS encryption.
|
||||
|
||||
## Disable the local dashboard
|
||||
|
||||
Secure your nodes by disabling local dashboard access while maintaining Cloud monitoring capabilities:
|
||||
|
||||
- Eliminates public exposure of metrics and system information.
|
||||
- Maintains secure metrics viewing through Netdata Cloud via [ACLK](/src/aclk/README.md).
|
||||
|
||||
Edit the `[web]` section in `netdata.conf` using the [`edit-config`](/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script:
|
||||
|
||||
```text
|
||||
[web]
|
||||
mode = none
|
||||
```
|
||||
|
||||
Restart your Agent to apply changes. After restart, the local dashboard (http://NODE:19999) will no longer be accessible, but all metrics remain available through Netdata Cloud.
|
||||
|
||||
> **Note**
|
||||
>
|
||||
> For Docker deployments, set `NETDATA_HEALTHCHECK_TARGET=cli` in your environment variables.
|
||||
|
||||
## Use Netdata Parents as Web Application Firewalls
|
||||
|
||||
Enhance security by deploying Parent nodes as border gateways, eliminating the need for direct internet access from production Agents. Parent nodes:
|
||||
|
||||
- Act as application firewalls.
|
||||
- Receive metrics from Child Agents securely.
|
||||
- Serve dashboard requests using local data.
|
||||
- Maintain Netdata Cloud connectivity through encrypted connection.
|
||||
|
||||
For more information, see [Observability Centralization Points](/docs/observability-centralization-points/README.md).
|
||||
|
||||
## Restrict dashboard access to private LAN
|
||||
|
||||
Enhance security by binding the Agent to your organization's private management network interface. This limits dashboard access to your administrative LAN only.
|
||||
|
||||
Edit the `[web]` section in `netdata.conf` using the [`edit-config`](/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script:
|
||||
|
||||
```text
|
||||
[web]
|
||||
bind to = 10.1.1.1:19999 localhost:19999
|
||||
```
|
||||
|
||||
The Agent supports binding to multiple IPs and ports. When using hostnames, all resolved IPs will be used (for example, `localhost` typically resolves to both `127.0.0.1` and `::1`).
|
||||
|
||||
<details><summary>More info for cloud-based installations</summary>
|
||||
|
||||
For cloud environments without private LAN capabilities or multi-cloud deployments, you can create a virtual management network using mesh VPN tools like `tincd` or `gvpe`. These tools enable secure, private communication between servers while allowing administration stations to access management functions across your cloud infrastructure.
|
||||
|
||||
For `gvpe` specifically, we maintain a [deployment tool](https://github.com/netdata/netdata-demo-site/tree/master/gvpe) that includes:
|
||||
|
||||
- Pre-compiled binaries for Linux and FreeBSD.
|
||||
- macOS compilation script.
|
||||
- Configuration templates.
|
||||
|
||||
We use this tool to manage our Netdata demo sites across multiple hosting providers.
|
||||
|
||||
</details>
|
||||
|
||||
## Configure granular access control
|
||||
|
||||
Restrict access to your local dashboard while maintaining Netdata Cloud connectivity by using [access lists](/src/web/server/README.md#access-lists).
|
||||
|
||||
Edit the `[web]` section in `netdata.conf` using the [`edit-config`](/docs/netdata-agent/configuration/README.md#edit-a-configuration-file-using-edit-config) script.
|
||||
|
||||
Use the `allow connections from` setting to permit specific IP addresses or hostnames:
|
||||
|
||||
```text
|
||||
[web]
|
||||
# Allow only localhost connections
|
||||
allow connections from = localhost
|
||||
|
||||
# Allow only from management LAN running on `10.X.X.X`
|
||||
allow connections from = 10.*
|
||||
|
||||
# Allow connections only from a specific FQDN/hostname
|
||||
allow connections from = example*
|
||||
```
|
||||
|
||||
The default setting `localhost *` allows both localhost and all external connections. You can customize this using Netdata's [simple patterns](/src/libnetdata/simple_pattern/README.md).
|
||||
|
||||
While `allow connections from` globally controls access to all Netdata services, you can set specific permissions for individual features:
|
||||
|
||||
```text
|
||||
[web]
|
||||
allow connections from = localhost *
|
||||
allow dashboard from = localhost *
|
||||
allow badges from = *
|
||||
allow streaming from = *
|
||||
allow netdata.conf from = localhost fd* 10.* 192.168.* 172.16.* 172.17.* 172.18.* 172.19.* 172.20.* 172.21.* 172.22.* 172.23.* 172.24.* 172.25.* 172.26.* 172.27.* 172.28.* 172.29.* 172.30.* 172.31.*
|
||||
allow management from = localhost
|
||||
```
|
||||
|
||||
For additional security:
|
||||
|
||||
- Review detailed access list options in the [Web Server documentation](/src/web/server/README.md#access-lists).
|
||||
- Consider [enabling SSL](/src/web/server/README.md#enable-httpstls-support) to encrypt local dashboard traffic (Netdata Cloud connections are always TLS-encrypted).
|
||||
|
||||
## Deploy a reverse proxy
|
||||
|
||||
Secure multiple Agents using a single authenticating web server as a reverse proxy. This provides:
|
||||
|
||||
- Unified access through URLs like `http://{HOST}/netdata/{NETDATA_HOSTNAME}/`.
|
||||
- Single sign-on across all Agents.
|
||||
- Optional TLS encryption.
|
||||
|
||||
We provide detailed configuration guides for popular web servers:
|
||||
|
||||
- [nginx](/docs/netdata-agent/configuration/running-the-netdata-agent-behind-a-reverse-proxy/Running-behind-nginx.md)
|
||||
- [HAProxy](/docs/netdata-agent/configuration/running-the-netdata-agent-behind-a-reverse-proxy/Running-behind-haproxy.md)
|
||||
- [Apache](/docs/netdata-agent/configuration/running-the-netdata-agent-behind-a-reverse-proxy/Running-behind-apache.md)
|
||||
- [Lighttpd](/docs/netdata-agent/configuration/running-the-netdata-agent-behind-a-reverse-proxy/Running-behind-lighttpd.md)
|
||||
- [Caddy](/docs/netdata-agent/configuration/running-the-netdata-agent-behind-a-reverse-proxy/Running-behind-caddy.md)
|
||||
- [H2O](/docs/netdata-agent/configuration/running-the-netdata-agent-behind-a-reverse-proxy/Running-behind-h2o.md)
|
||||
|
|
|
@ -429,7 +429,7 @@ if [ "$(id -u)" -ne 0 ] && [ -z "${NETDATA_PREPARE_ONLY}" ]; then
|
|||
fi
|
||||
|
||||
netdata_banner
|
||||
progress "real-time performance monitoring, done right!"
|
||||
progress "monitoring and troubleshooting, transformed!"
|
||||
cat << BANNER1
|
||||
|
||||
You are about to build and install netdata to your system.
|
||||
|
@ -999,7 +999,7 @@ fi
|
|||
# -----------------------------------------------------------------------------
|
||||
# check if we can re-start netdata
|
||||
|
||||
# TODO(paulfantom): Creation of configuration file should be handled by a build system. Additionally we shouldn't touch configuration files in /etc/netdata/...
|
||||
# TODO: Creation of configuration file should be handled by a build system. Additionally we shouldn't touch configuration files in /etc/netdata/...
|
||||
started=0
|
||||
if [ ${DONOTSTART} -eq 1 ]; then
|
||||
create_netdata_conf "${NETDATA_PREFIX}/etc/netdata/netdata.conf"
|
||||
|
|
|
@ -120,7 +120,7 @@ AutoReqProv: yes
|
|||
# Filter known bogus deps that would be caught by AutoReqProv.
|
||||
%global __requires_exclude_from ^%{_libdir}/%{name}/system/.*$
|
||||
|
||||
Summary: Real-time performance monitoring, done right!
|
||||
Summary: Netdata - Monitoring and troubleshooting, transformed!
|
||||
Name: netdata
|
||||
Version: %{version}
|
||||
Release: 1%{?dist}
|
||||
|
@ -1051,7 +1051,7 @@ fi
|
|||
- Fix /etc/netdata permissions
|
||||
* Mon Sep 23 2019 Konstantinos Natsakis <konstantinos.natsakis@gmail.com> 0.0.0-9
|
||||
- Do not build CUPS plugin subpackage on CentOS 6 and CentOS 7
|
||||
* Tue Aug 20 2019 Pavlos Emm. Katsoulakis <paul@netdat.acloud> - 0.0.0-8
|
||||
* Tue Aug 20 2019 Pavlos Emm. Katsoulakis <paul@netdata.cloud> - 0.0.0-8
|
||||
- Split CUPS functionality on separate package
|
||||
* Fri Jun 28 2019 Pavlos Emm. Katsoulakis <paul@netdata.cloud> - 0.0.0-7
|
||||
- Raise the path overrides to the spec file level, not just the configure.
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2024 Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-v3+
|
||||
#
|
||||
# Check if we need to install a Go toolchain.
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
# Custom CMake module to find the Go toolchain
|
||||
#
|
||||
# Copyright (c) 2024 Netdata Inc
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# Custom CMake module to find the Go toolchain
|
||||
#
|
||||
# This is a relatively orthodox CMake Find Module. It can be used by
|
||||
# simply including it and then invoking `find_package(Go)`.
|
||||
#
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# Functions to simplify handling of extra compiler flags.
|
||||
#
|
||||
# Copyright (c) 2024 Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Functions to simplify handling of extra compiler flags.
|
||||
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# CMake module to handle fetching and installing the dashboard code
|
||||
#
|
||||
# Copyright (c) 2024 Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# CMake module to handle fetching and installing the dashboard code
|
||||
|
||||
include(NetdataUtil)
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# CMake Module to handle all the systemd-related checks for Netdata.
|
||||
#
|
||||
# Copyright (c) 2024 Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# CMake Module to handle all the systemd-related checks for Netdata.
|
||||
|
||||
macro(detect_systemd)
|
||||
find_library(SYSTEMD_LIBRARY NAMES systemd)
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# Handling for eBPF CO-RE files
|
||||
#
|
||||
# Copyright (c) 2024 Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Handling for eBPF CO-RE files
|
||||
|
||||
include(ExternalProject)
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# Handling for eBPF legacy programs
|
||||
#
|
||||
# Copyright (c) 2024 Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Handling for eBPF legacy programs
|
||||
|
||||
include(ExternalProject)
|
||||
include(NetdataUtil)
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# Extra tools for working with FetchContent on older CMake
|
||||
#
|
||||
# Copyright (c) 2024 Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Extra tools for working with FetchContent on older CMake
|
||||
|
||||
# FetchContent_MakeAvailable_NoInstall
|
||||
#
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Macros and functions to assist in working with Go
|
||||
#
|
||||
# Copyright (c) 2024 Netdata Inc
|
||||
#
|
||||
# SPDX-License-Identifier: GPL
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
set(GO_LDFLAGS "-X github.com/netdata/netdata/go/plugins/pkg/buildinfo.Version=${NETDATA_VERSION_STRING}")
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# Functions and macros for handling of JSON-C
|
||||
#
|
||||
# Copyright (c) 2024 Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Functions and macros for handling of JSON-C
|
||||
|
||||
# Handle bundling of json-c.
|
||||
#
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# Handling for libbpf (used by the eBPF plugin)
|
||||
#
|
||||
# Copyright (c) 2024 Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Handling for libbpf (used by the eBPF plugin)
|
||||
|
||||
include(ExternalProject)
|
||||
include(NetdataUtil)
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# Macros and functions for handling of Protobuf
|
||||
#
|
||||
# Copyright (c) 2024 Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Macros and functions for handling of Protobuf
|
||||
|
||||
# Prepare a vendored copy of Protobuf for use with Netdata.
|
||||
function(netdata_bundle_protobuf)
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Functions and macros for handling of Sentry
|
||||
#
|
||||
# Copyright (c) 2024 Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Handle bundling of Sentry.
|
||||
#
|
||||
# This pulls it in as a sub-project using FetchContent functionality.
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# Utility functions used by other modules.
|
||||
#
|
||||
# Copyright (c) 2024 Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Utility functions used by other modules.
|
||||
|
||||
include_guard()
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
# Copyright (c) 2024 Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Function to provide information regarding the Netdata version.
|
||||
#
|
||||
# The high-level logic is (a) use git-describe, (b) fallback to info from
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# Functions and macros for handling of libYAML
|
||||
#
|
||||
# Copyright (c) 2024 Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# Functions and macros for handling of libYAML
|
||||
|
||||
# Handle bundling of libyaml.
|
||||
#
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: Netdata
|
||||
Upstream-Contact: Costa Tsaousis <costa@tsaousis.gr>
|
||||
Upstream-Contact: Netdata Inc. <info@netdata.cloud>
|
||||
Source: https://github.com/netdata/netdata
|
||||
|
||||
Files: *
|
||||
Copyright: 2014-2016, Costa Tsaousis
|
||||
Copyright: Copyright 2018-2025 Netdata Inc.
|
||||
License: GPL-3+
|
||||
On Debian systems, the complete text of the GNU General Public
|
||||
License version 3 can be found in /usr/share/common-licenses/GPL-3.
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# author : paulfantom
|
||||
|
||||
# This image contains preinstalled dependencies
|
||||
# hadolint ignore=DL3007
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Entry point script for netdata
|
||||
#
|
||||
# Copyright: 2018 and later Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# Author : Pavlos Emm. Katsoulakis <paul@netdata.cloud>
|
||||
# Author : Austin S. Hemmelgarn <austin@netdata.cloud>
|
||||
# Entry point script for netdata
|
||||
|
||||
set -e
|
||||
|
||||
if [ ! -w / ] && [ "${EUID}" -eq 0 ]; then
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# This is the netdata uninstaller script
|
||||
#
|
||||
|
@ -6,11 +7,6 @@
|
|||
# - NETDATA_PREFIX
|
||||
# - NETDATA_ADDED_TO_GROUPS
|
||||
#
|
||||
# Copyright: SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# Author: Paweł Krupa <paulfantom@gmail.com>
|
||||
# Author: Pavlos Emm. Katsoulakis <paul@netdata.cloud>
|
||||
#
|
||||
# Next unused error code: R0005
|
||||
|
||||
usage="$(basename "$0") [-h] [-f ] -- program to calculate the answer to life, the universe and everything
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# Netdata updater utility
|
||||
#
|
||||
# Variables needed by script:
|
||||
|
@ -20,13 +21,6 @@
|
|||
#
|
||||
# - TMPDIR (set to a usable temporary directory)
|
||||
# - NETDATA_NIGHTLIES_BASEURL (set the base url for downloading the dist tarball)
|
||||
#
|
||||
# Copyright: 2018-2023 Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# Author: Paweł Krupa <paulfantom@gmail.com>
|
||||
# Author: Pavlos Emm. Katsoulakis <paul@netdata.cloud>
|
||||
# Author: Austin S. Hemmelgarn <austin@netdata.cloud>
|
||||
|
||||
# Next unused error code: U001D
|
||||
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
#!/usr/bin/env sh
|
||||
# Copyright: SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# Installation script for the alpine host
|
||||
# to prepare the static binary
|
||||
#
|
||||
# Copyright: SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# Author: Paul Emm. Katsoulakis <paul@netdata.cloud>
|
||||
|
||||
apk update || exit 1
|
||||
apk upgrade || exit 1
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
|
||||
^
|
||||
|.-. .-. .-. .-. . netdata
|
||||
| '-' '-' '-' '-' real-time performance monitoring, done right!
|
||||
| '-' '-' '-' '-' monitoring and troubleshooting, transformed!
|
||||
+----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+--->
|
||||
|
||||
(C) Copyright 2017, Costa Tsaousis
|
||||
All rights reserved
|
||||
Released under GPL v3+
|
||||
Copyright 2018-2025 Netdata Inc.
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
You are about to install netdata to this system.
|
||||
netdata will be installed at:
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
|
||||
^
|
||||
|.-. .-. .-. .-. . netdata
|
||||
| '-' '-' '-' '-' real-time performance monitoring, done right!
|
||||
| '-' '-' '-' '-' monitoring and troubleshooting, transformed!
|
||||
+----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+--->
|
||||
|
||||
(C) Copyright 2017-2023, Costa Tsaousis
|
||||
All rights reserved
|
||||
Released under GPL v3+
|
||||
Copyright 2018-2025 Netdata Inc.
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
You are about to install netdata to this system.
|
||||
netdata will be installed at:
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
Begin3
|
||||
Title: netdata
|
||||
Version: NETDATA_VERSION
|
||||
Description: netdata is a system for distributed real-time performance and health monitoring.
|
||||
Description: Netdata - Monitoring and troubleshooting, transformed!
|
||||
It provides unparalleled insights, in real-time, of everything happening on the
|
||||
system it runs (including applications such as web and database servers), using
|
||||
systems it runs (including applications such as web and database servers), using
|
||||
modern interactive web dashboards. netdata is fast and efficient, designed to
|
||||
permanently run on all systems (physical & virtual servers, containers, IoT
|
||||
devices), without disrupting their core function.
|
||||
Keywords: real-time performance and health monitoring
|
||||
Author: Costa Tsaousis (costa@tsaousis.gr)
|
||||
Maintained-by: Costa Tsaousis (costa@tsaousis.gr)
|
||||
Author: Netdata Inc.
|
||||
Maintained-by: Netdata Inc.
|
||||
Original-site: https://netdata.cloud/
|
||||
Platform: Unix
|
||||
Copying-policy: GPL
|
||||
|
|
|
@ -1,14 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# shellcheck disable=SC1091,SC2230,SC2086
|
||||
#
|
||||
# Coverity scan script
|
||||
#
|
||||
# Copyright: SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# Author : Costa Tsaousis (costa@netdata.cloud)
|
||||
# Author : Pawel Krupa (paulfantom)
|
||||
# Author : Pavlos Emm. Katsoulakis (paul@netdata.cloud)
|
||||
# shellcheck disable=SC1091,SC2230,SC2086
|
||||
|
||||
# To run manually, save configuration to .coverity-scan.conf like this:
|
||||
#
|
||||
# the repository to report to coverity - devs can set here their own fork
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2020 Timotej Šiškovič
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2024 Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# %%NEW_CLAIMING_METHOD%%
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/*
|
||||
* netdata apps.plugin
|
||||
* (C) Copyright 2023 Netdata Inc.
|
||||
* Released under GPL v3+
|
||||
*/
|
||||
|
||||
#include "apps_plugin.h"
|
||||
#include "libnetdata/required_dummies.h"
|
||||
|
||||
|
@ -509,7 +503,7 @@ static void parse_args(int argc, char **argv)
|
|||
fprintf(stderr,
|
||||
"\n"
|
||||
" netdata apps.plugin %s\n"
|
||||
" Copyright (C) 2016-2017 Costa Tsaousis <costa@tsaousis.gr>\n"
|
||||
" Copyright 2018-2025 Netdata Inc.\n"
|
||||
" Released under GNU General Public License v3 or later.\n"
|
||||
" All rights reserved.\n"
|
||||
"\n"
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
#shellcheck disable=SC2001
|
||||
|
||||
# netdata
|
||||
# real-time performance and health monitoring, done right!
|
||||
# (C) 2023 Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# Script to find a better name for cgroups
|
||||
#
|
||||
#shellcheck disable=SC2001
|
||||
|
||||
export PATH="${PATH}:/sbin:/usr/sbin:/usr/local/sbin:@sbindir_POST@"
|
||||
export LC_ALL=C
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
# shellcheck disable=SC1117
|
||||
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# cgroup-network-helper.sh
|
||||
# detect container and virtual machine interfaces
|
||||
#
|
||||
# (C) 2023 Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# This script is called as root (by cgroup-network), with either a pid, or a cgroup path.
|
||||
# It tries to find all the network interfaces that belong to the same cgroup.
|
||||
|
@ -20,6 +18,7 @@
|
|||
#
|
||||
# 3. this script, calls virsh to find libvirt network interfaces.
|
||||
#
|
||||
# shellcheck disable=SC1117
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# netdata
|
||||
# real-time performance and health monitoring, done right!
|
||||
# (C) 2017 Costa Tsaousis <costa@tsaousis.gr>
|
||||
# GPL v3+
|
||||
#
|
||||
# charts.d.plugin allows easy development of BASH plugins
|
||||
#
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
# shellcheck shell=bash
|
||||
# no need for shebang - this file is loaded from charts.d.plugin
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# netdata
|
||||
# real-time performance and health monitoring, done right!
|
||||
# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
|
||||
#
|
||||
# shellcheck shell=bash
|
||||
|
||||
# if this chart is called X.chart.sh, then all functions and global variables
|
||||
# must start with X_
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
# no need for shebang - this file is loaded from charts.d.plugin
|
||||
|
||||
# netdata
|
||||
# real-time performance and health monitoring, done right!
|
||||
# (C) 2018 Costa Tsaousis <costa@tsaousis.gr>
|
||||
# GPL v3+
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# to enable this chart, you have to set this to 12345
|
||||
# (just a demonstration for something that needs to be checked)
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
# shellcheck shell=bash disable=SC1117
|
||||
# no need for shebang - this file is loaded from charts.d.plugin
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# netdata
|
||||
# real-time performance and health monitoring, done right!
|
||||
# (C) 2018 Costa Tsaousis <costa@tsaousis.gr>
|
||||
# shellcheck shell=bash disable=SC1117
|
||||
#
|
||||
|
||||
# _update_every is a special variable - it holds the number of seconds
|
||||
# between the calls of the _update() function
|
||||
libreswan_update_every=1
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
# no need for shebang - this file is loaded from charts.d.plugin
|
||||
|
||||
# netdata
|
||||
# real-time performance and health monitoring, done right!
|
||||
# (C) 2018 Costa Tsaousis <costa@tsaousis.gr>
|
||||
# GPL v3+
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# the data collection frequency
|
||||
# if unset, will inherit the netdata update frequency
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
# shellcheck shell=bash disable=SC1117,SC2154,SC2086
|
||||
# no need for shebang - this file is loaded from charts.d.plugin
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# netdata
|
||||
# real-time performance and health monitoring, done right!
|
||||
# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
|
||||
#
|
||||
# shellcheck shell=bash disable=SC1117,SC2154,SC2086
|
||||
|
||||
opensips_opts="fifo get_statistics all"
|
||||
opensips_cmd=
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
# no need for shebang - this file is loaded from charts.d.plugin
|
||||
|
||||
# netdata
|
||||
# real-time performance and health monitoring, done right!
|
||||
# (C) 2018 Costa Tsaousis <costa@tsaousis.gr>
|
||||
# GPL v3+
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#opensips_opts="fifo get_statistics all"
|
||||
#opensips_cmd=
|
||||
|
|
|
@ -1,39 +1,39 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_COMMON_CONTEXTS_H
|
||||
#define NETDATA_COMMON_CONTEXTS_H
|
||||
|
||||
#include "../../libnetdata/libnetdata.h"
|
||||
#include "../../database/rrd.h"
|
||||
|
||||
#ifndef _COMMON_PLUGIN_NAME
|
||||
#error You need to set _COMMON_PLUGIN_NAME before including common-contexts.h
|
||||
#endif
|
||||
|
||||
#ifndef _COMMON_PLUGIN_MODULE_NAME
|
||||
#error You need to set _COMMON_PLUGIN_MODULE_NAME before including common-contexts.h
|
||||
#endif
|
||||
|
||||
#define _COMMON_CONFIG_SECTION "plugin:" _COMMON_PLUGIN_NAME ":" _COMMON_PLUGIN_MODULE_NAME
|
||||
|
||||
typedef void (*instance_labels_cb_t)(RRDSET *st, void *data);
|
||||
|
||||
#include "system-io.h"
|
||||
#include "system-ram.h"
|
||||
#include "system-interrupts.h"
|
||||
#include "system-processes.h"
|
||||
#include "system-ipc.h"
|
||||
#include "mem-swap.h"
|
||||
#include "mem-pgfaults.h"
|
||||
#include "mem-available.h"
|
||||
#include "disk-io.h"
|
||||
#include "disk-ops.h"
|
||||
#include "disk-qops.h"
|
||||
#include "disk-util.h"
|
||||
#include "disk-busy.h"
|
||||
#include "disk-iotime.h"
|
||||
#include "disk-await.h"
|
||||
#include "disk-svctm.h"
|
||||
#include "disk-avgsz.h"
|
||||
|
||||
#endif //NETDATA_COMMON_CONTEXTS_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_COMMON_CONTEXTS_H
|
||||
#define NETDATA_COMMON_CONTEXTS_H
|
||||
|
||||
#include "../../libnetdata/libnetdata.h"
|
||||
#include "../../database/rrd.h"
|
||||
|
||||
#ifndef _COMMON_PLUGIN_NAME
|
||||
#error You need to set _COMMON_PLUGIN_NAME before including common-contexts.h
|
||||
#endif
|
||||
|
||||
#ifndef _COMMON_PLUGIN_MODULE_NAME
|
||||
#error You need to set _COMMON_PLUGIN_MODULE_NAME before including common-contexts.h
|
||||
#endif
|
||||
|
||||
#define _COMMON_CONFIG_SECTION "plugin:" _COMMON_PLUGIN_NAME ":" _COMMON_PLUGIN_MODULE_NAME
|
||||
|
||||
typedef void (*instance_labels_cb_t)(RRDSET *st, void *data);
|
||||
|
||||
#include "system-io.h"
|
||||
#include "system-ram.h"
|
||||
#include "system-interrupts.h"
|
||||
#include "system-processes.h"
|
||||
#include "system-ipc.h"
|
||||
#include "mem-swap.h"
|
||||
#include "mem-pgfaults.h"
|
||||
#include "mem-available.h"
|
||||
#include "disk-io.h"
|
||||
#include "disk-ops.h"
|
||||
#include "disk-qops.h"
|
||||
#include "disk-util.h"
|
||||
#include "disk-busy.h"
|
||||
#include "disk-iotime.h"
|
||||
#include "disk-await.h"
|
||||
#include "disk-svctm.h"
|
||||
#include "disk-avgsz.h"
|
||||
|
||||
#endif //NETDATA_COMMON_CONTEXTS_H
|
||||
|
|
|
@ -1,44 +1,44 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_DISK_AVGSZ_H
|
||||
#define NETDATA_DISK_AVGSZ_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
typedef struct {
|
||||
RRDSET *st_avgsz;
|
||||
RRDDIM *rd_avgsz_reads;
|
||||
RRDDIM *rd_avgsz_writes;
|
||||
} ND_DISK_AVGSZ;
|
||||
|
||||
static inline void common_disk_avgsz(ND_DISK_AVGSZ *d, const char *id, const char *name, uint64_t avg_bytes_read, uint64_t avg_bytes_write, int update_every, instance_labels_cb_t cb, void *data) {
|
||||
if(unlikely(!d->st_avgsz)) {
|
||||
d->st_avgsz = rrdset_create_localhost(
|
||||
"disk_avgsz"
|
||||
, id
|
||||
, name
|
||||
, "io"
|
||||
, "disk.avgsz"
|
||||
, "Average Completed I/O Operation Bandwidth"
|
||||
, "KiB/operation"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_DISK_AVGSZ
|
||||
, update_every
|
||||
, RRDSET_TYPE_AREA
|
||||
);
|
||||
|
||||
d->rd_avgsz_reads = rrddim_add(d->st_avgsz, "reads", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE);
|
||||
d->rd_avgsz_writes = rrddim_add(d->st_avgsz, "writes", NULL, -1, 1024, RRD_ALGORITHM_ABSOLUTE);
|
||||
|
||||
if(cb)
|
||||
cb(d->st_avgsz, data);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(d->st_avgsz, d->rd_avgsz_reads, (collected_number)avg_bytes_read);
|
||||
rrddim_set_by_pointer(d->st_avgsz, d->rd_avgsz_writes, (collected_number)avg_bytes_write);
|
||||
rrdset_done(d->st_avgsz);
|
||||
}
|
||||
|
||||
#endif //NETDATA_DISK_AVGSZ_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_DISK_AVGSZ_H
|
||||
#define NETDATA_DISK_AVGSZ_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
typedef struct {
|
||||
RRDSET *st_avgsz;
|
||||
RRDDIM *rd_avgsz_reads;
|
||||
RRDDIM *rd_avgsz_writes;
|
||||
} ND_DISK_AVGSZ;
|
||||
|
||||
static inline void common_disk_avgsz(ND_DISK_AVGSZ *d, const char *id, const char *name, uint64_t avg_bytes_read, uint64_t avg_bytes_write, int update_every, instance_labels_cb_t cb, void *data) {
|
||||
if(unlikely(!d->st_avgsz)) {
|
||||
d->st_avgsz = rrdset_create_localhost(
|
||||
"disk_avgsz"
|
||||
, id
|
||||
, name
|
||||
, "io"
|
||||
, "disk.avgsz"
|
||||
, "Average Completed I/O Operation Bandwidth"
|
||||
, "KiB/operation"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_DISK_AVGSZ
|
||||
, update_every
|
||||
, RRDSET_TYPE_AREA
|
||||
);
|
||||
|
||||
d->rd_avgsz_reads = rrddim_add(d->st_avgsz, "reads", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE);
|
||||
d->rd_avgsz_writes = rrddim_add(d->st_avgsz, "writes", NULL, -1, 1024, RRD_ALGORITHM_ABSOLUTE);
|
||||
|
||||
if(cb)
|
||||
cb(d->st_avgsz, data);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(d->st_avgsz, d->rd_avgsz_reads, (collected_number)avg_bytes_read);
|
||||
rrddim_set_by_pointer(d->st_avgsz, d->rd_avgsz_writes, (collected_number)avg_bytes_write);
|
||||
rrdset_done(d->st_avgsz);
|
||||
}
|
||||
|
||||
#endif //NETDATA_DISK_AVGSZ_H
|
||||
|
|
|
@ -1,44 +1,44 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_DISK_AWAIT_H
|
||||
#define NETDATA_DISK_AWAIT_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
typedef struct {
|
||||
RRDSET *st_await;
|
||||
RRDDIM *rd_await_reads;
|
||||
RRDDIM *rd_await_writes;
|
||||
} ND_DISK_AWAIT;
|
||||
|
||||
static inline void common_disk_await(ND_DISK_AWAIT *d, const char *id, const char *name, double read_avg_ms, double write_avg_ms, int update_every, instance_labels_cb_t cb, void *data) {
|
||||
if(unlikely(!d->st_await)) {
|
||||
d->st_await = rrdset_create_localhost(
|
||||
"disk_await"
|
||||
, id
|
||||
, name
|
||||
, "latency"
|
||||
, "disk.await"
|
||||
, "Average Completed I/O Operation Time"
|
||||
, "milliseconds/operation"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_DISK_AWAIT
|
||||
, update_every
|
||||
, RRDSET_TYPE_LINE
|
||||
);
|
||||
|
||||
d->rd_await_reads = rrddim_add(d->st_await, "reads", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE);
|
||||
d->rd_await_writes = rrddim_add(d->st_await, "writes", NULL, -1, 1000, RRD_ALGORITHM_ABSOLUTE);
|
||||
|
||||
if(cb)
|
||||
cb(d->st_await, data);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(d->st_await, d->rd_await_reads, (collected_number)(read_avg_ms * 1000.0));
|
||||
rrddim_set_by_pointer(d->st_await, d->rd_await_writes, (collected_number)(write_avg_ms * 1000.0));
|
||||
rrdset_done(d->st_await);
|
||||
}
|
||||
|
||||
#endif //NETDATA_DISK_AWAIT_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_DISK_AWAIT_H
|
||||
#define NETDATA_DISK_AWAIT_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
typedef struct {
|
||||
RRDSET *st_await;
|
||||
RRDDIM *rd_await_reads;
|
||||
RRDDIM *rd_await_writes;
|
||||
} ND_DISK_AWAIT;
|
||||
|
||||
static inline void common_disk_await(ND_DISK_AWAIT *d, const char *id, const char *name, double read_avg_ms, double write_avg_ms, int update_every, instance_labels_cb_t cb, void *data) {
|
||||
if(unlikely(!d->st_await)) {
|
||||
d->st_await = rrdset_create_localhost(
|
||||
"disk_await"
|
||||
, id
|
||||
, name
|
||||
, "latency"
|
||||
, "disk.await"
|
||||
, "Average Completed I/O Operation Time"
|
||||
, "milliseconds/operation"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_DISK_AWAIT
|
||||
, update_every
|
||||
, RRDSET_TYPE_LINE
|
||||
);
|
||||
|
||||
d->rd_await_reads = rrddim_add(d->st_await, "reads", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE);
|
||||
d->rd_await_writes = rrddim_add(d->st_await, "writes", NULL, -1, 1000, RRD_ALGORITHM_ABSOLUTE);
|
||||
|
||||
if(cb)
|
||||
cb(d->st_await, data);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(d->st_await, d->rd_await_reads, (collected_number)(read_avg_ms * 1000.0));
|
||||
rrddim_set_by_pointer(d->st_await, d->rd_await_writes, (collected_number)(write_avg_ms * 1000.0));
|
||||
rrdset_done(d->st_await);
|
||||
}
|
||||
|
||||
#endif //NETDATA_DISK_AWAIT_H
|
||||
|
|
|
@ -1,41 +1,41 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_DISK_BUSY_H
|
||||
#define NETDATA_DISK_BUSY_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
typedef struct {
|
||||
RRDSET *st_busy;
|
||||
RRDDIM *rd_busy;
|
||||
} ND_DISK_BUSY;
|
||||
|
||||
static inline void common_disk_busy(ND_DISK_BUSY *d, const char *id, const char *name, uint64_t busy_ms, int update_every, instance_labels_cb_t cb, void *data) {
|
||||
if(unlikely(!d->st_busy)) {
|
||||
d->st_busy = rrdset_create_localhost(
|
||||
"disk_busy"
|
||||
, id
|
||||
, name
|
||||
, "utilization"
|
||||
, "disk.busy"
|
||||
, "Disk Busy Time"
|
||||
, "milliseconds"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_DISK_BUSY
|
||||
, update_every
|
||||
, RRDSET_TYPE_AREA
|
||||
);
|
||||
|
||||
d->rd_busy = rrddim_add(d->st_busy, "busy", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
|
||||
|
||||
if(cb)
|
||||
cb(d->st_busy, data);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(d->st_busy, d->rd_busy, (collected_number)busy_ms);
|
||||
rrdset_done(d->st_busy);
|
||||
}
|
||||
|
||||
#endif //NETDATA_DISK_BUSY_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_DISK_BUSY_H
|
||||
#define NETDATA_DISK_BUSY_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
typedef struct {
|
||||
RRDSET *st_busy;
|
||||
RRDDIM *rd_busy;
|
||||
} ND_DISK_BUSY;
|
||||
|
||||
static inline void common_disk_busy(ND_DISK_BUSY *d, const char *id, const char *name, uint64_t busy_ms, int update_every, instance_labels_cb_t cb, void *data) {
|
||||
if(unlikely(!d->st_busy)) {
|
||||
d->st_busy = rrdset_create_localhost(
|
||||
"disk_busy"
|
||||
, id
|
||||
, name
|
||||
, "utilization"
|
||||
, "disk.busy"
|
||||
, "Disk Busy Time"
|
||||
, "milliseconds"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_DISK_BUSY
|
||||
, update_every
|
||||
, RRDSET_TYPE_AREA
|
||||
);
|
||||
|
||||
d->rd_busy = rrddim_add(d->st_busy, "busy", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
|
||||
|
||||
if(cb)
|
||||
cb(d->st_busy, data);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(d->st_busy, d->rd_busy, (collected_number)busy_ms);
|
||||
rrdset_done(d->st_busy);
|
||||
}
|
||||
|
||||
#endif //NETDATA_DISK_BUSY_H
|
||||
|
|
|
@ -1,44 +1,44 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_DISK_IO_H
|
||||
#define NETDATA_DISK_IO_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
typedef struct {
|
||||
RRDSET *st_io;
|
||||
RRDDIM *rd_io_reads;
|
||||
RRDDIM *rd_io_writes;
|
||||
} ND_DISK_IO;
|
||||
|
||||
static inline void common_disk_io(ND_DISK_IO *d, const char *id, const char *name, uint64_t bytes_read, uint64_t bytes_write, int update_every, instance_labels_cb_t cb, void *data) {
|
||||
if(unlikely(!d->st_io)) {
|
||||
d->st_io = rrdset_create_localhost(
|
||||
"disk"
|
||||
, id
|
||||
, name
|
||||
, "io"
|
||||
, "disk.io"
|
||||
, "Disk I/O Bandwidth"
|
||||
, "KiB/s"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_DISK_IO
|
||||
, update_every
|
||||
, RRDSET_TYPE_AREA
|
||||
);
|
||||
|
||||
d->rd_io_reads = rrddim_add(d->st_io, "reads", NULL, 1, 1024, RRD_ALGORITHM_INCREMENTAL);
|
||||
d->rd_io_writes = rrddim_add(d->st_io, "writes", NULL, -1, 1024, RRD_ALGORITHM_INCREMENTAL);
|
||||
|
||||
if(cb)
|
||||
cb(d->st_io, data);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(d->st_io, d->rd_io_reads, (collected_number)bytes_read);
|
||||
rrddim_set_by_pointer(d->st_io, d->rd_io_writes, (collected_number)bytes_write);
|
||||
rrdset_done(d->st_io);
|
||||
}
|
||||
|
||||
#endif //NETDATA_DISK_IO_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_DISK_IO_H
|
||||
#define NETDATA_DISK_IO_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
typedef struct {
|
||||
RRDSET *st_io;
|
||||
RRDDIM *rd_io_reads;
|
||||
RRDDIM *rd_io_writes;
|
||||
} ND_DISK_IO;
|
||||
|
||||
static inline void common_disk_io(ND_DISK_IO *d, const char *id, const char *name, uint64_t bytes_read, uint64_t bytes_write, int update_every, instance_labels_cb_t cb, void *data) {
|
||||
if(unlikely(!d->st_io)) {
|
||||
d->st_io = rrdset_create_localhost(
|
||||
"disk"
|
||||
, id
|
||||
, name
|
||||
, "io"
|
||||
, "disk.io"
|
||||
, "Disk I/O Bandwidth"
|
||||
, "KiB/s"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_DISK_IO
|
||||
, update_every
|
||||
, RRDSET_TYPE_AREA
|
||||
);
|
||||
|
||||
d->rd_io_reads = rrddim_add(d->st_io, "reads", NULL, 1, 1024, RRD_ALGORITHM_INCREMENTAL);
|
||||
d->rd_io_writes = rrddim_add(d->st_io, "writes", NULL, -1, 1024, RRD_ALGORITHM_INCREMENTAL);
|
||||
|
||||
if(cb)
|
||||
cb(d->st_io, data);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(d->st_io, d->rd_io_reads, (collected_number)bytes_read);
|
||||
rrddim_set_by_pointer(d->st_io, d->rd_io_writes, (collected_number)bytes_write);
|
||||
rrdset_done(d->st_io);
|
||||
}
|
||||
|
||||
#endif //NETDATA_DISK_IO_H
|
||||
|
|
|
@ -1,44 +1,44 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_DISK_IOTIME_H
|
||||
#define NETDATA_DISK_IOTIME_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
typedef struct {
|
||||
RRDSET *st_iotime;
|
||||
RRDDIM *rd_reads_ms;
|
||||
RRDDIM *rd_writes_ms;
|
||||
} ND_DISK_IOTIME;
|
||||
|
||||
static inline void common_disk_iotime(ND_DISK_IOTIME *d, const char *id, const char *name, uint64_t reads_ms, uint64_t writes_ms, int update_every, instance_labels_cb_t cb, void *data) {
|
||||
if(unlikely(!d->st_iotime)) {
|
||||
d->st_iotime = rrdset_create_localhost(
|
||||
"disk_iotime"
|
||||
, id
|
||||
, name
|
||||
, "utilization"
|
||||
, "disk.iotime"
|
||||
, "Disk Total I/O Time"
|
||||
, "milliseconds/s"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_DISK_IOTIME
|
||||
, update_every
|
||||
, RRDSET_TYPE_AREA
|
||||
);
|
||||
|
||||
d->rd_reads_ms = rrddim_add(d->st_iotime, "reads", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
|
||||
d->rd_writes_ms = rrddim_add(d->st_iotime, "writes", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
|
||||
|
||||
if(cb)
|
||||
cb(d->st_iotime, data);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(d->st_iotime, d->rd_reads_ms, (collected_number)reads_ms);
|
||||
rrddim_set_by_pointer(d->st_iotime, d->rd_writes_ms, (collected_number)writes_ms);
|
||||
rrdset_done(d->st_iotime);
|
||||
}
|
||||
|
||||
#endif //NETDATA_DISK_IOTIME_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_DISK_IOTIME_H
|
||||
#define NETDATA_DISK_IOTIME_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
typedef struct {
|
||||
RRDSET *st_iotime;
|
||||
RRDDIM *rd_reads_ms;
|
||||
RRDDIM *rd_writes_ms;
|
||||
} ND_DISK_IOTIME;
|
||||
|
||||
static inline void common_disk_iotime(ND_DISK_IOTIME *d, const char *id, const char *name, uint64_t reads_ms, uint64_t writes_ms, int update_every, instance_labels_cb_t cb, void *data) {
|
||||
if(unlikely(!d->st_iotime)) {
|
||||
d->st_iotime = rrdset_create_localhost(
|
||||
"disk_iotime"
|
||||
, id
|
||||
, name
|
||||
, "utilization"
|
||||
, "disk.iotime"
|
||||
, "Disk Total I/O Time"
|
||||
, "milliseconds/s"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_DISK_IOTIME
|
||||
, update_every
|
||||
, RRDSET_TYPE_AREA
|
||||
);
|
||||
|
||||
d->rd_reads_ms = rrddim_add(d->st_iotime, "reads", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
|
||||
d->rd_writes_ms = rrddim_add(d->st_iotime, "writes", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
|
||||
|
||||
if(cb)
|
||||
cb(d->st_iotime, data);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(d->st_iotime, d->rd_reads_ms, (collected_number)reads_ms);
|
||||
rrddim_set_by_pointer(d->st_iotime, d->rd_writes_ms, (collected_number)writes_ms);
|
||||
rrdset_done(d->st_iotime);
|
||||
}
|
||||
|
||||
#endif //NETDATA_DISK_IOTIME_H
|
||||
|
|
|
@ -1,44 +1,44 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_DISK_OPS_H
|
||||
#define NETDATA_DISK_OPS_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
typedef struct {
|
||||
RRDSET *st_ops;
|
||||
RRDDIM *rd_ops_reads;
|
||||
RRDDIM *rd_ops_writes;
|
||||
} ND_DISK_OPS;
|
||||
|
||||
static inline void common_disk_ops(ND_DISK_OPS *d, const char *id, const char *name, uint64_t ops_read, uint64_t ops_write, int update_every, instance_labels_cb_t cb, void *data) {
|
||||
if(unlikely(!d->st_ops)) {
|
||||
d->st_ops = rrdset_create_localhost(
|
||||
"disk_ops"
|
||||
, id
|
||||
, name
|
||||
, "ops"
|
||||
, "disk.ops"
|
||||
, "Disk Completed I/O Operations"
|
||||
, "operations/s"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_DISK_OPS
|
||||
, update_every
|
||||
, RRDSET_TYPE_LINE
|
||||
);
|
||||
|
||||
d->rd_ops_reads = rrddim_add(d->st_ops, "reads", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
|
||||
d->rd_ops_writes = rrddim_add(d->st_ops, "writes", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
|
||||
|
||||
if(cb)
|
||||
cb(d->st_ops, data);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(d->st_ops, d->rd_ops_reads, (collected_number)ops_read);
|
||||
rrddim_set_by_pointer(d->st_ops, d->rd_ops_writes, (collected_number)ops_write);
|
||||
rrdset_done(d->st_ops);
|
||||
}
|
||||
|
||||
#endif //NETDATA_DISK_OPS_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_DISK_OPS_H
|
||||
#define NETDATA_DISK_OPS_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
typedef struct {
|
||||
RRDSET *st_ops;
|
||||
RRDDIM *rd_ops_reads;
|
||||
RRDDIM *rd_ops_writes;
|
||||
} ND_DISK_OPS;
|
||||
|
||||
static inline void common_disk_ops(ND_DISK_OPS *d, const char *id, const char *name, uint64_t ops_read, uint64_t ops_write, int update_every, instance_labels_cb_t cb, void *data) {
|
||||
if(unlikely(!d->st_ops)) {
|
||||
d->st_ops = rrdset_create_localhost(
|
||||
"disk_ops"
|
||||
, id
|
||||
, name
|
||||
, "ops"
|
||||
, "disk.ops"
|
||||
, "Disk Completed I/O Operations"
|
||||
, "operations/s"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_DISK_OPS
|
||||
, update_every
|
||||
, RRDSET_TYPE_LINE
|
||||
);
|
||||
|
||||
d->rd_ops_reads = rrddim_add(d->st_ops, "reads", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
|
||||
d->rd_ops_writes = rrddim_add(d->st_ops, "writes", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
|
||||
|
||||
if(cb)
|
||||
cb(d->st_ops, data);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(d->st_ops, d->rd_ops_reads, (collected_number)ops_read);
|
||||
rrddim_set_by_pointer(d->st_ops, d->rd_ops_writes, (collected_number)ops_write);
|
||||
rrdset_done(d->st_ops);
|
||||
}
|
||||
|
||||
#endif //NETDATA_DISK_OPS_H
|
||||
|
|
|
@ -1,41 +1,41 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_DISK_QOPS_H
|
||||
#define NETDATA_DISK_QOPS_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
typedef struct {
|
||||
RRDSET *st_qops;
|
||||
RRDDIM *rd_qops;
|
||||
} ND_DISK_QOPS;
|
||||
|
||||
static inline void common_disk_qops(ND_DISK_QOPS *d, const char *id, const char *name, uint64_t queued_ops, int update_every, instance_labels_cb_t cb, void *data) {
|
||||
if(unlikely(!d->st_qops)) {
|
||||
d->st_qops = rrdset_create_localhost(
|
||||
"disk_qops"
|
||||
, id
|
||||
, name
|
||||
, "ops"
|
||||
, "disk.qops"
|
||||
, "Disk Current I/O Operations"
|
||||
, "operations"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_DISK_QOPS
|
||||
, update_every
|
||||
, RRDSET_TYPE_LINE
|
||||
);
|
||||
|
||||
d->rd_qops = rrddim_add(d->st_qops, "operations", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
|
||||
|
||||
if(cb)
|
||||
cb(d->st_qops, data);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(d->st_qops, d->rd_qops, (collected_number)queued_ops);
|
||||
rrdset_done(d->st_qops);
|
||||
}
|
||||
|
||||
#endif //NETDATA_DISK_QOPS_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_DISK_QOPS_H
|
||||
#define NETDATA_DISK_QOPS_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
typedef struct {
|
||||
RRDSET *st_qops;
|
||||
RRDDIM *rd_qops;
|
||||
} ND_DISK_QOPS;
|
||||
|
||||
static inline void common_disk_qops(ND_DISK_QOPS *d, const char *id, const char *name, uint64_t queued_ops, int update_every, instance_labels_cb_t cb, void *data) {
|
||||
if(unlikely(!d->st_qops)) {
|
||||
d->st_qops = rrdset_create_localhost(
|
||||
"disk_qops"
|
||||
, id
|
||||
, name
|
||||
, "ops"
|
||||
, "disk.qops"
|
||||
, "Disk Current I/O Operations"
|
||||
, "operations"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_DISK_QOPS
|
||||
, update_every
|
||||
, RRDSET_TYPE_LINE
|
||||
);
|
||||
|
||||
d->rd_qops = rrddim_add(d->st_qops, "operations", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
|
||||
|
||||
if(cb)
|
||||
cb(d->st_qops, data);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(d->st_qops, d->rd_qops, (collected_number)queued_ops);
|
||||
rrdset_done(d->st_qops);
|
||||
}
|
||||
|
||||
#endif //NETDATA_DISK_QOPS_H
|
||||
|
|
|
@ -1,41 +1,41 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_DISK_SVCTM_H
|
||||
#define NETDATA_DISK_SVCTM_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
typedef struct {
|
||||
RRDSET *st_svctm;
|
||||
RRDDIM *rd_svctm;
|
||||
} ND_DISK_SVCTM;
|
||||
|
||||
static inline void common_disk_svctm(ND_DISK_SVCTM *d, const char *id, const char *name, double svctm_ms, int update_every, instance_labels_cb_t cb, void *data) {
|
||||
if(unlikely(!d->st_svctm)) {
|
||||
d->st_svctm = rrdset_create_localhost(
|
||||
"disk_svctm"
|
||||
, id
|
||||
, name
|
||||
, "latency"
|
||||
, "disk.svctm"
|
||||
, "Average Service Time"
|
||||
, "milliseconds/operation"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_DISK_SVCTM
|
||||
, update_every
|
||||
, RRDSET_TYPE_LINE
|
||||
);
|
||||
|
||||
d->rd_svctm = rrddim_add(d->st_svctm, "svctm", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE);
|
||||
|
||||
if(cb)
|
||||
cb(d->st_svctm, data);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(d->st_svctm, d->rd_svctm, (collected_number)(svctm_ms * 1000.0));
|
||||
rrdset_done(d->st_svctm);
|
||||
}
|
||||
|
||||
#endif //NETDATA_DISK_SVCTM_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_DISK_SVCTM_H
|
||||
#define NETDATA_DISK_SVCTM_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
typedef struct {
|
||||
RRDSET *st_svctm;
|
||||
RRDDIM *rd_svctm;
|
||||
} ND_DISK_SVCTM;
|
||||
|
||||
static inline void common_disk_svctm(ND_DISK_SVCTM *d, const char *id, const char *name, double svctm_ms, int update_every, instance_labels_cb_t cb, void *data) {
|
||||
if(unlikely(!d->st_svctm)) {
|
||||
d->st_svctm = rrdset_create_localhost(
|
||||
"disk_svctm"
|
||||
, id
|
||||
, name
|
||||
, "latency"
|
||||
, "disk.svctm"
|
||||
, "Average Service Time"
|
||||
, "milliseconds/operation"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_DISK_SVCTM
|
||||
, update_every
|
||||
, RRDSET_TYPE_LINE
|
||||
);
|
||||
|
||||
d->rd_svctm = rrddim_add(d->st_svctm, "svctm", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE);
|
||||
|
||||
if(cb)
|
||||
cb(d->st_svctm, data);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(d->st_svctm, d->rd_svctm, (collected_number)(svctm_ms * 1000.0));
|
||||
rrdset_done(d->st_svctm);
|
||||
}
|
||||
|
||||
#endif //NETDATA_DISK_SVCTM_H
|
||||
|
|
|
@ -1,41 +1,41 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_DISK_UTIL_H
|
||||
#define NETDATA_DISK_UTIL_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
typedef struct {
|
||||
RRDSET *st_util;
|
||||
RRDDIM *rd_util;
|
||||
} ND_DISK_UTIL;
|
||||
|
||||
static inline void common_disk_util(ND_DISK_UTIL *d, const char *id, const char *name, uint64_t percent, int update_every, instance_labels_cb_t cb, void *data) {
|
||||
if(unlikely(!d->st_util)) {
|
||||
d->st_util = rrdset_create_localhost(
|
||||
"disk_util"
|
||||
, id
|
||||
, name
|
||||
, "utilization"
|
||||
, "disk.util"
|
||||
, "Disk Utilization Time"
|
||||
, "% of time working"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_DISK_UTIL
|
||||
, update_every
|
||||
, RRDSET_TYPE_AREA
|
||||
);
|
||||
|
||||
d->rd_util = rrddim_add(d->st_util, "utilization", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
|
||||
|
||||
if(cb)
|
||||
cb(d->st_util, data);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(d->st_util, d->rd_util, (collected_number)percent);
|
||||
rrdset_done(d->st_util);
|
||||
}
|
||||
|
||||
#endif //NETDATA_DISK_UTIL_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_DISK_UTIL_H
|
||||
#define NETDATA_DISK_UTIL_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
typedef struct {
|
||||
RRDSET *st_util;
|
||||
RRDDIM *rd_util;
|
||||
} ND_DISK_UTIL;
|
||||
|
||||
static inline void common_disk_util(ND_DISK_UTIL *d, const char *id, const char *name, uint64_t percent, int update_every, instance_labels_cb_t cb, void *data) {
|
||||
if(unlikely(!d->st_util)) {
|
||||
d->st_util = rrdset_create_localhost(
|
||||
"disk_util"
|
||||
, id
|
||||
, name
|
||||
, "utilization"
|
||||
, "disk.util"
|
||||
, "Disk Utilization Time"
|
||||
, "% of time working"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_DISK_UTIL
|
||||
, update_every
|
||||
, RRDSET_TYPE_AREA
|
||||
);
|
||||
|
||||
d->rd_util = rrddim_add(d->st_util, "utilization", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
|
||||
|
||||
if(cb)
|
||||
cb(d->st_util, data);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(d->st_util, d->rd_util, (collected_number)percent);
|
||||
rrdset_done(d->st_util);
|
||||
}
|
||||
|
||||
#endif //NETDATA_DISK_UTIL_H
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_MEM_AVAILABLE_H
|
||||
#define NETDATA_MEM_AVAILABLE_H
|
||||
#include "common-contexts.h"
|
||||
|
||||
static inline void common_mem_available(uint64_t available_bytes, int update_every) {
|
||||
static RRDSET *st_mem_available = NULL;
|
||||
static RRDDIM *rd_avail = NULL;
|
||||
|
||||
if(unlikely(!st_mem_available)) {
|
||||
st_mem_available = rrdset_create_localhost(
|
||||
"mem"
|
||||
, "available"
|
||||
, NULL
|
||||
, "overview"
|
||||
, NULL
|
||||
, "Available RAM for applications"
|
||||
, "MiB"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_MEM_SYSTEM_AVAILABLE
|
||||
, update_every
|
||||
, RRDSET_TYPE_AREA
|
||||
);
|
||||
|
||||
rd_avail = rrddim_add(st_mem_available, "avail", NULL, 1, 1024 * 1024, RRD_ALGORITHM_ABSOLUTE);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(st_mem_available, rd_avail, (collected_number)available_bytes);
|
||||
rrdset_done(st_mem_available);
|
||||
}
|
||||
|
||||
#endif //NETDATA_MEM_AVAILABLE_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_MEM_AVAILABLE_H
|
||||
#define NETDATA_MEM_AVAILABLE_H
|
||||
#include "common-contexts.h"
|
||||
|
||||
static inline void common_mem_available(uint64_t available_bytes, int update_every) {
|
||||
static RRDSET *st_mem_available = NULL;
|
||||
static RRDDIM *rd_avail = NULL;
|
||||
|
||||
if(unlikely(!st_mem_available)) {
|
||||
st_mem_available = rrdset_create_localhost(
|
||||
"mem"
|
||||
, "available"
|
||||
, NULL
|
||||
, "overview"
|
||||
, NULL
|
||||
, "Available RAM for applications"
|
||||
, "MiB"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_MEM_SYSTEM_AVAILABLE
|
||||
, update_every
|
||||
, RRDSET_TYPE_AREA
|
||||
);
|
||||
|
||||
rd_avail = rrddim_add(st_mem_available, "avail", NULL, 1, 1024 * 1024, RRD_ALGORITHM_ABSOLUTE);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(st_mem_available, rd_avail, (collected_number)available_bytes);
|
||||
rrdset_done(st_mem_available);
|
||||
}
|
||||
|
||||
#endif //NETDATA_MEM_AVAILABLE_H
|
||||
|
|
|
@ -1,38 +1,38 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_MEM_PGFAULTS_H
|
||||
#define NETDATA_MEM_PGFAULTS_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
static inline void common_mem_pgfaults(uint64_t minor, uint64_t major, int update_every) {
|
||||
static RRDSET *st_pgfaults = NULL;
|
||||
static RRDDIM *rd_minor = NULL, *rd_major = NULL;
|
||||
|
||||
if(unlikely(!st_pgfaults)) {
|
||||
st_pgfaults = rrdset_create_localhost(
|
||||
"mem"
|
||||
, "pgfaults"
|
||||
, NULL
|
||||
, "page faults"
|
||||
, NULL
|
||||
, "Memory Page Faults"
|
||||
, "faults/s"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_MEM_SYSTEM_PGFAULTS
|
||||
, update_every
|
||||
, RRDSET_TYPE_LINE
|
||||
);
|
||||
|
||||
rd_minor = rrddim_add(st_pgfaults, "minor", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
|
||||
rd_major = rrddim_add(st_pgfaults, "major", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(st_pgfaults, rd_minor, minor);
|
||||
rrddim_set_by_pointer(st_pgfaults, rd_major, major);
|
||||
rrdset_done(st_pgfaults);
|
||||
}
|
||||
|
||||
#endif //NETDATA_MEM_PGFAULTS_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_MEM_PGFAULTS_H
|
||||
#define NETDATA_MEM_PGFAULTS_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
static inline void common_mem_pgfaults(uint64_t minor, uint64_t major, int update_every) {
|
||||
static RRDSET *st_pgfaults = NULL;
|
||||
static RRDDIM *rd_minor = NULL, *rd_major = NULL;
|
||||
|
||||
if(unlikely(!st_pgfaults)) {
|
||||
st_pgfaults = rrdset_create_localhost(
|
||||
"mem"
|
||||
, "pgfaults"
|
||||
, NULL
|
||||
, "page faults"
|
||||
, NULL
|
||||
, "Memory Page Faults"
|
||||
, "faults/s"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_MEM_SYSTEM_PGFAULTS
|
||||
, update_every
|
||||
, RRDSET_TYPE_LINE
|
||||
);
|
||||
|
||||
rd_minor = rrddim_add(st_pgfaults, "minor", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
|
||||
rd_major = rrddim_add(st_pgfaults, "major", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(st_pgfaults, rd_minor, minor);
|
||||
rrddim_set_by_pointer(st_pgfaults, rd_major, major);
|
||||
rrdset_done(st_pgfaults);
|
||||
}
|
||||
|
||||
#endif //NETDATA_MEM_PGFAULTS_H
|
||||
|
|
|
@ -1,41 +1,41 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
static inline void common_mem_swap(uint64_t free_bytes, uint64_t used_bytes, int update_every) {
|
||||
static RRDSET *st_system_swap = NULL;
|
||||
static RRDDIM *rd_free = NULL, *rd_used = NULL;
|
||||
|
||||
if (free_bytes == 0 && used_bytes == 0 && st_system_swap) {
|
||||
rrdset_is_obsolete___safe_from_collector_thread(st_system_swap);
|
||||
st_system_swap = NULL;
|
||||
rd_free = NULL;
|
||||
rd_used = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
if(unlikely(!st_system_swap)) {
|
||||
st_system_swap = rrdset_create_localhost(
|
||||
"mem"
|
||||
, "swap"
|
||||
, NULL
|
||||
, "swap"
|
||||
, NULL
|
||||
, "System Swap"
|
||||
, "MiB"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_MEM_SWAP
|
||||
, update_every
|
||||
, RRDSET_TYPE_STACKED
|
||||
);
|
||||
|
||||
rd_free = rrddim_add(st_system_swap, "free", NULL, 1, 1024 * 1024, RRD_ALGORITHM_ABSOLUTE);
|
||||
rd_used = rrddim_add(st_system_swap, "used", NULL, 1, 1024 * 1024, RRD_ALGORITHM_ABSOLUTE);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(st_system_swap, rd_used, (collected_number)used_bytes);
|
||||
rrddim_set_by_pointer(st_system_swap, rd_free, (collected_number)free_bytes);
|
||||
rrdset_done(st_system_swap);
|
||||
}
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
static inline void common_mem_swap(uint64_t free_bytes, uint64_t used_bytes, int update_every) {
|
||||
static RRDSET *st_system_swap = NULL;
|
||||
static RRDDIM *rd_free = NULL, *rd_used = NULL;
|
||||
|
||||
if (free_bytes == 0 && used_bytes == 0 && st_system_swap) {
|
||||
rrdset_is_obsolete___safe_from_collector_thread(st_system_swap);
|
||||
st_system_swap = NULL;
|
||||
rd_free = NULL;
|
||||
rd_used = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
if(unlikely(!st_system_swap)) {
|
||||
st_system_swap = rrdset_create_localhost(
|
||||
"mem"
|
||||
, "swap"
|
||||
, NULL
|
||||
, "swap"
|
||||
, NULL
|
||||
, "System Swap"
|
||||
, "MiB"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_MEM_SWAP
|
||||
, update_every
|
||||
, RRDSET_TYPE_STACKED
|
||||
);
|
||||
|
||||
rd_free = rrddim_add(st_system_swap, "free", NULL, 1, 1024 * 1024, RRD_ALGORITHM_ABSOLUTE);
|
||||
rd_used = rrddim_add(st_system_swap, "used", NULL, 1, 1024 * 1024, RRD_ALGORITHM_ABSOLUTE);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(st_system_swap, rd_used, (collected_number)used_bytes);
|
||||
rrddim_set_by_pointer(st_system_swap, rd_free, (collected_number)free_bytes);
|
||||
rrdset_done(st_system_swap);
|
||||
}
|
||||
|
|
|
@ -1,37 +1,37 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_SYSTEM_INTERRUPTS_H
|
||||
#define NETDATA_SYSTEM_INTERRUPTS_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
#define _
|
||||
|
||||
static inline void common_interrupts(uint64_t interrupts, int update_every, char *ext_module) {
|
||||
static RRDSET *st_intr = NULL;
|
||||
static RRDDIM *rd_interrupts = NULL;
|
||||
|
||||
char *module = (!ext_module) ? _COMMON_PLUGIN_MODULE_NAME: ext_module;
|
||||
|
||||
if(unlikely(!st_intr)) {
|
||||
st_intr = rrdset_create_localhost( "system"
|
||||
, "intr"
|
||||
, NULL
|
||||
, "interrupts"
|
||||
, NULL
|
||||
, "CPU Interrupts"
|
||||
, "interrupts/s"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, module
|
||||
, NETDATA_CHART_PRIO_SYSTEM_INTR
|
||||
, update_every
|
||||
, RRDSET_TYPE_LINE);
|
||||
|
||||
rd_interrupts = rrddim_add(st_intr, "interrupts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
|
||||
}
|
||||
|
||||
rrddim_set_by_pointer(st_intr, rd_interrupts, (collected_number)interrupts);
|
||||
rrdset_done(st_intr);
|
||||
}
|
||||
|
||||
#endif //NETDATA_SYSTEM_INTERRUPTS_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_SYSTEM_INTERRUPTS_H
|
||||
#define NETDATA_SYSTEM_INTERRUPTS_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
#define _
|
||||
|
||||
static inline void common_interrupts(uint64_t interrupts, int update_every, char *ext_module) {
|
||||
static RRDSET *st_intr = NULL;
|
||||
static RRDDIM *rd_interrupts = NULL;
|
||||
|
||||
char *module = (!ext_module) ? _COMMON_PLUGIN_MODULE_NAME: ext_module;
|
||||
|
||||
if(unlikely(!st_intr)) {
|
||||
st_intr = rrdset_create_localhost( "system"
|
||||
, "intr"
|
||||
, NULL
|
||||
, "interrupts"
|
||||
, NULL
|
||||
, "CPU Interrupts"
|
||||
, "interrupts/s"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, module
|
||||
, NETDATA_CHART_PRIO_SYSTEM_INTR
|
||||
, update_every
|
||||
, RRDSET_TYPE_LINE);
|
||||
|
||||
rd_interrupts = rrddim_add(st_intr, "interrupts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
|
||||
}
|
||||
|
||||
rrddim_set_by_pointer(st_intr, rd_interrupts, (collected_number)interrupts);
|
||||
rrdset_done(st_intr);
|
||||
}
|
||||
|
||||
#endif //NETDATA_SYSTEM_INTERRUPTS_H
|
||||
|
|
|
@ -1,38 +1,38 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_SYSTEM_IO_H
|
||||
#define NETDATA_SYSTEM_IO_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
static inline void common_system_io(uint64_t read_bytes, uint64_t write_bytes, int update_every) {
|
||||
static RRDSET *st_io = NULL;
|
||||
static RRDDIM *rd_in = NULL, *rd_out = NULL;
|
||||
|
||||
if(unlikely(!st_io)) {
|
||||
st_io = rrdset_create_localhost(
|
||||
"system"
|
||||
, "io"
|
||||
, NULL
|
||||
, "disk"
|
||||
, NULL
|
||||
, "Disk I/O"
|
||||
, "KiB/s"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_SYSTEM_IO
|
||||
, update_every
|
||||
, RRDSET_TYPE_AREA
|
||||
);
|
||||
|
||||
rd_in = rrddim_add(st_io, "in", "reads", 1, 1024, RRD_ALGORITHM_INCREMENTAL);
|
||||
rd_out = rrddim_add(st_io, "out", "writes", -1, 1024, RRD_ALGORITHM_INCREMENTAL);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(st_io, rd_in, (collected_number)read_bytes);
|
||||
rrddim_set_by_pointer(st_io, rd_out, (collected_number)write_bytes);
|
||||
rrdset_done(st_io);
|
||||
}
|
||||
|
||||
#endif //NETDATA_SYSTEM_IO_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_SYSTEM_IO_H
|
||||
#define NETDATA_SYSTEM_IO_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
static inline void common_system_io(uint64_t read_bytes, uint64_t write_bytes, int update_every) {
|
||||
static RRDSET *st_io = NULL;
|
||||
static RRDDIM *rd_in = NULL, *rd_out = NULL;
|
||||
|
||||
if(unlikely(!st_io)) {
|
||||
st_io = rrdset_create_localhost(
|
||||
"system"
|
||||
, "io"
|
||||
, NULL
|
||||
, "disk"
|
||||
, NULL
|
||||
, "Disk I/O"
|
||||
, "KiB/s"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_SYSTEM_IO
|
||||
, update_every
|
||||
, RRDSET_TYPE_AREA
|
||||
);
|
||||
|
||||
rd_in = rrddim_add(st_io, "in", "reads", 1, 1024, RRD_ALGORITHM_INCREMENTAL);
|
||||
rd_out = rrddim_add(st_io, "out", "writes", -1, 1024, RRD_ALGORITHM_INCREMENTAL);
|
||||
}
|
||||
|
||||
// this always have to be in base units, so that exporting sends base units to other time-series db
|
||||
rrddim_set_by_pointer(st_io, rd_in, (collected_number)read_bytes);
|
||||
rrddim_set_by_pointer(st_io, rd_out, (collected_number)write_bytes);
|
||||
rrdset_done(st_io);
|
||||
}
|
||||
|
||||
#endif //NETDATA_SYSTEM_IO_H
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_SYSTEM_IPC_H
|
||||
#define NETDATA_SYSTEM_IPC_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
static inline void common_semaphore_ipc(uint64_t semaphore, NETDATA_DOUBLE red, char *module, int update_every) {
|
||||
static RRDSET *st_semaphores = NULL;
|
||||
static RRDDIM *rd_semaphores = NULL;
|
||||
if(unlikely(!st_semaphores)) {
|
||||
st_semaphores = rrdset_create_localhost("system"
|
||||
, "ipc_semaphores"
|
||||
, NULL
|
||||
, "ipc semaphores"
|
||||
, NULL
|
||||
, "IPC Semaphores"
|
||||
, "semaphores"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, module
|
||||
, NETDATA_CHART_PRIO_SYSTEM_IPC_SEMAPHORES
|
||||
, update_every
|
||||
, RRDSET_TYPE_AREA
|
||||
);
|
||||
rd_semaphores = rrddim_add(st_semaphores, "semaphores", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
|
||||
}
|
||||
|
||||
rrddim_set_by_pointer(st_semaphores, rd_semaphores, semaphore);
|
||||
rrdset_done(st_semaphores);
|
||||
if (!strcmp(module, "ipc"))
|
||||
st_semaphores->red = red;
|
||||
}
|
||||
|
||||
#endif //NETDATA_SYSTEM_IPC_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_SYSTEM_IPC_H
|
||||
#define NETDATA_SYSTEM_IPC_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
static inline void common_semaphore_ipc(uint64_t semaphore, NETDATA_DOUBLE red, char *module, int update_every) {
|
||||
static RRDSET *st_semaphores = NULL;
|
||||
static RRDDIM *rd_semaphores = NULL;
|
||||
if(unlikely(!st_semaphores)) {
|
||||
st_semaphores = rrdset_create_localhost("system"
|
||||
, "ipc_semaphores"
|
||||
, NULL
|
||||
, "ipc semaphores"
|
||||
, NULL
|
||||
, "IPC Semaphores"
|
||||
, "semaphores"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, module
|
||||
, NETDATA_CHART_PRIO_SYSTEM_IPC_SEMAPHORES
|
||||
, update_every
|
||||
, RRDSET_TYPE_AREA
|
||||
);
|
||||
rd_semaphores = rrddim_add(st_semaphores, "semaphores", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
|
||||
}
|
||||
|
||||
rrddim_set_by_pointer(st_semaphores, rd_semaphores, semaphore);
|
||||
rrdset_done(st_semaphores);
|
||||
if (!strcmp(module, "ipc"))
|
||||
st_semaphores->red = red;
|
||||
}
|
||||
|
||||
#endif //NETDATA_SYSTEM_IPC_H
|
||||
|
|
|
@ -1,115 +1,115 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_SYSTEM_PROCESSES_H
|
||||
#define NETDATA_SYSTEM_PROCESSES_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
#define _system_process_chart() \
|
||||
rrdset_create_localhost( \
|
||||
"system" \
|
||||
, "processes" \
|
||||
, NULL \
|
||||
, "processes" \
|
||||
, NULL \
|
||||
, "System Processes" \
|
||||
, "processes" \
|
||||
, _COMMON_PLUGIN_NAME \
|
||||
, _COMMON_PLUGIN_MODULE_NAME \
|
||||
, NETDATA_CHART_PRIO_SYSTEM_PROCESSES \
|
||||
, update_every \
|
||||
, RRDSET_TYPE_LINE \
|
||||
)
|
||||
|
||||
#if defined(OS_WINDOWS)
|
||||
static inline void common_system_processes(uint64_t running, int update_every) {
|
||||
static RRDSET *st_processes = NULL;
|
||||
static RRDDIM *rd_running = NULL;
|
||||
|
||||
if(unlikely(!st_processes)) {
|
||||
st_processes = _system_process_chart();
|
||||
|
||||
rd_running = rrddim_add(st_processes, "running", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
|
||||
}
|
||||
|
||||
rrddim_set_by_pointer(st_processes, rd_running, running);
|
||||
rrdset_done(st_processes);
|
||||
}
|
||||
|
||||
// EBPF COUNTER PART
|
||||
static inline void common_system_threads(uint64_t threads, int update_every) {
|
||||
static RRDSET *st_threads = NULL;
|
||||
static RRDDIM *rd_threads = NULL;
|
||||
|
||||
if(unlikely(!st_threads)) {
|
||||
st_threads = rrdset_create_localhost(
|
||||
"system"
|
||||
, "threads"
|
||||
, NULL
|
||||
, "processes"
|
||||
, NULL
|
||||
, "Threads"
|
||||
, "threads"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_WINDOWS_THREADS
|
||||
, update_every
|
||||
, RRDSET_TYPE_LINE
|
||||
);
|
||||
|
||||
rd_threads = rrddim_add(st_threads, "threads", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
|
||||
}
|
||||
|
||||
rrddim_set_by_pointer(st_threads, rd_threads, threads);
|
||||
rrdset_done(st_threads);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
static inline void common_system_processes(uint64_t running, uint64_t blocked, int update_every) {
|
||||
static RRDSET *st_processes = NULL;
|
||||
static RRDDIM *rd_running = NULL;
|
||||
static RRDDIM *rd_blocked = NULL;
|
||||
|
||||
if(unlikely(!st_processes)) {
|
||||
st_processes = _system_process_chart();
|
||||
|
||||
rd_running = rrddim_add(st_processes, "running", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
|
||||
rd_blocked = rrddim_add(st_processes, "blocked", NULL, -1, 1, RRD_ALGORITHM_ABSOLUTE);
|
||||
}
|
||||
|
||||
rrddim_set_by_pointer(st_processes, rd_running, (collected_number)running);
|
||||
rrddim_set_by_pointer(st_processes, rd_blocked, (collected_number)blocked);
|
||||
rrdset_done(st_processes);
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline void common_system_context_switch(uint64_t value, int update_every) {
|
||||
static RRDSET *st_ctxt = NULL;
|
||||
static RRDDIM *rd_switches = NULL;
|
||||
|
||||
if(unlikely(!st_ctxt)) {
|
||||
st_ctxt = rrdset_create_localhost(
|
||||
"system"
|
||||
, "ctxt"
|
||||
, NULL
|
||||
, "processes"
|
||||
, NULL
|
||||
, "CPU Context Switches"
|
||||
, "context switches/s"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_SYSTEM_CTXT
|
||||
, update_every
|
||||
, RRDSET_TYPE_LINE
|
||||
);
|
||||
|
||||
rd_switches = rrddim_add(st_ctxt, "switches", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
|
||||
}
|
||||
|
||||
rrddim_set_by_pointer(st_ctxt, rd_switches, (collected_number)value);
|
||||
rrdset_done(st_ctxt);
|
||||
}
|
||||
|
||||
|
||||
#endif //NETDATA_SYSTEM_PROCESSES_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_SYSTEM_PROCESSES_H
|
||||
#define NETDATA_SYSTEM_PROCESSES_H
|
||||
|
||||
#include "common-contexts.h"
|
||||
|
||||
#define _system_process_chart() \
|
||||
rrdset_create_localhost( \
|
||||
"system" \
|
||||
, "processes" \
|
||||
, NULL \
|
||||
, "processes" \
|
||||
, NULL \
|
||||
, "System Processes" \
|
||||
, "processes" \
|
||||
, _COMMON_PLUGIN_NAME \
|
||||
, _COMMON_PLUGIN_MODULE_NAME \
|
||||
, NETDATA_CHART_PRIO_SYSTEM_PROCESSES \
|
||||
, update_every \
|
||||
, RRDSET_TYPE_LINE \
|
||||
)
|
||||
|
||||
#if defined(OS_WINDOWS)
|
||||
static inline void common_system_processes(uint64_t running, int update_every) {
|
||||
static RRDSET *st_processes = NULL;
|
||||
static RRDDIM *rd_running = NULL;
|
||||
|
||||
if(unlikely(!st_processes)) {
|
||||
st_processes = _system_process_chart();
|
||||
|
||||
rd_running = rrddim_add(st_processes, "running", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
|
||||
}
|
||||
|
||||
rrddim_set_by_pointer(st_processes, rd_running, running);
|
||||
rrdset_done(st_processes);
|
||||
}
|
||||
|
||||
// EBPF COUNTER PART
|
||||
static inline void common_system_threads(uint64_t threads, int update_every) {
|
||||
static RRDSET *st_threads = NULL;
|
||||
static RRDDIM *rd_threads = NULL;
|
||||
|
||||
if(unlikely(!st_threads)) {
|
||||
st_threads = rrdset_create_localhost(
|
||||
"system"
|
||||
, "threads"
|
||||
, NULL
|
||||
, "processes"
|
||||
, NULL
|
||||
, "Threads"
|
||||
, "threads"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_WINDOWS_THREADS
|
||||
, update_every
|
||||
, RRDSET_TYPE_LINE
|
||||
);
|
||||
|
||||
rd_threads = rrddim_add(st_threads, "threads", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
|
||||
}
|
||||
|
||||
rrddim_set_by_pointer(st_threads, rd_threads, threads);
|
||||
rrdset_done(st_threads);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
static inline void common_system_processes(uint64_t running, uint64_t blocked, int update_every) {
|
||||
static RRDSET *st_processes = NULL;
|
||||
static RRDDIM *rd_running = NULL;
|
||||
static RRDDIM *rd_blocked = NULL;
|
||||
|
||||
if(unlikely(!st_processes)) {
|
||||
st_processes = _system_process_chart();
|
||||
|
||||
rd_running = rrddim_add(st_processes, "running", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
|
||||
rd_blocked = rrddim_add(st_processes, "blocked", NULL, -1, 1, RRD_ALGORITHM_ABSOLUTE);
|
||||
}
|
||||
|
||||
rrddim_set_by_pointer(st_processes, rd_running, (collected_number)running);
|
||||
rrddim_set_by_pointer(st_processes, rd_blocked, (collected_number)blocked);
|
||||
rrdset_done(st_processes);
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline void common_system_context_switch(uint64_t value, int update_every) {
|
||||
static RRDSET *st_ctxt = NULL;
|
||||
static RRDDIM *rd_switches = NULL;
|
||||
|
||||
if(unlikely(!st_ctxt)) {
|
||||
st_ctxt = rrdset_create_localhost(
|
||||
"system"
|
||||
, "ctxt"
|
||||
, NULL
|
||||
, "processes"
|
||||
, NULL
|
||||
, "CPU Context Switches"
|
||||
, "context switches/s"
|
||||
, _COMMON_PLUGIN_NAME
|
||||
, _COMMON_PLUGIN_MODULE_NAME
|
||||
, NETDATA_CHART_PRIO_SYSTEM_CTXT
|
||||
, update_every
|
||||
, RRDSET_TYPE_LINE
|
||||
);
|
||||
|
||||
rd_switches = rrddim_add(st_ctxt, "switches", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
|
||||
}
|
||||
|
||||
rrddim_set_by_pointer(st_ctxt, rd_switches, (collected_number)value);
|
||||
rrdset_done(st_ctxt);
|
||||
}
|
||||
|
||||
|
||||
#endif //NETDATA_SYSTEM_PROCESSES_H
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
/*
|
||||
* netdata cups.plugin
|
||||
* (C) Copyright 2017-2018 Simon Nagl <simon.nagl@gmx.de>
|
||||
* Released under GPL v3+
|
||||
*/
|
||||
|
||||
#include "libnetdata/libnetdata.h"
|
||||
#include "libnetdata/required_dummies.h"
|
||||
|
||||
|
@ -53,9 +47,9 @@ void print_help() {
|
|||
"\n"
|
||||
"netdata cups.plugin %s\n"
|
||||
"\n"
|
||||
"Copyright (C) 2017-2018 Simon Nagl <simon.nagl@gmx.de>\n"
|
||||
"Copyright 2018-2025 Netdata Inc.\n"
|
||||
"Original Author: Simon Nagl <simon.nagl@gmx.de>\n"
|
||||
"Released under GNU General Public License v3+.\n"
|
||||
"All rights reserved.\n"
|
||||
"\n"
|
||||
"This program is a data collector plugin for netdata.\n"
|
||||
"\n"
|
||||
|
|
|
@ -2201,21 +2201,11 @@ void ebpf_update_disabled_plugin_stats(ebpf_module_t *em)
|
|||
*/
|
||||
void ebpf_print_help()
|
||||
{
|
||||
const time_t t = time(NULL);
|
||||
struct tm ct;
|
||||
struct tm *test = localtime_r(&t, &ct);
|
||||
int year;
|
||||
if (test)
|
||||
year = ct.tm_year;
|
||||
else
|
||||
year = 0;
|
||||
|
||||
fprintf(stderr,
|
||||
"\n"
|
||||
" Netdata ebpf.plugin %s\n"
|
||||
" Copyright (C) 2016-%d Costa Tsaousis <costa@tsaousis.gr>\n"
|
||||
" Copyright 2018-2025 Netdata Inc.\n"
|
||||
" Released under GNU General Public License v3 or later.\n"
|
||||
" All rights reserved.\n"
|
||||
"\n"
|
||||
" This eBPF.plugin is a data collector plugin for netdata.\n"
|
||||
"\n"
|
||||
|
@ -2267,8 +2257,7 @@ void ebpf_print_help()
|
|||
"\n"
|
||||
" [-]-core Use CO-RE when available(Working in progress).\n"
|
||||
"\n",
|
||||
NETDATA_VERSION,
|
||||
(year >= 116) ? year + 1900 : 2020);
|
||||
NETDATA_VERSION);
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/*
|
||||
* netdata freeipmi.plugin
|
||||
* Copyright (C) 2023 Netdata Inc.
|
||||
* GPL v3+
|
||||
*
|
||||
* Based on:
|
||||
* ipmimonitoring-sensors.c,v 1.51 2016/11/02 23:46:24 chu11 Exp
|
||||
* ipmimonitoring-sel.c,v 1.51 2016/11/02 23:46:24 chu11 Exp
|
||||
|
@ -1740,9 +1736,8 @@ int main (int argc, char **argv) {
|
|||
fprintf(stderr,
|
||||
"\n"
|
||||
" netdata %s %s\n"
|
||||
" Copyright (C) 2023 Netdata Inc.\n"
|
||||
" Copyright 2018-2025 Netdata Inc.\n"
|
||||
" Released under GNU General Public License v3 or later.\n"
|
||||
" All rights reserved.\n"
|
||||
"\n"
|
||||
" This program is a data collector plugin for netdata.\n"
|
||||
"\n"
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# netdata
|
||||
# real-time performance and health monitoring, done right!
|
||||
# (C) 2017 Costa Tsaousis <costa@tsaousis.gr>
|
||||
# GPL v3+
|
||||
#
|
||||
# This plugin requires a latest version of ioping.
|
||||
# You can compile it from source, by running me with option: install
|
||||
|
|
|
@ -774,9 +774,8 @@ int main(int argc, char **argv) {
|
|||
fprintf(stderr,
|
||||
"\n"
|
||||
" netdata nfacct.plugin %s\n"
|
||||
" Copyright (C) 2015-2017 Costa Tsaousis <costa@tsaousis.gr>\n"
|
||||
" Copyright 2018-2025 Netdata Inc.\n"
|
||||
" Released under GNU General Public License v3 or later.\n"
|
||||
" All rights reserved.\n"
|
||||
"\n"
|
||||
" This program is a data collector plugin for netdata.\n"
|
||||
"\n"
|
||||
|
|
|
@ -1212,9 +1212,8 @@ void parse_command_line(int argc, char **argv) {
|
|||
fprintf(stderr,
|
||||
"\n"
|
||||
" netdata perf.plugin %s\n"
|
||||
" Copyright (C) 2019 Netdata Inc.\n"
|
||||
" Copyright 2018-2025 Netdata Inc.\n"
|
||||
" Released under GNU General Public License v3 or later.\n"
|
||||
" All rights reserved.\n"
|
||||
"\n"
|
||||
" This program is a data collector plugin for netdata.\n"
|
||||
"\n"
|
||||
|
|
|
@ -19,9 +19,6 @@ fi
|
|||
exec "$pybinary" "$0" "${filtered[@]}" # '''
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
# Description:
|
||||
# Author: Pawel Krupa (paulfantom)
|
||||
# Author: Ilya Mashchenko (l2isbad)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import collections
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Description:
|
||||
# Author: Pawel Krupa (paulfantom)
|
||||
# Author: Ilya Mashchenko (ilyam8)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import os
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Description:
|
||||
# Author: Pawel Krupa (paulfantom)
|
||||
# Author: Ilya Mashchenko (ilyam8)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from glob import glob
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Description:
|
||||
# Author: Pawel Krupa (paulfantom)
|
||||
# Author: Ilya Mashchenko (ilyam8)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import os
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Description:
|
||||
# Author: Pawel Krupa (paulfantom)
|
||||
# Author: Ilya Mashchenko (ilyam8)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import errno
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Description:
|
||||
# Author: Pawel Krupa (paulfantom)
|
||||
# Author: Ilya Mashchenko (ilyam8)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import urllib3
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/*
|
||||
* netdata systemd-journal.plugin
|
||||
* Copyright (C) 2023 Netdata Inc.
|
||||
* GPL v3+
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# netdata
|
||||
# real-time performance and health monitoring, done right!
|
||||
# (C) 2023 Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# This script is a helper to allow netdata collect tc data.
|
||||
|
|
|
@ -76,7 +76,7 @@ int main(int argc, char **argv) {
|
|||
fprintf(stderr,
|
||||
"\n"
|
||||
" Netdata local-listeners\n"
|
||||
" (C) 2024 Netdata Inc.\n"
|
||||
" Copyright 2018-2025 Netdata Inc.\n"
|
||||
"\n"
|
||||
" This program prints a list of all the processes that have a listening socket.\n"
|
||||
" It is used by Netdata to auto-detect the services running.\n"
|
||||
|
|
|
@ -381,7 +381,7 @@ void show_help() {
|
|||
fprintf(stdout, "\n");
|
||||
fprintf(stdout, "ndsudo\n");
|
||||
fprintf(stdout, "\n");
|
||||
fprintf(stdout, "(C) Netdata Inc.\n");
|
||||
fprintf(stdout, "Copyright 2018-2025 Netdata Inc.\n");
|
||||
fprintf(stdout, "\n");
|
||||
fprintf(stdout, "A helper to allow Netdata run privileged commands.\n");
|
||||
fprintf(stdout, "\n");
|
||||
|
|
|
@ -1,289 +1,289 @@
|
|||
# Windows Events plugin
|
||||
|
||||
[KEY FEATURES](#key-features) | [EVENTS SOURCES](#events-sources) | [EVENT FIELDS](#event-fields) |
|
||||
[PLAY MODE](#play-mode) | [FULL TEXT SEARCH](#full-text-search) | [PERFORMANCE](#query-performance) |
|
||||
[CONFIGURATION](#configuration-and-maintenance) | [FAQ](#faq)
|
||||
|
||||
The Windows Events plugin by Netdata makes viewing, exploring and analyzing Windows Events simple and
|
||||
efficient.
|
||||
|
||||

|
||||
|
||||
## Key features
|
||||
|
||||
- Supports **Windows Event Logs (WEL)**.
|
||||
- Supports **Event Tracing for Windows (ETW)** and **TraceLogging (TL)**, when events are routed to Event Log.
|
||||
- Allows filtering on all System Events fields.
|
||||
- Allows **full text search** (`grep`) on all System and User fields.
|
||||
- Provides a **histogram** for log entries over time, with a break down per field-value, for any System Event field and any
|
||||
time-frame.
|
||||
- Supports coloring log entries based on severity.
|
||||
- In PLAY mode it "tails" all the Events, showing new log entries immediately after they are received.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
`windows-events.plugin` is a Netdata Function Plugin.
|
||||
|
||||
To protect your privacy, as with all Netdata Functions, a free Netdata Cloud user account is required to access it.
|
||||
For more information check [this discussion](https://github.com/netdata/netdata/discussions/16136).
|
||||
|
||||
## Events Sources
|
||||
|
||||
The plugin automatically detects all the available channels and offers a list of "Event Channels".
|
||||
|
||||
By default, it aggregates events from all event channels, providing a unified view of all events.
|
||||
|
||||
> To improve query performance, we recommend selecting the relevant event channels, before doing more
|
||||
> analysis on the events.
|
||||
|
||||
In the list of events channels, several shortcuts are added, aggregating events according to various attributes:
|
||||
|
||||
- `All`, aggregates events from all available channels. This provides a holistic view of all events in the system.
|
||||
- `All-Admin`, `All-Operational`, `All-Analytic` and `All-Debug` aggregates events from channels marked `Admin`, `Operational`, `Analytic` and `Debug`, respectively.
|
||||
- `All-Windows`, aggregates events from `Application`, `Security`, `System` and `Setup`.
|
||||
- `All-Enabled` and `All-Disabled` aggregates events from channels depending on their status.
|
||||
- `All-Forwarded` aggregates events from channels owned by `Microsoft-Windows-EventCollector`.
|
||||
- `All-Classic` aggregates events from channels using the Classic Event Log API.
|
||||
- `All-Of-X`, where `X` is a provider name, is offered for all providers having more than a channel.
|
||||
- `All-In-X`, where `X` is `Backup-Mode`, `Overwrite-Mode`, `StopWhenFull-Mode` and `RetainAndBackup-Mode`, aggregate events based on their channel retention policy.
|
||||
|
||||
Channels that are configured but are not queryable, and channels that do not have any events in them, are automatically excluded from the channels list.
|
||||
|
||||
## Event Fields
|
||||
|
||||
Windows Events are structured with both system-defined fields and user-defined fields.
|
||||
The Windows Events plugin primarily works with the system-defined fields, which are consistently available
|
||||
across all event types.
|
||||
|
||||
### System-defined fields
|
||||
|
||||
The system-defined fields are:
|
||||
|
||||
1. **EventRecordID**
|
||||
A unique, sequential identifier for the event within the channel. This ID increases as new events are logged.
|
||||
|
||||
2. **Version**
|
||||
The version of the event, indicating possible structural changes or updates to the event definition.
|
||||
|
||||
Netdata adds this field automatically when it is not zero.
|
||||
|
||||
3. **Level**
|
||||
The severity or importance of the event. Levels can include:
|
||||
- 0: LogAlways (reserved)
|
||||
- 1: Critical
|
||||
- 2: Error
|
||||
- 3: Warning
|
||||
- 4: Informational
|
||||
- 5: Verbose
|
||||
|
||||
Additionally, applications may define their own levels.
|
||||
|
||||
Netdata provides 2 fields: `Level` and `LevelID` for the text and numeric representation of it.
|
||||
|
||||
4. **Opcode**
|
||||
The action or state within a provider when the event was logged.
|
||||
|
||||
Netdata provides 2 fields: `Opcode` and `OpcodeID` for the text and numeric representation of it.
|
||||
|
||||
5. **EventID**
|
||||
This identifies the event template, linking it to a specific message or event type. Event IDs are provider-specific.
|
||||
|
||||
6. **Task**
|
||||
Defines a higher-level categorization or logical grouping for the event, often related to a specific function within the application or provider.
|
||||
|
||||
Netdata provides 2 fields: `Task` and `TaskID` for the text and numeric representation of it.
|
||||
|
||||
7. **Qualifiers**
|
||||
Provides additional detail for interpreting the event and is often specific to the event source.
|
||||
|
||||
Netdata adds this field automatically when it is not zero.
|
||||
|
||||
8. **ProcessID**
|
||||
The ID of the process that generated the event, useful for pinpointing the source of the event within the system.
|
||||
|
||||
9. **ThreadID**
|
||||
The ID of the thread within the process that generated the event, which helps in more detailed debugging scenarios.
|
||||
|
||||
10. **Keywords**
|
||||
A categorization field that can be used for event filtering. Keywords are bit flags that represent categories or purposes of the event, providing additional context.
|
||||
|
||||
Netdata provides 2 fields: `Keywords` and `keywordsID` for the text and numeric representation of it.
|
||||
|
||||
11. **Provider**
|
||||
The unique identifier (GUID) of the event provider. This is essential for knowing which application or system component generated the event.
|
||||
|
||||
Netdata provides 2 fields: `Provider` and `ProviderGUID` for its name and GUID of it.
|
||||
|
||||
12. **ActivityID**
|
||||
A GUID that correlates events generated as part of the same operation or transaction, helping to track activities across different components or stages.
|
||||
|
||||
Netdata adds this field automatically when it is not zero.
|
||||
|
||||
13. **RelatedActivityID**
|
||||
A GUID that links related operations or transactions, allowing for tracing complex workflows where one event triggers or relates to another.
|
||||
|
||||
Netdata adds this field automatically when it is not zero.
|
||||
|
||||
14. **Timestamp**
|
||||
The timestamp when the event was created. This provides precise timing information about when the event occurred.
|
||||
|
||||
15. **User**
|
||||
The system user who logged this event.
|
||||
|
||||
Netdata provides 3 fields: `UserAccount`, `UserDomain` and `UserSID`.
|
||||
|
||||
### User-defined fields
|
||||
Each event log entry can include up to 100 user-defined fields (per event-id).
|
||||
|
||||
Unfortunately, accessing these fields is significantly slower, to a level that is not practical to do so
|
||||
when there are more than few thousand log entries to explore. So, Netdata presents them
|
||||
with lazy loading.
|
||||
|
||||
This prevents Netdata for offering filtering for user-defined fields, although Netdata does support
|
||||
full text search on user-defined field values.
|
||||
|
||||
### Event fields as columns in the table
|
||||
|
||||
The system fields mentioned above are offered as columns on the UI. Use the gear button above the table to
|
||||
select visible columns.
|
||||
|
||||
### Event fields as filters
|
||||
|
||||
The plugin presents the system fields as filters for the query, with counters for each of the possible values
|
||||
for the field. This list can be used to quickly check which fields and values are available for the entire
|
||||
time-frame of the query, across multiple providers and channels.
|
||||
|
||||
### Event fields as histogram sources
|
||||
|
||||
The histogram can be based on any of the system fields that are available as filters. This allows you to
|
||||
visualize the distribution of events over time based on different criteria such as Level, Provider, or EventID.
|
||||
|
||||
## PLAY mode
|
||||
|
||||
The PLAY mode in this plugin allows real-time monitoring of new events as they are added to the Windows Event
|
||||
Log. This feature works by continuously querying for new events and updating the display.
|
||||
|
||||
## Full-text search
|
||||
|
||||
The plugin supports searching for text within all system and user fields of the events. This means that while
|
||||
user-defined fields are not directly filterable, they are searchable through the full-text search feature.
|
||||
|
||||
Keep in mind that query performance is slower while doing full text search, mainly because the plugin
|
||||
needs to ask from the system to provide all the user fields values.
|
||||
|
||||
## Query performance
|
||||
|
||||
The plugin is optimized to work efficiently with Event Logs. It uses several layers of caching and
|
||||
similar techniques to offload as much work as possible from the system, offering quick responses even when
|
||||
hundreds of thousands of events are within the visible timeframe.
|
||||
|
||||
To achieve this level of efficiency, the plugin:
|
||||
|
||||
- pre-loads ETW providers' manifests for resolving numeric Levels, Opcodes, Tasks and Keywords to text.
|
||||
- caches number to text maps for Levels, Opcodes, Tasks and Keywords per provider for WEL providers.
|
||||
- caches user SID to account and domain maps.
|
||||
- lazy loads the "expensive" event Message and XML, so that the system is queried only for the visible events.
|
||||
|
||||
For Full Text Search:
|
||||
|
||||
- requests only the Message and the values of the user-fields from the system, avoiding the "expensive" XML call (which is still lazy-loaded).
|
||||
|
||||
The result is a system that is highly efficient for working with moderate volumes (hundreds of thousands) of events.
|
||||
|
||||
## Configuration and maintenance
|
||||
|
||||
This Netdata plugin does not require any specific configuration. It automatically detects available event logs
|
||||
on the system.
|
||||
|
||||
## FAQ
|
||||
|
||||
### Can I use this plugin on event centralization servers?
|
||||
|
||||
Yes. You can centralize your Windows Events using Windows Event Forwarding (WEF) or other event collection
|
||||
mechanisms, and then install Netdata on this events centralization server to explore the events of all your
|
||||
infrastructure.
|
||||
|
||||
This plugin will automatically provide multi-node views of your events and also give you the ability to
|
||||
combine the events of multiple servers, as you see fit.
|
||||
|
||||
### Can I use this plugin from a parent Netdata?
|
||||
|
||||
Yes. When your nodes are connected to a Netdata parent, all their functions are available via the parent's UI.
|
||||
So, from the parent UI, you can access the functions of all your nodes.
|
||||
|
||||
Keep in mind that to protect your privacy, in order to access Netdata functions, you need a free Netdata Cloud
|
||||
account.
|
||||
|
||||
### Is any of my data exposed to Netdata Cloud from this plugin?
|
||||
|
||||
No. When you access the Agent directly, none of your data passes through Netdata Cloud. You need a free Netdata
|
||||
Cloud account only to verify your identity and enable the use of Netdata Functions. Once this is done, all the
|
||||
data flow directly from your Netdata Agent to your web browser.
|
||||
|
||||
When you access Netdata via https://app.netdata.cloud, your data travel via Netdata Cloud, but they are not stored
|
||||
in Netdata Cloud. This is to allow you access your Netdata Agents from anywhere. All communication from/to
|
||||
Netdata Cloud is encrypted.
|
||||
|
||||
### What are the different types of event logs supported by this plugin?
|
||||
|
||||
The plugin supports all the kinds of event logs currently supported by the Windows Event Viewer:
|
||||
|
||||
- Windows Event Logs (WEL): The traditional event logging system in Windows.
|
||||
- Event Tracing for Windows (ETW): A more detailed and efficient event tracing system.
|
||||
- TraceLogging (TL): An extension of ETW that simplifies the process of adding events to your code.
|
||||
|
||||
The plugin can access all of these when they are routed to the Windows Event Log.
|
||||
|
||||
### How does this plugin handle user-defined fields in Windows Events?
|
||||
|
||||
User-defined fields are not directly exposed as table columns or filters in the plugin interface. However,
|
||||
they are included in the XML representation of each event, which can be viewed in the info sidebar when
|
||||
clicking on an event entry. Additionally, the full-text search feature does search through these
|
||||
user-defined fields, allowing you to find specific information even if it's not in the main system fields.
|
||||
|
||||
### Can I use this plugin to monitor real-time events?
|
||||
|
||||
Yes, the plugin supports a PLAY mode that allows you to monitor events in real-time. When activated, it
|
||||
continuously updates to show new events as they are logged, similar to the "tail" functionality in
|
||||
Unix-like systems.
|
||||
|
||||
### How does the plugin handle large volumes of events?
|
||||
|
||||
The plugin is designed to handle moderate volumes of events (hundreds of thousands of events) efficiently.
|
||||
|
||||
It is in our roadmap to port the `systemd-journal` sampling techniques to it, for working with very large
|
||||
datasets to provide quick responses while still giving accurate representations of the data. However, for
|
||||
the best performance, we recommend querying smaller time frames or using more specific filters when dealing
|
||||
with extremely large event volumes.
|
||||
|
||||
### Can I use this plugin to analyze events from multiple servers?
|
||||
|
||||
Yes, if you have set up Windows Event Forwarding (WEF) or another method of centralizing your Windows Events,
|
||||
you can use this plugin on the central server to analyze events from multiple sources. The plugin will
|
||||
automatically detect the available event sources.
|
||||
|
||||
### How does the histogram feature work in this plugin?
|
||||
|
||||
The histogram feature provides a visual representation of event frequency over time. You can base the
|
||||
histogram on any of the system fields available as filters (such as Level, Provider, or EventID). This
|
||||
allows you to quickly identify patterns or anomalies in your event logs.
|
||||
|
||||
### Is it possible to export or share the results from this plugin?
|
||||
|
||||
While the plugin doesn't have a direct export feature, you can use browser-based methods to save or share
|
||||
the results. This could include taking screenshots, using browser print/save as PDF functionality, or
|
||||
copying data from the table view. For more advanced data export needs, you might need to use the Windows
|
||||
Event Log API directly or other Windows administrative tools.
|
||||
|
||||
### How often does the plugin update its data?
|
||||
|
||||
The plugin updates its data in real-time when in PLAY mode. In normal mode, it refreshes data based on the
|
||||
query you've submitted. The plugin is designed to provide the most up-to-date information available in the
|
||||
Windows Event Logs at the time of the query.
|
||||
|
||||
## TODO
|
||||
|
||||
1. Support Sampling, so that the plugin can respond faster even on very busy systems (millions of events visible).
|
||||
2. Support exploring events from live Tracing sessions.
|
||||
3. Support exploring events in saved Event Trace Log files (`.etl` files).
|
||||
4. Support exploring events in saved Event Logs files (`.evtx` files).
|
||||
# Windows Events plugin
|
||||
|
||||
[KEY FEATURES](#key-features) | [EVENTS SOURCES](#events-sources) | [EVENT FIELDS](#event-fields) |
|
||||
[PLAY MODE](#play-mode) | [FULL TEXT SEARCH](#full-text-search) | [PERFORMANCE](#query-performance) |
|
||||
[CONFIGURATION](#configuration-and-maintenance) | [FAQ](#faq)
|
||||
|
||||
The Windows Events plugin by Netdata makes viewing, exploring and analyzing Windows Events simple and
|
||||
efficient.
|
||||
|
||||

|
||||
|
||||
## Key features
|
||||
|
||||
- Supports **Windows Event Logs (WEL)**.
|
||||
- Supports **Event Tracing for Windows (ETW)** and **TraceLogging (TL)**, when events are routed to Event Log.
|
||||
- Allows filtering on all System Events fields.
|
||||
- Allows **full text search** (`grep`) on all System and User fields.
|
||||
- Provides a **histogram** for log entries over time, with a break down per field-value, for any System Event field and any
|
||||
time-frame.
|
||||
- Supports coloring log entries based on severity.
|
||||
- In PLAY mode it "tails" all the Events, showing new log entries immediately after they are received.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
`windows-events.plugin` is a Netdata Function Plugin.
|
||||
|
||||
To protect your privacy, as with all Netdata Functions, a free Netdata Cloud user account is required to access it.
|
||||
For more information check [this discussion](https://github.com/netdata/netdata/discussions/16136).
|
||||
|
||||
## Events Sources
|
||||
|
||||
The plugin automatically detects all the available channels and offers a list of "Event Channels".
|
||||
|
||||
By default, it aggregates events from all event channels, providing a unified view of all events.
|
||||
|
||||
> To improve query performance, we recommend selecting the relevant event channels, before doing more
|
||||
> analysis on the events.
|
||||
|
||||
In the list of events channels, several shortcuts are added, aggregating events according to various attributes:
|
||||
|
||||
- `All`, aggregates events from all available channels. This provides a holistic view of all events in the system.
|
||||
- `All-Admin`, `All-Operational`, `All-Analytic` and `All-Debug` aggregates events from channels marked `Admin`, `Operational`, `Analytic` and `Debug`, respectively.
|
||||
- `All-Windows`, aggregates events from `Application`, `Security`, `System` and `Setup`.
|
||||
- `All-Enabled` and `All-Disabled` aggregates events from channels depending on their status.
|
||||
- `All-Forwarded` aggregates events from channels owned by `Microsoft-Windows-EventCollector`.
|
||||
- `All-Classic` aggregates events from channels using the Classic Event Log API.
|
||||
- `All-Of-X`, where `X` is a provider name, is offered for all providers having more than a channel.
|
||||
- `All-In-X`, where `X` is `Backup-Mode`, `Overwrite-Mode`, `StopWhenFull-Mode` and `RetainAndBackup-Mode`, aggregate events based on their channel retention policy.
|
||||
|
||||
Channels that are configured but are not queryable, and channels that do not have any events in them, are automatically excluded from the channels list.
|
||||
|
||||
## Event Fields
|
||||
|
||||
Windows Events are structured with both system-defined fields and user-defined fields.
|
||||
The Windows Events plugin primarily works with the system-defined fields, which are consistently available
|
||||
across all event types.
|
||||
|
||||
### System-defined fields
|
||||
|
||||
The system-defined fields are:
|
||||
|
||||
1. **EventRecordID**
|
||||
A unique, sequential identifier for the event within the channel. This ID increases as new events are logged.
|
||||
|
||||
2. **Version**
|
||||
The version of the event, indicating possible structural changes or updates to the event definition.
|
||||
|
||||
Netdata adds this field automatically when it is not zero.
|
||||
|
||||
3. **Level**
|
||||
The severity or importance of the event. Levels can include:
|
||||
- 0: LogAlways (reserved)
|
||||
- 1: Critical
|
||||
- 2: Error
|
||||
- 3: Warning
|
||||
- 4: Informational
|
||||
- 5: Verbose
|
||||
|
||||
Additionally, applications may define their own levels.
|
||||
|
||||
Netdata provides 2 fields: `Level` and `LevelID` for the text and numeric representation of it.
|
||||
|
||||
4. **Opcode**
|
||||
The action or state within a provider when the event was logged.
|
||||
|
||||
Netdata provides 2 fields: `Opcode` and `OpcodeID` for the text and numeric representation of it.
|
||||
|
||||
5. **EventID**
|
||||
This identifies the event template, linking it to a specific message or event type. Event IDs are provider-specific.
|
||||
|
||||
6. **Task**
|
||||
Defines a higher-level categorization or logical grouping for the event, often related to a specific function within the application or provider.
|
||||
|
||||
Netdata provides 2 fields: `Task` and `TaskID` for the text and numeric representation of it.
|
||||
|
||||
7. **Qualifiers**
|
||||
Provides additional detail for interpreting the event and is often specific to the event source.
|
||||
|
||||
Netdata adds this field automatically when it is not zero.
|
||||
|
||||
8. **ProcessID**
|
||||
The ID of the process that generated the event, useful for pinpointing the source of the event within the system.
|
||||
|
||||
9. **ThreadID**
|
||||
The ID of the thread within the process that generated the event, which helps in more detailed debugging scenarios.
|
||||
|
||||
10. **Keywords**
|
||||
A categorization field that can be used for event filtering. Keywords are bit flags that represent categories or purposes of the event, providing additional context.
|
||||
|
||||
Netdata provides 2 fields: `Keywords` and `keywordsID` for the text and numeric representation of it.
|
||||
|
||||
11. **Provider**
|
||||
The unique identifier (GUID) of the event provider. This is essential for knowing which application or system component generated the event.
|
||||
|
||||
Netdata provides 2 fields: `Provider` and `ProviderGUID` for its name and GUID of it.
|
||||
|
||||
12. **ActivityID**
|
||||
A GUID that correlates events generated as part of the same operation or transaction, helping to track activities across different components or stages.
|
||||
|
||||
Netdata adds this field automatically when it is not zero.
|
||||
|
||||
13. **RelatedActivityID**
|
||||
A GUID that links related operations or transactions, allowing for tracing complex workflows where one event triggers or relates to another.
|
||||
|
||||
Netdata adds this field automatically when it is not zero.
|
||||
|
||||
14. **Timestamp**
|
||||
The timestamp when the event was created. This provides precise timing information about when the event occurred.
|
||||
|
||||
15. **User**
|
||||
The system user who logged this event.
|
||||
|
||||
Netdata provides 3 fields: `UserAccount`, `UserDomain` and `UserSID`.
|
||||
|
||||
### User-defined fields
|
||||
Each event log entry can include up to 100 user-defined fields (per event-id).
|
||||
|
||||
Unfortunately, accessing these fields is significantly slower, to a level that is not practical to do so
|
||||
when there are more than few thousand log entries to explore. So, Netdata presents them
|
||||
with lazy loading.
|
||||
|
||||
This prevents Netdata for offering filtering for user-defined fields, although Netdata does support
|
||||
full text search on user-defined field values.
|
||||
|
||||
### Event fields as columns in the table
|
||||
|
||||
The system fields mentioned above are offered as columns on the UI. Use the gear button above the table to
|
||||
select visible columns.
|
||||
|
||||
### Event fields as filters
|
||||
|
||||
The plugin presents the system fields as filters for the query, with counters for each of the possible values
|
||||
for the field. This list can be used to quickly check which fields and values are available for the entire
|
||||
time-frame of the query, across multiple providers and channels.
|
||||
|
||||
### Event fields as histogram sources
|
||||
|
||||
The histogram can be based on any of the system fields that are available as filters. This allows you to
|
||||
visualize the distribution of events over time based on different criteria such as Level, Provider, or EventID.
|
||||
|
||||
## PLAY mode
|
||||
|
||||
The PLAY mode in this plugin allows real-time monitoring of new events as they are added to the Windows Event
|
||||
Log. This feature works by continuously querying for new events and updating the display.
|
||||
|
||||
## Full-text search
|
||||
|
||||
The plugin supports searching for text within all system and user fields of the events. This means that while
|
||||
user-defined fields are not directly filterable, they are searchable through the full-text search feature.
|
||||
|
||||
Keep in mind that query performance is slower while doing full text search, mainly because the plugin
|
||||
needs to ask from the system to provide all the user fields values.
|
||||
|
||||
## Query performance
|
||||
|
||||
The plugin is optimized to work efficiently with Event Logs. It uses several layers of caching and
|
||||
similar techniques to offload as much work as possible from the system, offering quick responses even when
|
||||
hundreds of thousands of events are within the visible timeframe.
|
||||
|
||||
To achieve this level of efficiency, the plugin:
|
||||
|
||||
- pre-loads ETW providers' manifests for resolving numeric Levels, Opcodes, Tasks and Keywords to text.
|
||||
- caches number to text maps for Levels, Opcodes, Tasks and Keywords per provider for WEL providers.
|
||||
- caches user SID to account and domain maps.
|
||||
- lazy loads the "expensive" event Message and XML, so that the system is queried only for the visible events.
|
||||
|
||||
For Full Text Search:
|
||||
|
||||
- requests only the Message and the values of the user-fields from the system, avoiding the "expensive" XML call (which is still lazy-loaded).
|
||||
|
||||
The result is a system that is highly efficient for working with moderate volumes (hundreds of thousands) of events.
|
||||
|
||||
## Configuration and maintenance
|
||||
|
||||
This Netdata plugin does not require any specific configuration. It automatically detects available event logs
|
||||
on the system.
|
||||
|
||||
## FAQ
|
||||
|
||||
### Can I use this plugin on event centralization servers?
|
||||
|
||||
Yes. You can centralize your Windows Events using Windows Event Forwarding (WEF) or other event collection
|
||||
mechanisms, and then install Netdata on this events centralization server to explore the events of all your
|
||||
infrastructure.
|
||||
|
||||
This plugin will automatically provide multi-node views of your events and also give you the ability to
|
||||
combine the events of multiple servers, as you see fit.
|
||||
|
||||
### Can I use this plugin from a parent Netdata?
|
||||
|
||||
Yes. When your nodes are connected to a Netdata parent, all their functions are available via the parent's UI.
|
||||
So, from the parent UI, you can access the functions of all your nodes.
|
||||
|
||||
Keep in mind that to protect your privacy, in order to access Netdata functions, you need a free Netdata Cloud
|
||||
account.
|
||||
|
||||
### Is any of my data exposed to Netdata Cloud from this plugin?
|
||||
|
||||
No. When you access the Agent directly, none of your data passes through Netdata Cloud. You need a free Netdata
|
||||
Cloud account only to verify your identity and enable the use of Netdata Functions. Once this is done, all the
|
||||
data flow directly from your Netdata Agent to your web browser.
|
||||
|
||||
When you access Netdata via https://app.netdata.cloud, your data travel via Netdata Cloud, but they are not stored
|
||||
in Netdata Cloud. This is to allow you access your Netdata Agents from anywhere. All communication from/to
|
||||
Netdata Cloud is encrypted.
|
||||
|
||||
### What are the different types of event logs supported by this plugin?
|
||||
|
||||
The plugin supports all the kinds of event logs currently supported by the Windows Event Viewer:
|
||||
|
||||
- Windows Event Logs (WEL): The traditional event logging system in Windows.
|
||||
- Event Tracing for Windows (ETW): A more detailed and efficient event tracing system.
|
||||
- TraceLogging (TL): An extension of ETW that simplifies the process of adding events to your code.
|
||||
|
||||
The plugin can access all of these when they are routed to the Windows Event Log.
|
||||
|
||||
### How does this plugin handle user-defined fields in Windows Events?
|
||||
|
||||
User-defined fields are not directly exposed as table columns or filters in the plugin interface. However,
|
||||
they are included in the XML representation of each event, which can be viewed in the info sidebar when
|
||||
clicking on an event entry. Additionally, the full-text search feature does search through these
|
||||
user-defined fields, allowing you to find specific information even if it's not in the main system fields.
|
||||
|
||||
### Can I use this plugin to monitor real-time events?
|
||||
|
||||
Yes, the plugin supports a PLAY mode that allows you to monitor events in real-time. When activated, it
|
||||
continuously updates to show new events as they are logged, similar to the "tail" functionality in
|
||||
Unix-like systems.
|
||||
|
||||
### How does the plugin handle large volumes of events?
|
||||
|
||||
The plugin is designed to handle moderate volumes of events (hundreds of thousands of events) efficiently.
|
||||
|
||||
It is in our roadmap to port the `systemd-journal` sampling techniques to it, for working with very large
|
||||
datasets to provide quick responses while still giving accurate representations of the data. However, for
|
||||
the best performance, we recommend querying smaller time frames or using more specific filters when dealing
|
||||
with extremely large event volumes.
|
||||
|
||||
### Can I use this plugin to analyze events from multiple servers?
|
||||
|
||||
Yes, if you have set up Windows Event Forwarding (WEF) or another method of centralizing your Windows Events,
|
||||
you can use this plugin on the central server to analyze events from multiple sources. The plugin will
|
||||
automatically detect the available event sources.
|
||||
|
||||
### How does the histogram feature work in this plugin?
|
||||
|
||||
The histogram feature provides a visual representation of event frequency over time. You can base the
|
||||
histogram on any of the system fields available as filters (such as Level, Provider, or EventID). This
|
||||
allows you to quickly identify patterns or anomalies in your event logs.
|
||||
|
||||
### Is it possible to export or share the results from this plugin?
|
||||
|
||||
While the plugin doesn't have a direct export feature, you can use browser-based methods to save or share
|
||||
the results. This could include taking screenshots, using browser print/save as PDF functionality, or
|
||||
copying data from the table view. For more advanced data export needs, you might need to use the Windows
|
||||
Event Log API directly or other Windows administrative tools.
|
||||
|
||||
### How often does the plugin update its data?
|
||||
|
||||
The plugin updates its data in real-time when in PLAY mode. In normal mode, it refreshes data based on the
|
||||
query you've submitted. The plugin is designed to provide the most up-to-date information available in the
|
||||
Windows Event Logs at the time of the query.
|
||||
|
||||
## TODO
|
||||
|
||||
1. Support Sampling, so that the plugin can respond faster even on very busy systems (millions of events visible).
|
||||
2. Support exploring events from live Tracing sessions.
|
||||
3. Support exploring events in saved Event Trace Log files (`.etl` files).
|
||||
4. Support exploring events in saved Event Logs files (`.evtx` files).
|
||||
|
|
|
@ -1,158 +1,158 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "windows-events-fields-cache.h"
|
||||
|
||||
typedef struct field_key {
|
||||
uint64_t value;
|
||||
ND_UUID provider;
|
||||
} WEVT_FIELD_KEY;
|
||||
|
||||
typedef struct field_value {
|
||||
WEVT_FIELD_KEY key;
|
||||
uint32_t name_size;
|
||||
char name[];
|
||||
} WEVT_FIELD_VALUE;
|
||||
|
||||
#define SIMPLE_HASHTABLE_NAME _FIELDS_CACHE
|
||||
#define SIMPLE_HASHTABLE_VALUE_TYPE WEVT_FIELD_VALUE *
|
||||
#define SIMPLE_HASHTABLE_KEY_TYPE WEVT_FIELD_KEY
|
||||
#define SIMPLE_HASHTABLE_VALUE2KEY_FUNCTION field_cache_value_to_key
|
||||
#define SIMPLE_HASHTABLE_COMPARE_KEYS_FUNCTION field_cache_cache_compar
|
||||
#define SIMPLE_HASHTABLE_SAMPLE_IMPLEMENTATION 1
|
||||
#include "libnetdata/simple_hashtable/simple_hashtable.h"
|
||||
|
||||
static inline WEVT_FIELD_KEY *field_cache_value_to_key(WEVT_FIELD_VALUE *p) {
|
||||
return &p->key;
|
||||
}
|
||||
|
||||
static inline bool field_cache_cache_compar(WEVT_FIELD_KEY *a, WEVT_FIELD_KEY *b) {
|
||||
return memcmp(a, b, sizeof(WEVT_FIELD_KEY)) == 0;
|
||||
}
|
||||
|
||||
struct ht {
|
||||
SPINLOCK spinlock;
|
||||
size_t allocations;
|
||||
size_t bytes;
|
||||
struct simple_hashtable_FIELDS_CACHE ht;
|
||||
};
|
||||
|
||||
static struct {
|
||||
bool initialized;
|
||||
struct ht ht[WEVT_FIELD_TYPE_MAX];
|
||||
} fdc = {
|
||||
.initialized = false,
|
||||
};
|
||||
|
||||
void field_cache_init(void) {
|
||||
for(size_t type = 0; type < WEVT_FIELD_TYPE_MAX ; type++) {
|
||||
spinlock_init(&fdc.ht[type].spinlock);
|
||||
simple_hashtable_init_FIELDS_CACHE(&fdc.ht[type].ht, 10000);
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool should_zero_provider(WEVT_FIELD_TYPE type, uint64_t value) {
|
||||
switch(type) {
|
||||
case WEVT_FIELD_TYPE_LEVEL:
|
||||
return !is_valid_provider_level(value, true);
|
||||
|
||||
case WEVT_FIELD_TYPE_KEYWORD:
|
||||
return !is_valid_provider_keyword(value, true);
|
||||
|
||||
case WEVT_FIELD_TYPE_OPCODE:
|
||||
return !is_valid_provider_opcode(value, true);
|
||||
|
||||
case WEVT_FIELD_TYPE_TASK:
|
||||
return !is_valid_provider_task(value, true);
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool field_cache_get(WEVT_FIELD_TYPE type, const ND_UUID *uuid, uint64_t value, TXT_UTF8 *dst) {
|
||||
fatal_assert(type < WEVT_FIELD_TYPE_MAX);
|
||||
|
||||
struct ht *ht = &fdc.ht[type];
|
||||
|
||||
WEVT_FIELD_KEY t = {
|
||||
.value = value,
|
||||
.provider = should_zero_provider(type, value) ? UUID_ZERO : *uuid,
|
||||
};
|
||||
XXH64_hash_t hash = XXH3_64bits(&t, sizeof(t));
|
||||
|
||||
spinlock_lock(&ht->spinlock);
|
||||
SIMPLE_HASHTABLE_SLOT_FIELDS_CACHE *slot = simple_hashtable_get_slot_FIELDS_CACHE(&ht->ht, hash, &t, true);
|
||||
WEVT_FIELD_VALUE *v = SIMPLE_HASHTABLE_SLOT_DATA(slot);
|
||||
spinlock_unlock(&ht->spinlock);
|
||||
|
||||
if(v) {
|
||||
txt_utf8_resize(dst, v->name_size, false);
|
||||
memcpy(dst->data, v->name, v->name_size);
|
||||
dst->used = v->name_size;
|
||||
dst->src = TXT_SOURCE_FIELD_CACHE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static WEVT_FIELD_VALUE *wevt_create_cache_entry(WEVT_FIELD_KEY *t, TXT_UTF8 *name, size_t *bytes) {
|
||||
*bytes = sizeof(WEVT_FIELD_VALUE) + name->used;
|
||||
WEVT_FIELD_VALUE *v = callocz(1, *bytes);
|
||||
v->key = *t;
|
||||
memcpy(v->name, name->data, name->used);
|
||||
v->name_size = name->used;
|
||||
return v;
|
||||
}
|
||||
|
||||
//static bool is_numeric(const char *s) {
|
||||
// while(*s) {
|
||||
// if(!isdigit((uint8_t)*s++))
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// return true;
|
||||
//}
|
||||
|
||||
void field_cache_set(WEVT_FIELD_TYPE type, const ND_UUID *uuid, uint64_t value, TXT_UTF8 *name) {
|
||||
fatal_assert(type < WEVT_FIELD_TYPE_MAX);
|
||||
|
||||
struct ht *ht = &fdc.ht[type];
|
||||
|
||||
WEVT_FIELD_KEY t = {
|
||||
.value = value,
|
||||
.provider = should_zero_provider(type, value) ? UUID_ZERO : *uuid,
|
||||
};
|
||||
XXH64_hash_t hash = XXH3_64bits(&t, sizeof(t));
|
||||
|
||||
spinlock_lock(&ht->spinlock);
|
||||
SIMPLE_HASHTABLE_SLOT_FIELDS_CACHE *slot = simple_hashtable_get_slot_FIELDS_CACHE(&ht->ht, hash, &t, true);
|
||||
WEVT_FIELD_VALUE *v = SIMPLE_HASHTABLE_SLOT_DATA(slot);
|
||||
if(!v) {
|
||||
size_t bytes;
|
||||
v = wevt_create_cache_entry(&t, name, &bytes);
|
||||
simple_hashtable_set_slot_FIELDS_CACHE(&ht->ht, slot, hash, v);
|
||||
|
||||
ht->allocations++;
|
||||
ht->bytes += bytes;
|
||||
}
|
||||
// else {
|
||||
// if((v->name_size == 1 && name->used > 0) || is_numeric(v->name)) {
|
||||
// size_t bytes;
|
||||
// WEVT_FIELD_VALUE *nv = wevt_create_cache_entry(&t, name, &bytes);
|
||||
// simple_hashtable_set_slot_FIELDS_CACHE(&ht->ht, slot, hash, nv);
|
||||
// ht->bytes += name->used;
|
||||
// ht->bytes -= v->name_size;
|
||||
// freez(v);
|
||||
// }
|
||||
// else if(name->used > 2 && !is_numeric(name->data) && (v->name_size != name->used || strcasecmp(v->name, name->data) != 0)) {
|
||||
// const char *a = v->name;
|
||||
// const char *b = name->data;
|
||||
// int x = 0;
|
||||
// x++;
|
||||
// }
|
||||
// }
|
||||
|
||||
spinlock_unlock(&ht->spinlock);
|
||||
}
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "windows-events-fields-cache.h"
|
||||
|
||||
typedef struct field_key {
|
||||
uint64_t value;
|
||||
ND_UUID provider;
|
||||
} WEVT_FIELD_KEY;
|
||||
|
||||
typedef struct field_value {
|
||||
WEVT_FIELD_KEY key;
|
||||
uint32_t name_size;
|
||||
char name[];
|
||||
} WEVT_FIELD_VALUE;
|
||||
|
||||
#define SIMPLE_HASHTABLE_NAME _FIELDS_CACHE
|
||||
#define SIMPLE_HASHTABLE_VALUE_TYPE WEVT_FIELD_VALUE *
|
||||
#define SIMPLE_HASHTABLE_KEY_TYPE WEVT_FIELD_KEY
|
||||
#define SIMPLE_HASHTABLE_VALUE2KEY_FUNCTION field_cache_value_to_key
|
||||
#define SIMPLE_HASHTABLE_COMPARE_KEYS_FUNCTION field_cache_cache_compar
|
||||
#define SIMPLE_HASHTABLE_SAMPLE_IMPLEMENTATION 1
|
||||
#include "libnetdata/simple_hashtable/simple_hashtable.h"
|
||||
|
||||
static inline WEVT_FIELD_KEY *field_cache_value_to_key(WEVT_FIELD_VALUE *p) {
|
||||
return &p->key;
|
||||
}
|
||||
|
||||
static inline bool field_cache_cache_compar(WEVT_FIELD_KEY *a, WEVT_FIELD_KEY *b) {
|
||||
return memcmp(a, b, sizeof(WEVT_FIELD_KEY)) == 0;
|
||||
}
|
||||
|
||||
struct ht {
|
||||
SPINLOCK spinlock;
|
||||
size_t allocations;
|
||||
size_t bytes;
|
||||
struct simple_hashtable_FIELDS_CACHE ht;
|
||||
};
|
||||
|
||||
static struct {
|
||||
bool initialized;
|
||||
struct ht ht[WEVT_FIELD_TYPE_MAX];
|
||||
} fdc = {
|
||||
.initialized = false,
|
||||
};
|
||||
|
||||
void field_cache_init(void) {
|
||||
for(size_t type = 0; type < WEVT_FIELD_TYPE_MAX ; type++) {
|
||||
spinlock_init(&fdc.ht[type].spinlock);
|
||||
simple_hashtable_init_FIELDS_CACHE(&fdc.ht[type].ht, 10000);
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool should_zero_provider(WEVT_FIELD_TYPE type, uint64_t value) {
|
||||
switch(type) {
|
||||
case WEVT_FIELD_TYPE_LEVEL:
|
||||
return !is_valid_provider_level(value, true);
|
||||
|
||||
case WEVT_FIELD_TYPE_KEYWORD:
|
||||
return !is_valid_provider_keyword(value, true);
|
||||
|
||||
case WEVT_FIELD_TYPE_OPCODE:
|
||||
return !is_valid_provider_opcode(value, true);
|
||||
|
||||
case WEVT_FIELD_TYPE_TASK:
|
||||
return !is_valid_provider_task(value, true);
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool field_cache_get(WEVT_FIELD_TYPE type, const ND_UUID *uuid, uint64_t value, TXT_UTF8 *dst) {
|
||||
fatal_assert(type < WEVT_FIELD_TYPE_MAX);
|
||||
|
||||
struct ht *ht = &fdc.ht[type];
|
||||
|
||||
WEVT_FIELD_KEY t = {
|
||||
.value = value,
|
||||
.provider = should_zero_provider(type, value) ? UUID_ZERO : *uuid,
|
||||
};
|
||||
XXH64_hash_t hash = XXH3_64bits(&t, sizeof(t));
|
||||
|
||||
spinlock_lock(&ht->spinlock);
|
||||
SIMPLE_HASHTABLE_SLOT_FIELDS_CACHE *slot = simple_hashtable_get_slot_FIELDS_CACHE(&ht->ht, hash, &t, true);
|
||||
WEVT_FIELD_VALUE *v = SIMPLE_HASHTABLE_SLOT_DATA(slot);
|
||||
spinlock_unlock(&ht->spinlock);
|
||||
|
||||
if(v) {
|
||||
txt_utf8_resize(dst, v->name_size, false);
|
||||
memcpy(dst->data, v->name, v->name_size);
|
||||
dst->used = v->name_size;
|
||||
dst->src = TXT_SOURCE_FIELD_CACHE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static WEVT_FIELD_VALUE *wevt_create_cache_entry(WEVT_FIELD_KEY *t, TXT_UTF8 *name, size_t *bytes) {
|
||||
*bytes = sizeof(WEVT_FIELD_VALUE) + name->used;
|
||||
WEVT_FIELD_VALUE *v = callocz(1, *bytes);
|
||||
v->key = *t;
|
||||
memcpy(v->name, name->data, name->used);
|
||||
v->name_size = name->used;
|
||||
return v;
|
||||
}
|
||||
|
||||
//static bool is_numeric(const char *s) {
|
||||
// while(*s) {
|
||||
// if(!isdigit((uint8_t)*s++))
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// return true;
|
||||
//}
|
||||
|
||||
void field_cache_set(WEVT_FIELD_TYPE type, const ND_UUID *uuid, uint64_t value, TXT_UTF8 *name) {
|
||||
fatal_assert(type < WEVT_FIELD_TYPE_MAX);
|
||||
|
||||
struct ht *ht = &fdc.ht[type];
|
||||
|
||||
WEVT_FIELD_KEY t = {
|
||||
.value = value,
|
||||
.provider = should_zero_provider(type, value) ? UUID_ZERO : *uuid,
|
||||
};
|
||||
XXH64_hash_t hash = XXH3_64bits(&t, sizeof(t));
|
||||
|
||||
spinlock_lock(&ht->spinlock);
|
||||
SIMPLE_HASHTABLE_SLOT_FIELDS_CACHE *slot = simple_hashtable_get_slot_FIELDS_CACHE(&ht->ht, hash, &t, true);
|
||||
WEVT_FIELD_VALUE *v = SIMPLE_HASHTABLE_SLOT_DATA(slot);
|
||||
if(!v) {
|
||||
size_t bytes;
|
||||
v = wevt_create_cache_entry(&t, name, &bytes);
|
||||
simple_hashtable_set_slot_FIELDS_CACHE(&ht->ht, slot, hash, v);
|
||||
|
||||
ht->allocations++;
|
||||
ht->bytes += bytes;
|
||||
}
|
||||
// else {
|
||||
// if((v->name_size == 1 && name->used > 0) || is_numeric(v->name)) {
|
||||
// size_t bytes;
|
||||
// WEVT_FIELD_VALUE *nv = wevt_create_cache_entry(&t, name, &bytes);
|
||||
// simple_hashtable_set_slot_FIELDS_CACHE(&ht->ht, slot, hash, nv);
|
||||
// ht->bytes += name->used;
|
||||
// ht->bytes -= v->name_size;
|
||||
// freez(v);
|
||||
// }
|
||||
// else if(name->used > 2 && !is_numeric(name->data) && (v->name_size != name->used || strcasecmp(v->name, name->data) != 0)) {
|
||||
// const char *a = v->name;
|
||||
// const char *b = name->data;
|
||||
// int x = 0;
|
||||
// x++;
|
||||
// }
|
||||
// }
|
||||
|
||||
spinlock_unlock(&ht->spinlock);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_WINDOWS_EVENTS_FIELDS_CACHE_H
|
||||
#define NETDATA_WINDOWS_EVENTS_FIELDS_CACHE_H
|
||||
|
||||
#include "windows-events.h"
|
||||
|
||||
typedef enum __attribute__((packed)) {
|
||||
WEVT_FIELD_TYPE_LEVEL = 0,
|
||||
WEVT_FIELD_TYPE_OPCODE,
|
||||
WEVT_FIELD_TYPE_KEYWORD,
|
||||
WEVT_FIELD_TYPE_TASK,
|
||||
|
||||
// terminator
|
||||
WEVT_FIELD_TYPE_MAX,
|
||||
} WEVT_FIELD_TYPE;
|
||||
|
||||
void field_cache_init(void);
|
||||
bool field_cache_get(WEVT_FIELD_TYPE type, const ND_UUID *uuid, uint64_t value, TXT_UTF8 *dst);
|
||||
void field_cache_set(WEVT_FIELD_TYPE type, const ND_UUID *uuid, uint64_t value, TXT_UTF8 *name);
|
||||
|
||||
#endif //NETDATA_WINDOWS_EVENTS_FIELDS_CACHE_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_WINDOWS_EVENTS_FIELDS_CACHE_H
|
||||
#define NETDATA_WINDOWS_EVENTS_FIELDS_CACHE_H
|
||||
|
||||
#include "windows-events.h"
|
||||
|
||||
typedef enum __attribute__((packed)) {
|
||||
WEVT_FIELD_TYPE_LEVEL = 0,
|
||||
WEVT_FIELD_TYPE_OPCODE,
|
||||
WEVT_FIELD_TYPE_KEYWORD,
|
||||
WEVT_FIELD_TYPE_TASK,
|
||||
|
||||
// terminator
|
||||
WEVT_FIELD_TYPE_MAX,
|
||||
} WEVT_FIELD_TYPE;
|
||||
|
||||
void field_cache_init(void);
|
||||
bool field_cache_get(WEVT_FIELD_TYPE type, const ND_UUID *uuid, uint64_t value, TXT_UTF8 *dst);
|
||||
void field_cache_set(WEVT_FIELD_TYPE type, const ND_UUID *uuid, uint64_t value, TXT_UTF8 *name);
|
||||
|
||||
#endif //NETDATA_WINDOWS_EVENTS_FIELDS_CACHE_H
|
||||
|
|
|
@ -952,9 +952,8 @@ int main(int argc, char **argv) {
|
|||
fprintf(stderr,
|
||||
"\n"
|
||||
" netdata xenstat.plugin %s\n"
|
||||
" Copyright (C) 2019 Netdata Inc.\n"
|
||||
" Copyright 2018-2025 Netdata Inc.\n"
|
||||
" Released under GNU General Public License v3 or later.\n"
|
||||
" All rights reserved.\n"
|
||||
"\n"
|
||||
" This program is a data collector plugin for netdata.\n"
|
||||
"\n"
|
||||
|
|
|
@ -101,12 +101,11 @@ int help(int exitcode) {
|
|||
fprintf(stream, "%s", "\n"
|
||||
" ^\n"
|
||||
" |.-. .-. .-. .-. . netdata \n"
|
||||
" | '-' '-' '-' '-' real-time performance monitoring, done right! \n"
|
||||
" | '-' '-' '-' '-' monitoring and troubleshooting, transformed! \n"
|
||||
" +----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+--->\n"
|
||||
"\n"
|
||||
" Copyright (C) 2016-2023, Netdata, Inc. <info@netdata.cloud>\n"
|
||||
" Copyright 2018-2025 Netdata Inc.\n"
|
||||
" Released under GNU General Public License v3 or later.\n"
|
||||
" All rights reserved.\n"
|
||||
"\n"
|
||||
" Home Page : https://netdata.cloud\n"
|
||||
" Source Code: https://github.com/netdata/netdata\n"
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
#shellcheck source=/dev/null disable=SC2086,SC2154
|
||||
|
||||
# netdata
|
||||
# real-time performance and health monitoring, done right!
|
||||
# (C) 2023 Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# Script to send alarm notifications for netdata
|
||||
|
@ -38,6 +33,7 @@
|
|||
# - Opsgenie by @thiaoftsm #9858
|
||||
# - Gotify by @coffeegrind123
|
||||
# - ntfy.sh by @Dim-P
|
||||
#shellcheck source=/dev/null disable=SC2086,SC2154
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# testing notifications
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# netdata
|
||||
# real-time performance and health monitoring, done right!
|
||||
# (C) 2017 Costa Tsaousis <costa@tsaousis.gr>
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# Script to test alarm notifications for netdata
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
/* ------------------------------------------------------------------------- */
|
||||
/*
|
||||
* avl_insert(), avl_remove() and avl_search()
|
||||
* are adaptations (by Costa Tsaousis) of the AVL algorithm found in libavl
|
||||
* are adaptations (by Netdata Inc.) of the AVL algorithm found in libavl
|
||||
* v2.0.3, so that they do not use any memory allocations and their memory
|
||||
* footprint is optimized (by eliminating non-necessary data members).
|
||||
*
|
||||
|
@ -279,7 +279,7 @@ avl_t *avl_remove(avl_tree_type *tree, avl_t *item) {
|
|||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
// below are functions by (C) Costa Tsaousis
|
||||
// below are functions by Copyright 2018-2025 Netdata Inc.
|
||||
|
||||
// ---------------------------
|
||||
// traversing
|
||||
|
|
|
@ -1,43 +1,43 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "libnetdata/libnetdata.h"
|
||||
|
||||
#ifndef HAVE_SETENV
|
||||
int os_setenv(const char *name, const char *value, int overwrite) {
|
||||
char *env_var;
|
||||
int result;
|
||||
|
||||
if (!overwrite) {
|
||||
env_var = getenv(name);
|
||||
if (env_var) return 0; // Already set
|
||||
}
|
||||
|
||||
size_t len = strlen(name) + strlen(value) + 2; // +2 for '=' and '\0'
|
||||
env_var = malloc(len);
|
||||
if (!env_var) return -1; // Allocation failure
|
||||
snprintf(env_var, len, "%s=%s", name, value);
|
||||
|
||||
result = putenv(env_var);
|
||||
// free(env_var); // _putenv in Windows makes a copy of the string
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void nd_setenv(const char *name, const char *value, int overwrite) {
|
||||
#if defined(OS_WINDOWS)
|
||||
if(overwrite)
|
||||
SetEnvironmentVariable(name, value);
|
||||
else {
|
||||
char buf[1024];
|
||||
if(GetEnvironmentVariable(name, buf, sizeof(buf)) == 0)
|
||||
SetEnvironmentVariable(name, value);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SETENV
|
||||
setenv(name, value, overwrite);
|
||||
#else
|
||||
os_setenv(name, value, overwite);
|
||||
#endif
|
||||
}
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "libnetdata/libnetdata.h"
|
||||
|
||||
#ifndef HAVE_SETENV
|
||||
int os_setenv(const char *name, const char *value, int overwrite) {
|
||||
char *env_var;
|
||||
int result;
|
||||
|
||||
if (!overwrite) {
|
||||
env_var = getenv(name);
|
||||
if (env_var) return 0; // Already set
|
||||
}
|
||||
|
||||
size_t len = strlen(name) + strlen(value) + 2; // +2 for '=' and '\0'
|
||||
env_var = malloc(len);
|
||||
if (!env_var) return -1; // Allocation failure
|
||||
snprintf(env_var, len, "%s=%s", name, value);
|
||||
|
||||
result = putenv(env_var);
|
||||
// free(env_var); // _putenv in Windows makes a copy of the string
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void nd_setenv(const char *name, const char *value, int overwrite) {
|
||||
#if defined(OS_WINDOWS)
|
||||
if(overwrite)
|
||||
SetEnvironmentVariable(name, value);
|
||||
else {
|
||||
char buf[1024];
|
||||
if(GetEnvironmentVariable(name, buf, sizeof(buf)) == 0)
|
||||
SetEnvironmentVariable(name, value);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SETENV
|
||||
setenv(name, value, overwrite);
|
||||
#else
|
||||
os_setenv(name, value, overwite);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_SETENV_H
|
||||
#define NETDATA_SETENV_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifndef HAVE_SETENV
|
||||
int os_setenv(const char *name, const char *value, int overwrite);
|
||||
#define setenv(name, value, overwrite) os_setenv(name, value, overwrite)
|
||||
#endif
|
||||
|
||||
void nd_setenv(const char *name, const char *value, int overwrite);
|
||||
|
||||
#endif //NETDATA_SETENV_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_SETENV_H
|
||||
#define NETDATA_SETENV_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifndef HAVE_SETENV
|
||||
int os_setenv(const char *name, const char *value, int overwrite);
|
||||
#define setenv(name, value, overwrite) os_setenv(name, value, overwrite)
|
||||
#endif
|
||||
|
||||
void nd_setenv(const char *name, const char *value, int overwrite);
|
||||
|
||||
#endif //NETDATA_SETENV_H
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_SLEEP_H
|
||||
#define NETDATA_SLEEP_H
|
||||
|
||||
void yield_the_processor(void);
|
||||
void tinysleep(void);
|
||||
void microsleep(usec_t ut);
|
||||
|
||||
#endif //NETDATA_SLEEP_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_SLEEP_H
|
||||
#define NETDATA_SLEEP_H
|
||||
|
||||
void yield_the_processor(void);
|
||||
void tinysleep(void);
|
||||
void microsleep(usec_t ut);
|
||||
|
||||
#endif //NETDATA_SLEEP_H
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_UUID_GENERATE_H
|
||||
#define NETDATA_UUID_GENERATE_H
|
||||
|
||||
void os_uuid_generate(void *out);
|
||||
void os_uuid_generate_random(void *out);
|
||||
void os_uuid_generate_time(void *out);
|
||||
|
||||
#endif //NETDATA_UUID_GENERATE_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_UUID_GENERATE_H
|
||||
#define NETDATA_UUID_GENERATE_H
|
||||
|
||||
void os_uuid_generate(void *out);
|
||||
void os_uuid_generate_random(void *out);
|
||||
void os_uuid_generate_time(void *out);
|
||||
|
||||
#endif //NETDATA_UUID_GENERATE_H
|
||||
|
|
|
@ -1,183 +1,183 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "entries.h"
|
||||
|
||||
// Define multipliers for base 10 (decimal) units
|
||||
#define ENTRIES_MULTIPLIER_BASE10 1000ULL
|
||||
#define ENTRIES_MULTIPLIER_K (ENTRIES_MULTIPLIER_BASE10)
|
||||
#define ENTRIES_MULTIPLIER_M (ENTRIES_MULTIPLIER_K * ENTRIES_MULTIPLIER_BASE10)
|
||||
#define ENTRIES_MULTIPLIER_G (ENTRIES_MULTIPLIER_M * ENTRIES_MULTIPLIER_BASE10)
|
||||
#define ENTRIES_MULTIPLIER_T (ENTRIES_MULTIPLIER_G * ENTRIES_MULTIPLIER_BASE10)
|
||||
#define ENTRIES_MULTIPLIER_P (ENTRIES_MULTIPLIER_T * ENTRIES_MULTIPLIER_BASE10)
|
||||
#define ENTRIES_MULTIPLIER_E (ENTRIES_MULTIPLIER_P * ENTRIES_MULTIPLIER_BASE10)
|
||||
#define ENTRIES_MULTIPLIER_Z (ENTRIES_MULTIPLIER_E * ENTRIES_MULTIPLIER_BASE10)
|
||||
#define ENTRIES_MULTIPLIER_Y (ENTRIES_MULTIPLIER_Z * ENTRIES_MULTIPLIER_BASE10)
|
||||
|
||||
// Define a structure to map size units to their multipliers
|
||||
static const struct size_unit {
|
||||
const char *unit;
|
||||
const bool formatter; // true when this unit should be used when formatting to string
|
||||
const uint64_t multiplier;
|
||||
} entries_units[] = {
|
||||
// the order of this table is important: smaller to bigger units!
|
||||
|
||||
{ .unit = "", .formatter = true, .multiplier = 1ULL },
|
||||
{ .unit = "k", .formatter = false, .multiplier = ENTRIES_MULTIPLIER_K },
|
||||
{ .unit = "K", .formatter = true, .multiplier = ENTRIES_MULTIPLIER_K },
|
||||
{ .unit = "M", .formatter = true, .multiplier = ENTRIES_MULTIPLIER_M },
|
||||
{ .unit = "G", .formatter = true, .multiplier = ENTRIES_MULTIPLIER_G },
|
||||
{ .unit = "T", .formatter = true, .multiplier = ENTRIES_MULTIPLIER_T },
|
||||
{ .unit = "P", .formatter = true, .multiplier = ENTRIES_MULTIPLIER_P },
|
||||
{ .unit = "E", .formatter = true, .multiplier = ENTRIES_MULTIPLIER_E },
|
||||
{ .unit = "Z", .formatter = true, .multiplier = ENTRIES_MULTIPLIER_Z },
|
||||
{ .unit = "Y", .formatter = true, .multiplier = ENTRIES_MULTIPLIER_Y },
|
||||
};
|
||||
|
||||
static inline const struct size_unit *entries_find_unit(const char *unit) {
|
||||
if (!unit || !*unit) unit = "";
|
||||
|
||||
for (size_t i = 0; i < sizeof(entries_units) / sizeof(entries_units[0]); i++) {
|
||||
const struct size_unit *su = &entries_units[i];
|
||||
if ((uint8_t)unit[0] == (uint8_t)su->unit[0] && strcmp(unit, su->unit) == 0)
|
||||
return su;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline double entries_round_to_resolution_dbl2(uint64_t value, uint64_t resolution) {
|
||||
double converted = (double)value / (double)resolution;
|
||||
return round(converted * 100.0) / 100.0;
|
||||
}
|
||||
|
||||
static inline uint64_t entries_round_to_resolution_int(uint64_t value, uint64_t resolution) {
|
||||
return (value + (resolution / 2)) / resolution;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------
|
||||
// parse a size string
|
||||
|
||||
bool entries_parse(const char *entries_str, uint64_t *result, const char *default_unit) {
|
||||
if (!entries_str || !*entries_str) {
|
||||
*result = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
const struct size_unit *su_def = entries_find_unit(default_unit);
|
||||
if(!su_def) {
|
||||
*result = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
const char *s = entries_str;
|
||||
|
||||
// Skip leading spaces
|
||||
while (isspace((uint8_t)*s)) s++;
|
||||
|
||||
if(strcmp(s, "off") == 0) {
|
||||
*result = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Parse the number
|
||||
const char *number_start = s;
|
||||
NETDATA_DOUBLE value = strtondd(s, (char **)&s);
|
||||
|
||||
// If no valid number found, return false
|
||||
if (s == number_start || value < 0) {
|
||||
*result = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Skip spaces between number and unit
|
||||
while (isspace((uint8_t)*s)) s++;
|
||||
|
||||
const char *unit_start = s;
|
||||
while (isalpha((uint8_t)*s)) s++;
|
||||
|
||||
char unit[4];
|
||||
size_t unit_len = s - unit_start;
|
||||
const struct size_unit *su;
|
||||
if (unit_len == 0)
|
||||
su = su_def;
|
||||
else {
|
||||
if (unit_len >= sizeof(unit)) unit_len = sizeof(unit) - 1;
|
||||
strncpy(unit, unit_start, unit_len);
|
||||
unit[unit_len] = '\0';
|
||||
su = entries_find_unit(unit);
|
||||
if (!su) {
|
||||
*result = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t bytes = (uint64_t)round(value * (NETDATA_DOUBLE)su->multiplier);
|
||||
*result = entries_round_to_resolution_int(bytes, su_def->multiplier);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// generate a string to represent a size
|
||||
|
||||
ssize_t entries_snprintf(char *dst, size_t dst_size, uint64_t value, const char *unit, bool accurate) {
|
||||
if (!dst || dst_size == 0) return -1;
|
||||
if (dst_size == 1) {
|
||||
dst[0] = '\0';
|
||||
return -2;
|
||||
}
|
||||
|
||||
if (value == 0)
|
||||
return snprintfz(dst, dst_size, "off");
|
||||
|
||||
const struct size_unit *su_def = entries_find_unit(unit);
|
||||
if(!su_def) return -3;
|
||||
|
||||
// use the units multiplier to find the units
|
||||
uint64_t bytes = value * su_def->multiplier;
|
||||
|
||||
// Find the best unit to represent the size with up to 2 fractional digits
|
||||
const struct size_unit *su_best = su_def;
|
||||
for (size_t i = 0; i < sizeof(entries_units) / sizeof(entries_units[0]); i++) {
|
||||
const struct size_unit *su = &entries_units[i];
|
||||
if (su->multiplier < su_def->multiplier || // the multiplier is too small
|
||||
(!su->formatter && su != su_def) || // it is not to be used in formatting (except our unit)
|
||||
(bytes < su->multiplier && su != su_def) ) // the converted value will be <1.0
|
||||
continue;
|
||||
|
||||
double converted = entries_round_to_resolution_dbl2(bytes, su->multiplier);
|
||||
|
||||
uint64_t reversed_bytes = (uint64_t)round((converted * (double)su->multiplier));
|
||||
|
||||
if(accurate) {
|
||||
// no precision loss is required
|
||||
if (reversed_bytes == bytes && converted > 1.0)
|
||||
// no precision loss, this is good to use
|
||||
su_best = su;
|
||||
}
|
||||
else {
|
||||
if(converted > 1.0)
|
||||
su_best = su;
|
||||
}
|
||||
}
|
||||
|
||||
double converted = entries_round_to_resolution_dbl2(bytes, su_best->multiplier);
|
||||
|
||||
// print it either with 0, 1 or 2 fractional digits
|
||||
int written;
|
||||
if(converted == (double)((uint64_t)converted))
|
||||
written = snprintfz(dst, dst_size, "%.0f%s", converted, su_best->unit);
|
||||
else if(converted * 10.0 == (double)((uint64_t)(converted * 10.0)))
|
||||
written = snprintfz(dst, dst_size, "%.1f%s", converted, su_best->unit);
|
||||
else
|
||||
written = snprintfz(dst, dst_size, "%.2f%s", converted, su_best->unit);
|
||||
|
||||
if (written < 0)
|
||||
return -4;
|
||||
|
||||
if ((size_t)written >= dst_size)
|
||||
return (ssize_t)(dst_size - 1);
|
||||
|
||||
return written;
|
||||
}
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "entries.h"
|
||||
|
||||
// Define multipliers for base 10 (decimal) units
|
||||
#define ENTRIES_MULTIPLIER_BASE10 1000ULL
|
||||
#define ENTRIES_MULTIPLIER_K (ENTRIES_MULTIPLIER_BASE10)
|
||||
#define ENTRIES_MULTIPLIER_M (ENTRIES_MULTIPLIER_K * ENTRIES_MULTIPLIER_BASE10)
|
||||
#define ENTRIES_MULTIPLIER_G (ENTRIES_MULTIPLIER_M * ENTRIES_MULTIPLIER_BASE10)
|
||||
#define ENTRIES_MULTIPLIER_T (ENTRIES_MULTIPLIER_G * ENTRIES_MULTIPLIER_BASE10)
|
||||
#define ENTRIES_MULTIPLIER_P (ENTRIES_MULTIPLIER_T * ENTRIES_MULTIPLIER_BASE10)
|
||||
#define ENTRIES_MULTIPLIER_E (ENTRIES_MULTIPLIER_P * ENTRIES_MULTIPLIER_BASE10)
|
||||
#define ENTRIES_MULTIPLIER_Z (ENTRIES_MULTIPLIER_E * ENTRIES_MULTIPLIER_BASE10)
|
||||
#define ENTRIES_MULTIPLIER_Y (ENTRIES_MULTIPLIER_Z * ENTRIES_MULTIPLIER_BASE10)
|
||||
|
||||
// Define a structure to map size units to their multipliers
|
||||
static const struct size_unit {
|
||||
const char *unit;
|
||||
const bool formatter; // true when this unit should be used when formatting to string
|
||||
const uint64_t multiplier;
|
||||
} entries_units[] = {
|
||||
// the order of this table is important: smaller to bigger units!
|
||||
|
||||
{ .unit = "", .formatter = true, .multiplier = 1ULL },
|
||||
{ .unit = "k", .formatter = false, .multiplier = ENTRIES_MULTIPLIER_K },
|
||||
{ .unit = "K", .formatter = true, .multiplier = ENTRIES_MULTIPLIER_K },
|
||||
{ .unit = "M", .formatter = true, .multiplier = ENTRIES_MULTIPLIER_M },
|
||||
{ .unit = "G", .formatter = true, .multiplier = ENTRIES_MULTIPLIER_G },
|
||||
{ .unit = "T", .formatter = true, .multiplier = ENTRIES_MULTIPLIER_T },
|
||||
{ .unit = "P", .formatter = true, .multiplier = ENTRIES_MULTIPLIER_P },
|
||||
{ .unit = "E", .formatter = true, .multiplier = ENTRIES_MULTIPLIER_E },
|
||||
{ .unit = "Z", .formatter = true, .multiplier = ENTRIES_MULTIPLIER_Z },
|
||||
{ .unit = "Y", .formatter = true, .multiplier = ENTRIES_MULTIPLIER_Y },
|
||||
};
|
||||
|
||||
static inline const struct size_unit *entries_find_unit(const char *unit) {
|
||||
if (!unit || !*unit) unit = "";
|
||||
|
||||
for (size_t i = 0; i < sizeof(entries_units) / sizeof(entries_units[0]); i++) {
|
||||
const struct size_unit *su = &entries_units[i];
|
||||
if ((uint8_t)unit[0] == (uint8_t)su->unit[0] && strcmp(unit, su->unit) == 0)
|
||||
return su;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline double entries_round_to_resolution_dbl2(uint64_t value, uint64_t resolution) {
|
||||
double converted = (double)value / (double)resolution;
|
||||
return round(converted * 100.0) / 100.0;
|
||||
}
|
||||
|
||||
static inline uint64_t entries_round_to_resolution_int(uint64_t value, uint64_t resolution) {
|
||||
return (value + (resolution / 2)) / resolution;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------
|
||||
// parse a size string
|
||||
|
||||
bool entries_parse(const char *entries_str, uint64_t *result, const char *default_unit) {
|
||||
if (!entries_str || !*entries_str) {
|
||||
*result = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
const struct size_unit *su_def = entries_find_unit(default_unit);
|
||||
if(!su_def) {
|
||||
*result = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
const char *s = entries_str;
|
||||
|
||||
// Skip leading spaces
|
||||
while (isspace((uint8_t)*s)) s++;
|
||||
|
||||
if(strcmp(s, "off") == 0) {
|
||||
*result = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Parse the number
|
||||
const char *number_start = s;
|
||||
NETDATA_DOUBLE value = strtondd(s, (char **)&s);
|
||||
|
||||
// If no valid number found, return false
|
||||
if (s == number_start || value < 0) {
|
||||
*result = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Skip spaces between number and unit
|
||||
while (isspace((uint8_t)*s)) s++;
|
||||
|
||||
const char *unit_start = s;
|
||||
while (isalpha((uint8_t)*s)) s++;
|
||||
|
||||
char unit[4];
|
||||
size_t unit_len = s - unit_start;
|
||||
const struct size_unit *su;
|
||||
if (unit_len == 0)
|
||||
su = su_def;
|
||||
else {
|
||||
if (unit_len >= sizeof(unit)) unit_len = sizeof(unit) - 1;
|
||||
strncpy(unit, unit_start, unit_len);
|
||||
unit[unit_len] = '\0';
|
||||
su = entries_find_unit(unit);
|
||||
if (!su) {
|
||||
*result = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t bytes = (uint64_t)round(value * (NETDATA_DOUBLE)su->multiplier);
|
||||
*result = entries_round_to_resolution_int(bytes, su_def->multiplier);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// generate a string to represent a size
|
||||
|
||||
ssize_t entries_snprintf(char *dst, size_t dst_size, uint64_t value, const char *unit, bool accurate) {
|
||||
if (!dst || dst_size == 0) return -1;
|
||||
if (dst_size == 1) {
|
||||
dst[0] = '\0';
|
||||
return -2;
|
||||
}
|
||||
|
||||
if (value == 0)
|
||||
return snprintfz(dst, dst_size, "off");
|
||||
|
||||
const struct size_unit *su_def = entries_find_unit(unit);
|
||||
if(!su_def) return -3;
|
||||
|
||||
// use the units multiplier to find the units
|
||||
uint64_t bytes = value * su_def->multiplier;
|
||||
|
||||
// Find the best unit to represent the size with up to 2 fractional digits
|
||||
const struct size_unit *su_best = su_def;
|
||||
for (size_t i = 0; i < sizeof(entries_units) / sizeof(entries_units[0]); i++) {
|
||||
const struct size_unit *su = &entries_units[i];
|
||||
if (su->multiplier < su_def->multiplier || // the multiplier is too small
|
||||
(!su->formatter && su != su_def) || // it is not to be used in formatting (except our unit)
|
||||
(bytes < su->multiplier && su != su_def) ) // the converted value will be <1.0
|
||||
continue;
|
||||
|
||||
double converted = entries_round_to_resolution_dbl2(bytes, su->multiplier);
|
||||
|
||||
uint64_t reversed_bytes = (uint64_t)round((converted * (double)su->multiplier));
|
||||
|
||||
if(accurate) {
|
||||
// no precision loss is required
|
||||
if (reversed_bytes == bytes && converted > 1.0)
|
||||
// no precision loss, this is good to use
|
||||
su_best = su;
|
||||
}
|
||||
else {
|
||||
if(converted > 1.0)
|
||||
su_best = su;
|
||||
}
|
||||
}
|
||||
|
||||
double converted = entries_round_to_resolution_dbl2(bytes, su_best->multiplier);
|
||||
|
||||
// print it either with 0, 1 or 2 fractional digits
|
||||
int written;
|
||||
if(converted == (double)((uint64_t)converted))
|
||||
written = snprintfz(dst, dst_size, "%.0f%s", converted, su_best->unit);
|
||||
else if(converted * 10.0 == (double)((uint64_t)(converted * 10.0)))
|
||||
written = snprintfz(dst, dst_size, "%.1f%s", converted, su_best->unit);
|
||||
else
|
||||
written = snprintfz(dst, dst_size, "%.2f%s", converted, su_best->unit);
|
||||
|
||||
if (written < 0)
|
||||
return -4;
|
||||
|
||||
if ((size_t)written >= dst_size)
|
||||
return (ssize_t)(dst_size - 1);
|
||||
|
||||
return written;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef LIBNETDATA_PARSERS_ENTRIES_H
|
||||
#define LIBNETDATA_PARSERS_ENTRIES_H
|
||||
|
||||
#include "parsers.h"
|
||||
|
||||
bool entries_parse(const char *entries_str, uint64_t *result, const char *default_unit);
|
||||
#define entries_parse_k(size_str, kb) size_parse(size_str, kb, "K")
|
||||
#define entries_parse_m(size_str, mb) size_parse(size_str, mb, "M")
|
||||
#define entries_parse_g(size_str, gb) size_parse(size_str, gb, "G")
|
||||
|
||||
ssize_t entries_snprintf(char *dst, size_t dst_size, uint64_t value, const char *unit, bool accurate);
|
||||
#define entries_snprintf_n(dst, dst_size, value) size_snprintf(dst, dst_size, value, "", true)
|
||||
#define entries_snprintf_k(dst, dst_size, value) size_snprintf(dst, dst_size, value, "K", true)
|
||||
#define entries_snprintf_m(dst, dst_size, value) size_snprintf(dst, dst_size, value, "M", true)
|
||||
#define entries_snprintf_g(dst, dst_size, value) size_snprintf(dst, dst_size, value, "G", true)
|
||||
|
||||
#endif //LIBNETDATA_PARSERS_ENTRIES_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef LIBNETDATA_PARSERS_ENTRIES_H
|
||||
#define LIBNETDATA_PARSERS_ENTRIES_H
|
||||
|
||||
#include "parsers.h"
|
||||
|
||||
bool entries_parse(const char *entries_str, uint64_t *result, const char *default_unit);
|
||||
#define entries_parse_k(size_str, kb) size_parse(size_str, kb, "K")
|
||||
#define entries_parse_m(size_str, mb) size_parse(size_str, mb, "M")
|
||||
#define entries_parse_g(size_str, gb) size_parse(size_str, gb, "G")
|
||||
|
||||
ssize_t entries_snprintf(char *dst, size_t dst_size, uint64_t value, const char *unit, bool accurate);
|
||||
#define entries_snprintf_n(dst, dst_size, value) size_snprintf(dst, dst_size, value, "", true)
|
||||
#define entries_snprintf_k(dst, dst_size, value) size_snprintf(dst, dst_size, value, "K", true)
|
||||
#define entries_snprintf_m(dst, dst_size, value) size_snprintf(dst, dst_size, value, "M", true)
|
||||
#define entries_snprintf_g(dst, dst_size, value) size_snprintf(dst, dst_size, value, "G", true)
|
||||
|
||||
#endif //LIBNETDATA_PARSERS_ENTRIES_H
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_LOG_FORWARDER_H
|
||||
#define NETDATA_LOG_FORWARDER_H
|
||||
|
||||
#include "../libnetdata.h"
|
||||
|
||||
typedef struct LOG_FORWARDER LOG_FORWARDER;
|
||||
|
||||
LOG_FORWARDER *log_forwarder_start(void); // done once, at spawn_server_create()
|
||||
void log_forwarder_add_fd(LOG_FORWARDER *lf, int fd); // to add a new fd
|
||||
void log_forwarder_annotate_fd_name(LOG_FORWARDER *lf, int fd, const char *cmd); // set the syslog identifier
|
||||
void log_forwarder_annotate_fd_pid(LOG_FORWARDER *lf, int fd, pid_t pid); // set the pid of the child process
|
||||
bool log_forwarder_del_and_close_fd(LOG_FORWARDER *lf, int fd); // to remove an fd
|
||||
void log_forwarder_stop(LOG_FORWARDER *lf); // done once, at spawn_server_destroy()
|
||||
|
||||
#endif //NETDATA_LOG_FORWARDER_H
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#ifndef NETDATA_LOG_FORWARDER_H
|
||||
#define NETDATA_LOG_FORWARDER_H
|
||||
|
||||
#include "../libnetdata.h"
|
||||
|
||||
typedef struct LOG_FORWARDER LOG_FORWARDER;
|
||||
|
||||
LOG_FORWARDER *log_forwarder_start(void); // done once, at spawn_server_create()
|
||||
void log_forwarder_add_fd(LOG_FORWARDER *lf, int fd); // to add a new fd
|
||||
void log_forwarder_annotate_fd_name(LOG_FORWARDER *lf, int fd, const char *cmd); // set the syslog identifier
|
||||
void log_forwarder_annotate_fd_pid(LOG_FORWARDER *lf, int fd, pid_t pid); // set the pid of the child process
|
||||
bool log_forwarder_del_and_close_fd(LOG_FORWARDER *lf, int fd); // to remove an fd
|
||||
void log_forwarder_stop(LOG_FORWARDER *lf); // done once, at spawn_server_destroy()
|
||||
|
||||
#endif //NETDATA_LOG_FORWARDER_H
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
#!/usr/bin/env python3
|
||||
#
|
||||
# Copyright: © 2021 Netdata Inc.
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import os
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
theme = localStorage.getItem('netdataTheme') || 'slate';
|
||||
}
|
||||
const overlayEl = document.getElementById('loadOverlay');
|
||||
overlayEl.innerHTML = 'netdata<br/><div style="font-size: 3vh;">Real-time performance monitoring, done right!</div>';
|
||||
overlayEl.innerHTML = 'netdata<br/><div style="font-size: 3vh;">Monitoring and troubleshooting, transformed!</div>';
|
||||
overlayEl.style = theme == 'slate' ? "background-color: #272b30; color: #373b40;" : "background-color: #fff; color: #ddd;";
|
||||
</script>
|
||||
<nav class="navbar navbar-default navbar-fixed-top" role="banner">
|
||||
|
@ -164,8 +164,7 @@
|
|||
<div class="p">
|
||||
<big><a href="https://github.com/netdata/netdata/wiki" target="_blank">Netdata</a></big>
|
||||
<br /><br />
|
||||
<i class="fas fa-copyright"></i> Copyright 2018, <a href="mailto:info@netdata.cloud">Netdata, Inc</a>.<br/>
|
||||
<i class="fas fa-copyright"></i> Copyright 2016-2018, <a href="mailto:costa@tsaousis.gr">Costa Tsaousis</a>.<br/>
|
||||
<i class="fas fa-copyright"></i> Copyright 2018-2025, <a href="mailto:info@netdata.cloud">Netdata Inc.</a>.<br/>
|
||||
</div>
|
||||
<div class="p">
|
||||
Released under <a href="http://www.gnu.org/licenses/gpl-3.0.en.html" target="_blank">GPL v3 or later</a>.
|
||||
|
@ -427,7 +426,7 @@
|
|||
Enjoy real-time performance monitoring!
|
||||
</div>
|
||||
<div class="p">
|
||||
Costa Tsaousis
|
||||
Copyright 2018-2025 Netdata Inc.
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<meta property="og:url" content="http://my-netdata.io/"/>
|
||||
<meta property="og:type" content="website"/>
|
||||
<meta property="og:site_name" content="netdata"/>
|
||||
<meta property="og:title" content="netdata - real-time performance monitoring, done right!"/>
|
||||
<meta property="og:title" content="netdata - monitoring and troubleshooting, transformed!"/>
|
||||
<meta property="og:description" content="Stunning real-time dashboards, blazingly fast and extremely interactive. Zero configuration, zero dependencies, zero maintenance." />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<meta property="og:url" content="http://my-netdata.io/"/>
|
||||
<meta property="og:type" content="website"/>
|
||||
<meta property="og:site_name" content="netdata"/>
|
||||
<meta property="og:title" content="netdata - real-time performance monitoring, done right!"/>
|
||||
<meta property="og:title" content="netdata - monitoring and troubleshooting, transformed!"/>
|
||||
<meta property="og:description" content="Stunning real-time dashboards, blazingly fast and extremely interactive. Zero configuration, zero dependencies, zero maintenance." />
|
||||
</head>
|
||||
<script type="text/javascript" src="dashboard.js?v20190902-0"></script>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<meta property="og:url" content="http://my-netdata.io/"/>
|
||||
<meta property="og:type" content="website"/>
|
||||
<meta property="og:site_name" content="netdata"/>
|
||||
<meta property="og:title" content="netdata - real-time performance monitoring, done right!"/>
|
||||
<meta property="og:title" content="netdata - monitoring and troubleshooting, transformed!"/>
|
||||
<meta property="og:description" content="Stunning real-time dashboards, blazingly fast and extremely interactive. Zero configuration, zero dependencies, zero maintenance." />
|
||||
</head>
|
||||
<script>var netdataTheme = 'slate';</script>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<meta http-equiv="Refresh" content="0; url=https://www.netdata.cloud">
|
||||
<meta charset=utf-8>
|
||||
<title>Netdata: Get control of your Linux Servers. Simple. Effective. Awesome.</title>
|
||||
<meta name=author content="Costa Tsaousis">
|
||||
<meta name=author content="Netdata Inc.">
|
||||
<meta name=description content="Unparalleled insights, in real-time, of everything happening on your Linux systems and applications, with stunning, interactive web dashboards and powerful performance and health alarms.">
|
||||
|
||||
<meta name=viewport content="width=device-width,initial-scale=1">
|
||||
|
@ -1329,30 +1329,14 @@ p {
|
|||
<div class="fb-share-button" data-href="https://my-netdata.io/" data-layout="button" data-size="small" data-mobile-iframe="true"><a class="fb-xfbml-parse-ignore" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fmy-netdata.io%2F&src=sdkpreparse" style="vertical-align:top;display:inline-block; height: 34px;">Share</a></div>
|
||||
<div class="fb-follow" data-href="https://www.facebook.com/linuxnetdata/" data-layout="standard" data-size="small" data-show-faces="false" data-colorscheme="dark" width="225" style="vertical-align:top;display:inline-block; height: 34px;"></div>
|
||||
</div>
|
||||
</p>
|
||||
<p>
|
||||
<strong>netdata</strong><br/>
|
||||
© Copyright 2018-2019, <a href="https://github.com/netdata" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=NetdataInc>Netdata</a><br/>
|
||||
© Copyright 2016-2018, <a href="https://github.com/ktsaou" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=CostaTsaousis>Costa Tsaousis</a><br/>
|
||||
© Copyright 2018-2025 <a href="https://github.com/netdata" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=NetdataInc>Netdata Inc.</a><br/>
|
||||
Released under <a href="https://github.com/netdata/netdata/blob/master/LICENSE.md" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=License>GPL v3+</a><br/>
|
||||
</p>
|
||||
</p>
|
||||
<p style="padding-top: 20px;">
|
||||
netdata has received significant contributions from:<br/> <br/>
|
||||
<a href="https://github.com/philwhineray" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=Phil>Phil Whineray</a> (release management),<br/>
|
||||
<a href="https://github.com/alonbl" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=Alon>Alon Bar-Lev</a> (autoconf and automake),<br/>
|
||||
<a href="https://github.com/titpetric" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=titpetric>Tit Petric</a> (docker image maintainer),<br/>
|
||||
<a href="https://github.com/paulfantom" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=Pawel>Paweł Krupa</a> (python.d.plugin and modules),<br/>
|
||||
<a href="https://github.com/simonnagl" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=simonnagl>simonnagl</a> (disk plugin and more),<br/>
|
||||
<a href="https://github.com/fredericopissarra" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=Frederico>Frederico Lamberti Pissarra</a> (performance improvements)<br/>
|
||||
<a href="https://github.com/vlvkobal" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=VladimirKobal>Vladimir Kobal</a> (FreeBSD port)<br/>
|
||||
<a href="https://github.com/l2isbad" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=l2isbad>Ilya Mashchenko</a> (python plugin modules)<br/>
|
||||
<br/>
|
||||
and dozens more enthusiasts, engineers and professionals.<br/> <br/>
|
||||
</p>
|
||||
</p>
|
||||
Thank you! You are awesome!
|
||||
<p>
|
||||
Thank you! You are awesome!
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<!-- SPDX-License-Identifier: GPL-3.0-or-later -->
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Netdata - Real-time performance monitoring, done right!</title>
|
||||
<title>Netdata - Monitoring and troubleshooting, transformed!</title>
|
||||
<meta name="application-name" content="netdata">
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
@ -17,7 +17,7 @@
|
|||
<meta property="og:url" content="http://my-netdata.io/"/>
|
||||
<meta property="og:type" content="website"/>
|
||||
<meta property="og:site_name" content="netdata"/>
|
||||
<meta property="og:title" content="netdata - real-time performance monitoring, done right!"/>
|
||||
<meta property="og:title" content="netdata - monitoring and troubleshooting, transformed!"/>
|
||||
<meta property="og:description" content="Stunning real-time dashboards, blazingly fast and extremely interactive. Zero configuration, zero dependencies, zero maintenance." />
|
||||
</head>
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue