1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
7 An environment suitable for running docker containers is recommended.
8 If that is not available, SNMPTRAP source can be downloaded and run
9 in a VM or on baremetal.
11 Both scenarios are documented below.
16 **trapd** is delivered as a docker container based on python 3.6. The
17 host or VM that will run this container must have the docker application
18 loaded and available to the userID that will be running the SNMPTRAP container.
20 If running from a docker container, it is assumed that *Config
21 Binding Service* has been installed and is successfully providing valid
22 configuration assets to instantiated containers as needed.
24 Also required is a working DMAAP/MR environment. trapd
25 publishes traps to DMAAP/MR as JSON messages and expects the host
26 resources and publishing credentials to be included in the *Config Binding Service*
32 The following command will download the latest trapd container from
33 nexus and launch it in the container named "trapd":
35 ``docker run --detach -t --rm -p 162:6162/udp -P --name=trapd nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.snmptrap:2.0.3 ./bin/snmptrapd.sh start``
37 Running an instance of **trapd** will result in arriving traps being published
38 to the topic specified by Config Binding Services.
43 **trapd** can also be run outside of a container environment, without CBS interactions.
44 If CBS is not present, SNMPTRAP will look for a JSON configuration file specified via the
45 environment variable CBS_SIM_JSON at startup. Location of this file should be specified
46 as a relative path from the <SNMPTRAP base directory>/bin directory. E.g.
54 trapd requires the following to run in a non-docker environment:
57 - Python module “pysnmp” 4.4.5
58 - Python module “requests” 2.18.3
60 To install prerequisites:
62 ``export PATH=<path to Python 3.6 binary>:$PATH``
64 ``pip3 install requests==2.18.3``
66 ``pip3 install pysnmp==4.4.5``
68 Download latest trapd version from Gerrit
69 """""""""""""""""""""""""""""""""""""""""
71 Download a copy of the latest trapd image from gerrit in it's standard runtime location:
75 ``git clone ssh://<your linux foundation id>@gerrit.onap.org:29418/dcaegen2/collectors/snmptrap snmptrap``
80 ``mv /opt/app/snmptrap/snmptrap /opt/app/snmptrap/bin``
82 Configure for your environment
83 """"""""""""""""""""""""""""""
85 In a non-docker environment, ONAP trapd is controlled by a locally hosted JSON configuration file. It is
86 referenced in the trapd startup script as:
90 CBS_SIM_JSON=../etc/snmptrapd.json
93 This file should be in the exact same format is the response from CBS in a fully implemented container/controller environment. A sample file is included with source/container images, at:
97 /opt/app/snmptrap/etc/snmptrapd.json
99 Make applicable changes to this file - typically things that will need to change include:
103 "topic_url": "http://localhost:3904/events/ONAP-COLLECTOR-SNMPTRAP"
105 Action: Change 'localhost' and topic name (ONAP-COLLECTOR-SNMPTRAP) to desired values in your environment.
109 "snmpv3_config" (needed only when SNMPv3 agents are present)
111 Action: Add/delete/modify entries as needed to align with SNMP agent configurations in a SNMPv3 environment.
113 Start the application
114 """""""""""""""""""""
116 ``nohup /opt/app/snmptrap/bin/snmptrapd.sh start > /opt/app/snmptrap/logs/snmptrapd.out 2>&1 &``