From dabaef2f347a4ae0f1bc9300a3b8e19cfe28cdf9 Mon Sep 17 00:00:00 2001 From: k402xxxcenxxx Date: Sat, 15 Jul 2023 07:12:20 +0000 Subject: [PATCH 1/3] Add: in_snmp documents and links --- .gitbook.yaml | 1 + SUMMARY.md | 1 + pipeline/inputs/snmp.md | 52 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 pipeline/inputs/snmp.md diff --git a/.gitbook.yaml b/.gitbook.yaml index e8445bf16..9ef26ec31 100644 --- a/.gitbook.yaml +++ b/.gitbook.yaml @@ -24,6 +24,7 @@ redirects: input/splunk: ./pipeline/inputs/splunk.md input/serial: ./pipeline/inputs/serial-interface.md #inputs/statsd: ./pipeline/inputs/ + input/snmp: ./pipeline/inputs/snmp.md input/stdin: ./pipeline/inputs/standard-input.md input/syslog: ./pipeline/inputs/syslog.md input/systemd: ./pipeline/inputs/systemd.md diff --git a/SUMMARY.md b/SUMMARY.md index 1647717be..07b37de59 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -105,6 +105,7 @@ * [Prometheus Scrape Metrics](pipeline/inputs/prometheus-scrape-metrics.md) * [Random](pipeline/inputs/random.md) * [Serial Interface](pipeline/inputs/serial-interface.md) + * [SNMP](pipeline/inputs/snmp.md) * [Splunk](pipeline/inputs/splunk.md) * [Standard Input](pipeline/inputs/standard-input.md) * [StatsD](pipeline/inputs/statsd.md) diff --git a/pipeline/inputs/snmp.md b/pipeline/inputs/snmp.md new file mode 100644 index 000000000..edb02dfd2 --- /dev/null +++ b/pipeline/inputs/snmp.md @@ -0,0 +1,52 @@ +# SNMP + +The **snmp** input plugin allows you to collect metrics from devices by SNMP(Simple Network Management Protocal) request. + +## Configuration Parameters + +The plugin supports the following configuration parameters: + +| Key | Description | +| :--- | :--- | +| Target\_Host | The target host IP to send the request. Default: `127.0.0.1` | +| Port | The port to send the request. Default: `161` | +| Timeout | The timeout of the request in seconds. Default: `5` | +| Version | The SNMP version to use for the request, currently support `1` and `2c`. Default: `2c` | +| Community | The SNMP community setting to use for the request. Default: `public` | +| Retries |The number of retries for the request. Default: `3` | +| Oid_Type | The type of SNMP request to send, current support `get` ([snmpget](https://net-snmp.sourceforge.io/wiki/index.php/TUT:snmpget)) and `walk` ([snmpwalk](https://net-snmp.sourceforge.io/wiki/index.php/TUT:snmpwalk)). Default: `get` | +| Oid | The SNMP OID (Object Identifier) setting to use for the request.Default: `1.3.6.1.2.1.1.3.0` (System up time) | + +## Getting Started + +You can run the plugin from the command line or through the configuration file: + +### Command Line + +```bash +$ fluent-bit -i snmp -o stdout +Fluent Bit v2.x.x +* Copyright (C) 2015-2022 The Fluent Bit Authors +* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd +* https://fluentbit.io +[0] snmp.test: [[1689404515.194358800, {}], {"iso.3.6.1.2.1.1.3.0"=>"58"}] +[0] snmp.test: [[1689404516.194328000, {}], {"iso.3.6.1.2.1.1.3.0"=>"59"}] +``` + +### Configuration File + +In your main configuration file append the following _Input_ & _Output_ sections: + +```python +[INPUT] + Name snmp + Tag snmp.test + Target_Host 192.168.0.1 + Community public + Oid_Type get + Oid 1.3.6.1.2.1.1.3.0 + +[OUTPUT] + Name stdout + Match * +``` From 246df1e39275a1a34e062d15b78d33f6a7426bb9 Mon Sep 17 00:00:00 2001 From: Lynette Miles <6818907+esmerel@users.noreply.github.com> Date: Thu, 23 Oct 2025 11:16:57 -0700 Subject: [PATCH 2/3] Apply suggestions from code review Signed-off-by: Lynette Miles <6818907+esmerel@users.noreply.github.com> --- pipeline/inputs/snmp.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/pipeline/inputs/snmp.md b/pipeline/inputs/snmp.md index edb02dfd2..0ea1c9682 100644 --- a/pipeline/inputs/snmp.md +++ b/pipeline/inputs/snmp.md @@ -1,27 +1,27 @@ # SNMP -The **snmp** input plugin allows you to collect metrics from devices by SNMP(Simple Network Management Protocal) request. +The _SNMP_ input plugin lets you collect metrics from devices by SNMP (Simple Network Management Protocol) request. -## Configuration Parameters +## Configuration parameters The plugin supports the following configuration parameters: -| Key | Description | -| :--- | :--- | -| Target\_Host | The target host IP to send the request. Default: `127.0.0.1` | -| Port | The port to send the request. Default: `161` | -| Timeout | The timeout of the request in seconds. Default: `5` | -| Version | The SNMP version to use for the request, currently support `1` and `2c`. Default: `2c` | -| Community | The SNMP community setting to use for the request. Default: `public` | -| Retries |The number of retries for the request. Default: `3` | -| Oid_Type | The type of SNMP request to send, current support `get` ([snmpget](https://net-snmp.sourceforge.io/wiki/index.php/TUT:snmpget)) and `walk` ([snmpwalk](https://net-snmp.sourceforge.io/wiki/index.php/TUT:snmpwalk)). Default: `get` | -| Oid | The SNMP OID (Object Identifier) setting to use for the request.Default: `1.3.6.1.2.1.1.3.0` (System up time) | +| Key | Description | Default | +| :--- | :--- | :--- | +| `Target_Host` | The target host IP to send the request. | `127.0.0.1` | +| `Port` | The port to send the request. | `161` | +| `Timeout` | The timeout of the request in seconds. | `5` | +| `Version` | The SNMP version to use for the request. Supported versions: `1` and `2c`. | `2c` | +| `Community` | The SNMP community setting to use for the request. | `public` | +| `Retries` |The number of retries for the request. | `3` | +| `Oid_Type` | The type of SNMP request to send, current support `get` ([snmpget](https://net-snmp.sourceforge.io/wiki/index.php/TUT:snmpget)) and `walk` ([snmpwalk](https://net-snmp.sourceforge.io/wiki/index.php/TUT:snmpwalk)). | `get` | +| `Oid` | The SNMP OID (Object Identifier) setting to use for the request. | `1.3.6.1.2.1.1.3.0` (System up time) | -## Getting Started +## Get started You can run the plugin from the command line or through the configuration file: -### Command Line +### Command line ```bash $ fluent-bit -i snmp -o stdout @@ -33,9 +33,9 @@ Fluent Bit v2.x.x [0] snmp.test: [[1689404516.194328000, {}], {"iso.3.6.1.2.1.1.3.0"=>"59"}] ``` -### Configuration File +### Configuration file -In your main configuration file append the following _Input_ & _Output_ sections: +In your main configuration file append the following sections: ```python [INPUT] From 8b0769c65f753885aaf7b8e3e191c4eb814c01b2 Mon Sep 17 00:00:00 2001 From: Lynette Miles <6818907+esmerel@users.noreply.github.com> Date: Thu, 23 Oct 2025 12:37:56 -0700 Subject: [PATCH 3/3] Update pipeline/inputs/snmp.md hopefully this fixes come of the vale warnings. Signed-off-by: Lynette Miles <6818907+esmerel@users.noreply.github.com> --- pipeline/inputs/snmp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipeline/inputs/snmp.md b/pipeline/inputs/snmp.md index 0ea1c9682..042e09b65 100644 --- a/pipeline/inputs/snmp.md +++ b/pipeline/inputs/snmp.md @@ -1,6 +1,6 @@ # SNMP -The _SNMP_ input plugin lets you collect metrics from devices by SNMP (Simple Network Management Protocol) request. +The _SNMP_ input plugin lets you collect metrics from devices by Simple Network Management Protocol (SNMP) request. ## Configuration parameters