summaryrefslogtreecommitdiffstats
path: root/collectors/ioping.plugin
diff options
context:
space:
mode:
Diffstat (limited to 'collectors/ioping.plugin')
l---------[-rw-r--r--]collectors/ioping.plugin/README.md81
-rw-r--r--collectors/ioping.plugin/integrations/ioping.md132
-rwxr-xr-xcollectors/ioping.plugin/ioping.plugin.in26
3 files changed, 155 insertions, 84 deletions
diff --git a/collectors/ioping.plugin/README.md b/collectors/ioping.plugin/README.md
index 73fc35fb..cb660f13 100644..120000
--- a/collectors/ioping.plugin/README.md
+++ b/collectors/ioping.plugin/README.md
@@ -1,80 +1 @@
-# Monitor I/O latency using ioping.plugin
-
-The ioping plugin supports monitoring I/O latency for any number of directories/files/devices, by pinging them with `ioping`.
-
-A recent version of `ioping` is required (one that supports option `-N`).
-The supplied plugin can install it, by running:
-
-```sh
-/usr/libexec/netdata/plugins.d/ioping.plugin install
-```
-
-The `-e` option can be supplied to indicate where the Netdata environment file is installed. The default path is `/etc/netdata/.environment`.
-
-The above will download, build and install the right version as `/usr/libexec/netdata/plugins.d/ioping`.
-
-Then you need to edit `/etc/netdata/ioping.conf` (to edit it on your system run
-`/etc/netdata/edit-config ioping.conf`) like this:
-
-```sh
-# uncomment the following line - it should already be there
-ioping="/usr/libexec/netdata/plugins.d/ioping"
-
-# set here the directory/file/device, you need to ping
-destination="destination"
-
-# override the chart update frequency - the default is inherited from Netdata
-update_every="1s"
-
-# the request size in bytes to ping the destination
-request_size="4k"
-
-# other iping options - these are the defaults
-ioping_opts="-T 1000000 -R"
-```
-
-## alarms
-
-Netdata will automatically attach a few alarms for each host.
-Check the [latest versions of the ioping alarms](https://raw.githubusercontent.com/netdata/netdata/master/health/health.d/ioping.conf)
-
-## Multiple ioping Plugins With Different Settings
-
-You may need to run multiple ioping plugins with different settings or different end points.
-For example, you may need to ping one destination once per 10 seconds, and another once per second.
-
-Netdata allows you to add as many `ioping` plugins as you like.
-
-Follow this procedure:
-
-**1. Create New ioping Configuration File**
-
-```sh
-# Step Into Configuration Directory
-cd /etc/netdata
-
-# Copy Original ioping Configuration File To New Configuration File
-cp ioping.conf ioping2.conf
-```
-
-Edit `ioping2.conf` and set the settings and the destination you need for the seconds instance.
-
-**2. Soft Link Original ioping Plugin to New Plugin File**
-
-```sh
-# Become root (If The Step Step Is Performed As Non-Root User)
-sudo su
-
-# Step Into The Plugins Directory
-cd /usr/libexec/netdata/plugins.d
-
-# Link ioping.plugin to ioping2.plugin
-ln -s ioping.plugin ioping2.plugin
-```
-
-That's it. Netdata will detect the new plugin and start it.
-
-You can name the new plugin any name you like.
-Just make sure the plugin and the configuration file have the same name.
-
-
+integrations/ioping.md \ No newline at end of file
diff --git a/collectors/ioping.plugin/integrations/ioping.md b/collectors/ioping.plugin/integrations/ioping.md
new file mode 100644
index 00000000..4c16d2e3
--- /dev/null
+++ b/collectors/ioping.plugin/integrations/ioping.md
@@ -0,0 +1,132 @@
+<!--startmeta
+custom_edit_url: "https://github.com/netdata/netdata/edit/master/collectors/ioping.plugin/README.md"
+meta_yaml: "https://github.com/netdata/netdata/edit/master/collectors/ioping.plugin/metadata.yaml"
+sidebar_label: "IOPing"
+learn_status: "Published"
+learn_rel_path: "Data Collection/Synthetic Checks"
+message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
+endmeta-->
+
+# IOPing
+
+
+<img src="https://netdata.cloud/img/syslog.png" width="150"/>
+
+
+Plugin: ioping.plugin
+Module: ioping.plugin
+
+<img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
+
+## Overview
+
+Monitor IOPing metrics for efficient disk I/O latency tracking. Keep track of read/write speeds, latency, and error rates for optimized disk operations.
+
+Plugin uses `ioping` command.
+
+This collector is supported on all platforms.
+
+This collector supports collecting metrics from multiple instances of this integration, including remote instances.
+
+
+### Default Behavior
+
+#### Auto-Detection
+
+This integration doesn't support auto-detection.
+
+#### Limits
+
+The default configuration for this integration does not impose any limits on data collection.
+
+#### Performance Impact
+
+The default configuration for this integration is not expected to impose a significant performance impact on the system.
+
+
+## Metrics
+
+Metrics grouped by *scope*.
+
+The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.
+
+
+
+### Per disk
+
+
+
+This scope has no labels.
+
+Metrics:
+
+| Metric | Dimensions | Unit |
+|:------|:----------|:----|
+| ioping.latency | latency | microseconds |
+
+
+
+## Alerts
+
+
+The following alerts are available:
+
+| Alert name | On metric | Description |
+|:------------|:----------|:------------|
+| [ ioping_disk_latency ](https://github.com/netdata/netdata/blob/master/health/health.d/ioping.conf) | ioping.latency | average I/O latency over the last 10 seconds |
+
+
+## Setup
+
+### Prerequisites
+
+#### Install ioping
+
+You can install the command by passing the argument `install` to the plugin (`/usr/libexec/netdata/plugins.d/ioping.plugin install`).
+
+
+
+### Configuration
+
+#### File
+
+The configuration file name for this integration is `ioping.conf`.
+
+
+You can edit the configuration file using the `edit-config` script from the
+Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md#the-netdata-config-directory).
+
+```bash
+cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
+sudo ./edit-config ioping.conf
+```
+#### Options
+
+
+
+<details><summary>Config options</summary>
+
+| Name | Description | Default | Required |
+|:----|:-----------|:-------|:--------:|
+| update_every | Data collection frequency. | 1s | False |
+| destination | The directory/file/device to ioping. | | True |
+| request_size | The request size in bytes to ioping the destination (symbolic modifiers are supported) | 4k | False |
+| ioping_opts | Options passed to `ioping` commands. | -T 1000000 | False |
+
+</details>
+
+#### Examples
+
+##### Basic Configuration
+
+This example has the minimum configuration necessary to have the plugin running.
+
+<details><summary>Config</summary>
+
+```yaml
+destination="/dev/sda"
+
+```
+</details>
+
+
diff --git a/collectors/ioping.plugin/ioping.plugin.in b/collectors/ioping.plugin/ioping.plugin.in
index 1d79eb70..d1283bad 100755
--- a/collectors/ioping.plugin/ioping.plugin.in
+++ b/collectors/ioping.plugin/ioping.plugin.in
@@ -96,6 +96,21 @@ fi
PROGRAM_NAME="$(basename "${0}")"
+LOG_LEVEL_ERR=1
+LOG_LEVEL_WARN=2
+LOG_LEVEL_INFO=3
+LOG_LEVEL="$LOG_LEVEL_INFO"
+
+set_log_severity_level() {
+ case ${NETDATA_LOG_SEVERITY_LEVEL,,} in
+ "info") LOG_LEVEL="$LOG_LEVEL_INFO";;
+ "warn" | "warning") LOG_LEVEL="$LOG_LEVEL_WARN";;
+ "err" | "error") LOG_LEVEL="$LOG_LEVEL_ERR";;
+ esac
+}
+
+set_log_severity_level
+
logdate() {
date "+%Y-%m-%d %H:%M:%S"
}
@@ -108,18 +123,21 @@ log() {
}
+info() {
+ [[ -n "$LOG_LEVEL" && "$LOG_LEVEL_INFO" -gt "$LOG_LEVEL" ]] && return
+ log INFO "${@}"
+}
+
warning() {
+ [[ -n "$LOG_LEVEL" && "$LOG_LEVEL_WARN" -gt "$LOG_LEVEL" ]] && return
log WARNING "${@}"
}
error() {
+ [[ -n "$LOG_LEVEL" && "$LOG_LEVEL_ERR" -gt "$LOG_LEVEL" ]] && return
log ERROR "${@}"
}
-info() {
- log INFO "${@}"
-}
-
fatal() {
log FATAL "${@}"
echo "DISABLE"