summaryrefslogtreecommitdiff
path: root/examples/v3arch/twisted/agent/ntforg/trap-v1.py
diff options
context:
space:
mode:
authorelie <elie>2015-09-14 05:20:24 +0000
committerelie <elie>2015-09-14 05:20:24 +0000
commit2f24177c361ba4d9deba2d7378f84aa96111db80 (patch)
tree383c282bfe661bef3eaf16077946124c0039d9ab /examples/v3arch/twisted/agent/ntforg/trap-v1.py
parent4397ac4bd10b626aa9355cf04ee0cdb410fe6030 (diff)
downloadpysnmp-2f24177c361ba4d9deba2d7378f84aa96111db80.tar.gz
* synchronous oneliner apps redesigned to offer Python generator-based
API along with a more comprehensive set of accepted parameters. * massively documented (in Sphinx, NumPy style)
Diffstat (limited to 'examples/v3arch/twisted/agent/ntforg/trap-v1.py')
-rw-r--r--examples/v3arch/twisted/agent/ntforg/trap-v1.py42
1 files changed, 24 insertions, 18 deletions
diff --git a/examples/v3arch/twisted/agent/ntforg/trap-v1.py b/examples/v3arch/twisted/agent/ntforg/trap-v1.py
index 6863e0d..587314a 100644
--- a/examples/v3arch/twisted/agent/ntforg/trap-v1.py
+++ b/examples/v3arch/twisted/agent/ntforg/trap-v1.py
@@ -1,21 +1,27 @@
-#
-# Notification Originator
-#
-# Send SNMP notification using the following options:
-#
-# * SNMPv1
-# * with community name 'public'
-# * over IPv4/UDP
-# * using Twisted framework for network transport
-# * to a Manager at 127.0.0.1:162
-# * send TRAP notification
-# * with TRAP ID 'coldStart' specified as an OID
-# * include managed objects information:
-# * overriding Uptime value with 12345
-# * overriding Agent Address with '127.0.0.1'
-# * overriding Enterprise OID with 1.3.6.1.4.1.20408.4.1.1.2
-# * include managed object information '1.3.6.1.2.1.1.1.0' = 'my system'
-#
+"""
+SNMPv1 TRAP
++++++++++++
+
+Send SNMP notification using the following options:
+
+* SNMPv1
+* with community name 'public'
+* over IPv4/UDP
+* using Twisted framework for network transport
+* to a Manager at 127.0.0.1:162
+* send TRAP notification
+* with TRAP ID 'coldStart' specified as an OID
+* include managed objects information:
+* overriding Uptime value with 12345
+* overriding Agent Address with '127.0.0.1'
+* overriding Enterprise OID with 1.3.6.1.4.1.20408.4.1.1.2
+* include managed object information '1.3.6.1.2.1.1.1.0' = 'my system'
+
+Functionally similar to:
+
+| $ snmptrap -v1 -c public 127.0.0.1 1.3.6.1.4.1.20408.4.1.1.2 127.0.0.1 6 432 12345 1.3.6.1.2.1.1.1.0 s 'my system'
+
+"""#
from twisted.internet import reactor
from pysnmp.entity import engine, config
from pysnmp.carrier.twisted.dgram import udp