summaryrefslogtreecommitdiff
path: root/examples/v3arch/twisted/agent/ntforg/inform-v2c.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/inform-v2c.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/inform-v2c.py')
-rw-r--r--examples/v3arch/twisted/agent/ntforg/inform-v2c.py38
1 files changed, 22 insertions, 16 deletions
diff --git a/examples/v3arch/twisted/agent/ntforg/inform-v2c.py b/examples/v3arch/twisted/agent/ntforg/inform-v2c.py
index 95ba561..77245fe 100644
--- a/examples/v3arch/twisted/agent/ntforg/inform-v2c.py
+++ b/examples/v3arch/twisted/agent/ntforg/inform-v2c.py
@@ -1,19 +1,25 @@
-#
-# Notification Originator
-#
-# Send SNMP INFORM notification using the following options:
-#
-# * SNMPv2c
-# * with community name 'public'
-# * over IPv4/UDP
-# * using Twisted framework for network transport
-# * send INFORM notification
-# * to a Manager at 127.0.0.1:162
-# * with TRAP ID 'coldStart' specified as an OID
-# * include managed objects information:
-# 1.3.6.1.2.1.1.1.0 = 'Example Notificator'
-# 1.3.6.1.2.1.1.5.0 = 'Notificator Example'
-#
+"""
+SNMPv2c INFORM
+++++++++++++++
+
+Send SNMP INFORM notification using the following options:
+
+* SNMPv2c
+* with community name 'public'
+* over IPv4/UDP
+* using Twisted framework for network transport
+* send INFORM notification
+* to a Manager at 127.0.0.1:162
+* with TRAP ID 'coldStart' specified as an OID
+* include managed objects information:
+ * 1.3.6.1.2.1.1.1.0 = 'Example Notificator'
+ * 1.3.6.1.2.1.1.5.0 = 'Notificator Example'
+
+Functionally similar to:
+
+| $ snmpinform -v2c -c public 127.0.0.2 0 1.3.6.1.6.3.1.1.5.1 1.3.6.1.2.1.1.1.0 s 'Example notification' 1.3.6.1.2.1.1.5.0 s 'Notificator Example'
+
+"""#
from twisted.internet import reactor
from pysnmp.entity import engine, config
from pysnmp.carrier.twisted.dgram import udp