summaryrefslogtreecommitdiffstats
path: root/docs/sections/services/snmptrap/offeredapis.rst
diff options
context:
space:
mode:
authorHansen, Tony (th1395) <th1395@att.com>2023-05-23 21:27:17 +0000
committerHansen, Tony (th1395) <th1395@att.com>2023-05-31 21:01:29 +0000
commit663df2c1b8d9176094a62b00b7e80de096180621 (patch)
tree849841dc428fcfba07d9c39494f95ccd1f25da8a /docs/sections/services/snmptrap/offeredapis.rst
parentbcd436a1be4fbe2c8ad7ce074d86b94b8ff44f4e (diff)
clean up some sphinx warnings
Change-Id: I8c2d925e8b27b4740227af0be3ab5d6f7153ec38 Signed-off-by: Hansen, Tony (th1395) <th1395@att.com> Issue-ID: DCAEGEN2-3399 Signed-off-by: Hansen, Tony (th1395) <th1395@att.com> Signed-off-by: Vijay Venkatesh Kumar <vv770d@att.com> Signed-off-by: Hansen, Tony (th1395) <th1395@att.com>
Diffstat (limited to 'docs/sections/services/snmptrap/offeredapis.rst')
-rw-r--r--docs/sections/services/snmptrap/offeredapis.rst18
1 files changed, 10 insertions, 8 deletions
diff --git a/docs/sections/services/snmptrap/offeredapis.rst b/docs/sections/services/snmptrap/offeredapis.rst
index fabaff5f..f5841dee 100644
--- a/docs/sections/services/snmptrap/offeredapis.rst
+++ b/docs/sections/services/snmptrap/offeredapis.rst
@@ -27,10 +27,10 @@ running instance. To accomplish this, you may:
NetSNMP snmptrap
----------------
-One way to simulate an arriving SNMP trap is to use the Net-SNMP utility/command snmptrap.
+One way to simulate an arriving SNMP trap is to use the Net-SNMP utility/command snmptrap.
This command can send V1, V2c or V3 traps to a manager based on the parameters provided.
-The example below sends a SNMP V1 trap to the specified host. Prior to running this command, export
+The example below sends a SNMP V1 trap to the specified host. Prior to running this command, export
the values of *to_ip_address* (set it to the IP of the VM hosting the ONAP trapd container) and *to_port* (typically
set to "162"):
@@ -52,18 +52,18 @@ python using pysnmp
-------------------
Another way to simulate an arriving SNMP trap is to send one with the python *pysnmp* module. (Note that this
-is the same module that ONAP trapd is based on).
+is the same module that ONAP trapd is based on).
-To do this, create a python script called "send_trap.py" with the following contents. You'll need to change the
+To do this, create a python script called "send_trap.py" with the following contents. You'll need to change the
target (from "localhost" to whatever the destination IP/hostname of the trap receiver is) before saving:
.. 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)),
@@ -72,7 +72,7 @@ target (from "localhost" to whatever the destination IP/hostname of the trap rec
[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:
@@ -80,4 +80,6 @@ target (from "localhost" to whatever the destination IP/hostname of the trap rec
To run the pysnmp example:
- ``python ./send_trap.py``
+.. code-block:: bash
+
+ python ./send_trap.py