From 2f24177c361ba4d9deba2d7378f84aa96111db80 Mon Sep 17 00:00:00 2001 From: elie Date: Mon, 14 Sep 2015 05:20:24 +0000 Subject: * 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) --- .../manager/ntfrcv/v2c-multiple-interfaces.py | 39 ++++++++++++---------- 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'examples/v3arch/twisted/manager/ntfrcv/v2c-multiple-interfaces.py') diff --git a/examples/v3arch/twisted/manager/ntfrcv/v2c-multiple-interfaces.py b/examples/v3arch/twisted/manager/ntfrcv/v2c-multiple-interfaces.py index 4f9b68f..b7edf7d 100644 --- a/examples/v3arch/twisted/manager/ntfrcv/v2c-multiple-interfaces.py +++ b/examples/v3arch/twisted/manager/ntfrcv/v2c-multiple-interfaces.py @@ -1,21 +1,24 @@ -# -# Notification Receiver -# -# Receive SNMP TRAP/INFORM messages with the following options: -# -# * SNMPv1/SNMPv2c -# * with SNMP community "public" -# * over IPv4/UDP, listening at 127.0.0.1:162 -# over IPv4/UDP, listening at 127.0.0.1:2162 -# * using Twisted framework for network transport -# * print received data on stdout -# -# Either of the following Net-SNMP's commands will send notifications to this -# receiver: -# -# $ snmptrap -v2c -c public 127.0.0.1:162 123 1.3.6.1.6.3.1.1.5.1 1.3.6.1.2.1.1.5.0 s test -# $ snmpinform -v2c -c public 127.0.0.1:2162 123 1.3.6.1.6.3.1.1.5.1 -# +""" +Serving multiple network interfaces ++++++++++++++++++++++++++++++++++++ + +Receive SNMP TRAP/INFORM messages with the following options: + +* SNMPv1/SNMPv2c +* with SNMP community "public" +* listen on two local network interfaces: + * IPv4/UDP, listening at 127.0.0.1:162 + * IPv4/UDP, listening at 127.0.0.1:2162 +* using Twisted framework for network transport +* print received data on stdout + +Either of the following Net-SNMP commands will send notifications to this +receiver: + +| $ snmptrap -v2c -c public 127.0.0.1:162 123 1.3.6.1.6.3.1.1.5.1 1.3.6.1.2.1.1.5.0 s test +| $ snmpinform -v2c -c public 127.0.0.1:2162 123 1.3.6.1.6.3.1.1.5.1 + +"""# from twisted.internet import reactor from pysnmp.entity import engine, config from pysnmp.carrier.twisted.dgram import udp -- cgit v1.2.1