From dabaef2f347a4ae0f1bc9300a3b8e19cfe28cdf9 Mon Sep 17 00:00:00 2001 From: k402xxxcenxxx Date: Sat, 15 Jul 2023 07:12:20 +0000 Subject: [PATCH] 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 * +```