# Devices

The ElastiFlow Unified SNMP Collector makes it simple to add devices providing little more than an IP address, SNMP credentials and one or more Device Groups.

The location of the device definition files is specified by `EF_INPUT_SNMP_DEVICE_DEFINITIONS_DIRECTORY_PATH` in the collectors configuration options. The default location is `/etc/elastiflow/snmp/devices`.

### SNMP v1/v2c Example

**Full configuration:**

```yaml
example1.elastiflow.com:
  ip: 192.0.2.1
  port: 161
  poll_interval: 60
  timeout: 3000
  retries: 2
  exponential_timeout: false
  version: 2c
  communities:
    - public
  device_groups:
    - cisco_c1000
```

**When using the defaults:**

```yaml
example1.elastiflow.com:
  ip: 192.0.2.1
  version: 2c
  communities:
    - public
  device_groups:
    - cisco_c1000
```

#### SNMP v3 Example

**Full configuration:**

```yaml
example2.elastiflow.com:
  ip: 192.0.2.2
  port: 161
  poll_interval: 60
  timeout: 3000
  retries: 2
  exponential_timeout: false
  version: 3
  v3_credentials:
    - username: elastiflow
      authentication_protocol: sha
      authentication_passphrase: efauthpassword
      privacy_protocol: des
      privacy_passphrase: efprivpassword
  device_groups:
    - cisco_c1000
```

**When using the defaults:**

```yaml
example2.elastiflow.com:
  ip: 192.0.2.2
  version: 3
  v3_credentials:
    - username: elastiflow
      authentication_protocol: sha
      authentication_passphrase: efauthpassword
      privacy_protocol: des
      privacy_passphrase: efprivpassword
  device_groups:
    - cisco_c1000
```

### Global Device Defaults

The location of the global default device definition file is specified by `EF_INPUT_SNMP_DEFAULTS_DIRECTORY_PATH` in the collectors configuration options. The file in this directory must be named `device.yml`. The default location is `/etc/elastiflow/snmp/defaults`. This file will apply default values to every device definition where values are not provided (except the `ip` field).

#### Device Defaults Example

**Defaults file:**

```yaml
default:
  port: 200
  timeout: 4000
  retries: 4
  exponential_timeout: true
  version: 2c
  communities:
    - sith
    - lord
  device_groups:
    - generic
  poll_interval: 90
  max_oids: 64
```

**Device file:**

```yaml
mydevice:
  ip: 192.0.2.1
```

**Resulting definition:**

```yaml
mydevice:
  ip: 192.0.2.1
  port: 200
  timeout: 4000
  retries: 4
  exponential_timeout: true
  version: 2c
  communities:
    - sith
    - lord
  device_groups:
    - generic
  poll_interval: 90
  max_oids: 64
```

### Configuration Attributes

#### ip

The IP address of the device to which SNMP requests will be sent.

EXAMPLE: `ip: 192.0.2.2`

#### port (optional)

The UDP port on which the device listens for SNMP requests.

* Default
  * `161`

#### poll\_interval (optional)

The interval, in seconds, between collection of attributes applicable to the device.

* Default
  * `60`

:::info Currently only *device-level* polling intervals are supported. A future enhancement will include support for *object-level* interval override of the device-level value. :::

#### timeout (optional)

The time to wait, in milliseconds, for a response to an SNMP request.

* Default
  * `3000`

#### retries (optional)

The number of times to retry a failed SNMP request before the task is cancelled.

* Default
  * `2`

#### exponential\_timeout (optional)

Defines whether the timeout interval should remain static (`false`) for each retry, or increase exponentially (`true`).

* Default
  * `false`

#### version

Specifies the SNMP version to use when polling this device. Valid values are:

* Valid Values
  * `1`, `2c`, `3`

#### communities

If `version` is `1` or `2c` a list of communities **must** be provided. The collector will attempt to find a valid community from the list and will use that community for all subsequent polls.

EXAMPLE:

```yaml
communities:
  - public
  - elastiflow
```

#### v3\_credentials

If `version` is `3` a list of SNMPv3 credentials **must** be provided. The collector will attempt to find valid credentials from the list and will use those credentials for all subsequent polls.

EXAMPLE:

```yaml
v3_credentials:
  - username: elastiflow
    authentication_protocol: sha
    authentication_passphrase: efauthpassword
    privacy_protocol: des
    privacy_passphrase: efprivpassword
```

**username**

The username used to authenticate with the device using SNMPv3.

**authentication\_protocol**

The authentication protocol used to authenticate the username with the device using SNMPv3.

**authentication\_passphrase**

The authentication passphrase used to authenticate the username with the device using SNMPv3.

**privacy\_protocol**

The privacy protocol used to encrypt SNMPv3 traffic between the SNMP input and the device.

**privacy\_passphrase**

The privacy passphrase used to encrypt SNMPv3 traffic between the SNMP input and the device.

#### device\_groups

Defines a list of Device Groups which the Device may implement.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://elastiflow.gitbook.io/docs/unified-snmp-collector/devices.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
