---
title: "SNMP Traps Collector"
description: ""
url: "https://docs.itrsgroup.com/docs/opsview/6.11.7/administration/distributing-functionality/snmp-traps-collector/index.html"
---
SNMP Traps Collector will:

- Wait on the `/opt/opsview/snmptraps/var/run/snmp` FIFO and once a trap is received, it reads it and processes it via the traps processing library available with `opsview-snmptraps-base`.
- Process a trap by either sending a result to the results forwarder FIFO, or send an exception to the `snmp-traps-exception-queue`.
- Manage the starting and stopping of traces set on a host, running the trace for the given duration in minutes or hours (up to a maximum of 48 hours).
- Read messages from the `snmptrace-request-<machine-ref>` queue and sends messages to the `orchestrator-queue` and `snmp-traps-exception-queue`.

## Dependencies

- The package requires `opsview-datastore` to be installed on the collector so that it can create trace documents.
- The package requires access to the `opsview-messagequeue` to send traces and exceptions to the `result-snmp`.
- The package requires access to the `opsview-messagequeue` to receive trace request message from the orchestrator.

## Installation

This is deployed when installing Opsview Monitor.

See [MIBs for SNMP Traps and Gets](https://docs.itrsgroup.com/docs/opsview/6.11.7/troubleshooting/mibs-for-snmp-traps-and-gets/index.html) to add MIBs that are required for translating SNMP Traps.

## Configuration

Configuration options available for the component:

- The default configuration file is available in `/opt/opsview/snmptrapscollector/etc/snmptrapscollector.defaults.yaml`.
- The user can provide their configs in the same locations as above in the file named `snmptrapscollector.yaml`
- The defaults config file:

```
---
# This is the default configuration file.
# Please only make configuration changes in "snmptrapscollector.yaml".
#
snmptrapscollector:
    queue_max_size: 0
    worker_timeout_secs: 30
    snmptrapstrace_channel_timeout: 10
    orchestrator_reply_delay_secs: 10
    traps_fifo: /opt/opsview/snmptraps/var/run/snmp
    results_fifo: /opt/opsview/var/results.sock
    snmp_config_file: snmptraps.cfg
    script: /opt/opsview/snmptrapsbase/bin/snmptrap2opsview
    local_message_queue: &local_message_queue
        provider: rabbitmq
        encoder: aes
        encoder_key: ZHVtbXllbmNvZGVya2V5MTIzNA==
        host: 127.0.0.1
        port: 35672
        management_port: 45672
        user: opsview
        password: opsview
    snmptrapsexception:
        queue: snmp-traps-exception-queue
        messagequeue: *local_message_queue
        durable: true
    snmptrapstrace:
        queue: snmptraptrace-exchange:direct.snmptrace-request-@:?
        messagequeue: *local_message_queue
        durable: true
    orchestrator:
        queue: orchestrator-queue
        messagequeue: *local_message_queue
        durable: true
    registry:
        provider: etcd
        host: 127.0.0.1
        port: 12379
    datastore:
        name: opsview-collector
        cache: opsviewcache,max_age=5;max_size=10
        connection:
            provider: couchhttp
            host: 127.0.0.1
            port: 15984
            user: opsview
            password: opsview
```

## Management

### Managing the component

The command to start, stop and restart the component is:

```
$ sudo /opt/opsview/watchdog/bin/opsview-monit <start|stop|restart> opsview-snmptrapscollector
```

The component logs to syslog like all other components. Note that you may see errors in syslog regarding `No such file or directory: "/opt/opsview/snmptrapscollector/var/conf/snmptraps.cfg"` until the first SNMP Trap rule is associated with a host and [Apply Changes](https://docs.itrsgroup.com/docs/opsview/6.11.7/configuration/apply-changes/index.html) is performed.


