diff options
author | Rich Bennett <rb2745@att.com> | 2018-08-25 10:43:15 -0400 |
---|---|---|
committer | Rich Bennett <rb2745@att.com> | 2018-09-11 13:09:28 +0000 |
commit | 9847631e1be786f37aef897d4216b6bc2bfa16a2 (patch) | |
tree | ce8f32126f8cbd25ee51b00b877416508207b720 /docs/sections/services/snmptrap/offeredapis.rst | |
parent | ebc5d2abb27beac64cadd00f0fdb1be64c62c9e7 (diff) |
Add RST Files for SNMPTRAP
Submitting RST files from abandoned
patch https://gerrit.onap.org/r/57071
With updates to remove sphinx warnings
Change-Id: I18da62f59943bb932bcfdd6bddfc9164d8ae9b93
Issue-ID: DCAEGEN2-624
Signed-off-by: Rich Bennett <rb2745@att.com>
Diffstat (limited to 'docs/sections/services/snmptrap/offeredapis.rst')
-rw-r--r-- | docs/sections/services/snmptrap/offeredapis.rst | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/docs/sections/services/snmptrap/offeredapis.rst b/docs/sections/services/snmptrap/offeredapis.rst new file mode 100644 index 00000000..e9a8afeb --- /dev/null +++ b/docs/sections/services/snmptrap/offeredapis.rst @@ -0,0 +1,61 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +Offered APIs +============ + +**SNMPTRAP** supports the Simple Network Management Protocol (SNMP) +standard. It is a well documented and pervasive protocol, +used in all networks worldwide. + +As an API offering, the only way to interact with **SNMPTRAP** is +to send traps that conform to the industry standard specification +(RFC1215 - available at https://tools.ietf.org/html/rfc1215 ) to a +running instance. To accomplish this, you may: + +1. Configure SNMP agents to send native traps to a SNMPTRAP instance. + In SNMP agent configurations, this is usually accomplished by + setting the "trap target" or "snmp manager" to the IP address + of the running VM/container hosting SNMPTRAP. + +2. Mimic a SNMP trap using various freely available utilities. Two + examples are provided below, be sure to change the target + ("localhost") and port ("162") to applicable values in your + environment. + +Net-SNMP +-------- + +.. code-block:: bash + + snmptrap -d -v 1 -c public ${to_ip_address}:${to_portt} .1.3.6.1.4.1.99999 localhost 6 1 '55' .1.11.12.13.14.15 s "test trap" + +.. note:: + + This will display some "read_config_store open failure" errors; + they can be ignored, the trap has successfully been sent to the + specified destination. + +pysnmp +------ + +.. code-block:: python + + from pysnmp.hlapi import * + from pysnmp import debug + + # debug.setLogger(debug.Debug('msgproc')) + + errorIndication, errorStatus, errorIndex, varbinds = next(sendNotification(SnmpEngine(), + CommunityData('not_public'), + UdpTransportTarget(('localhost', 162)), + ContextData(), + 'trap', + [ObjectType(ObjectIdentity('.1.3.6.1.4.1.999.1'), OctetString('test trap - ignore')), + ObjectType(ObjectIdentity('.1.3.6.1.4.1.999.2'), OctetString('ONAP pytest trap'))]) + ) + + if errorIndication: + print(errorIndication) + else: + print("successfully sent first trap example, number %d" % i) |