summaryrefslogtreecommitdiff
path: root/examples/v3arch/twisted/agent/ntforg/trap-v1.py
diff options
context:
space:
mode:
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