Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in_snmp: Add documentation for input SNMP plugin #1162

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
52 changes: 52 additions & 0 deletions pipeline/inputs/snmp.md
Original file line number Diff line number Diff line change
@@ -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 *
```