From 0a29dd1f35da0523708e7f0bed5cd3ceb28ee538 Mon Sep 17 00:00:00 2001 From: Ilya Etingof Date: Sat, 24 Feb 2018 22:23:50 +0100 Subject: many backward-compatibility aids dropped --- .../implementing-scalar-mib-objects-over-ipv4-and-ipv6.py | 7 +------ .../asyncore/agent/ntforg/send-trap-over-ipv4-and-ipv6.py | 10 +--------- .../v1arch/asyncore/manager/cmdgen/fetch-scalar-value.py | 13 +------------ .../manager/ntfrcv/listen-on-ipv4-and-ipv6-interfaces.py | 7 +------ 4 files changed, 4 insertions(+), 33 deletions(-) (limited to 'examples') diff --git a/examples/v1arch/asyncore/agent/cmdrsp/implementing-scalar-mib-objects-over-ipv4-and-ipv6.py b/examples/v1arch/asyncore/agent/cmdrsp/implementing-scalar-mib-objects-over-ipv4-and-ipv6.py index 328e5d28..03affa96 100644 --- a/examples/v1arch/asyncore/agent/cmdrsp/implementing-scalar-mib-objects-over-ipv4-and-ipv6.py +++ b/examples/v1arch/asyncore/agent/cmdrsp/implementing-scalar-mib-objects-over-ipv4-and-ipv6.py @@ -20,7 +20,7 @@ with Command Generators - UDP over IPv4 and UDP over IPv6. """# from pysnmp.carrier.asyncore.dispatch import AsyncoreDispatcher -from pysnmp.carrier.asyncore.dgram import udp, udp6, unix +from pysnmp.carrier.asyncore.dgram import udp, udp6 from pyasn1.codec.ber import encoder, decoder from pysnmp.proto import api import time, bisect @@ -150,11 +150,6 @@ transportDispatcher.registerTransport( udp6.domainName, udp6.Udp6SocketTransport().openServerMode(('::1', 161)) ) -## Local domain socket -# transportDispatcher.registerTransport( -# unix.domainName, unix.UnixSocketTransport().openServerMode('/tmp/snmp-agent') -# ) - transportDispatcher.jobStarted(1) try: diff --git a/examples/v1arch/asyncore/agent/ntforg/send-trap-over-ipv4-and-ipv6.py b/examples/v1arch/asyncore/agent/ntforg/send-trap-over-ipv4-and-ipv6.py index 695adc2e..032a9e5b 100644 --- a/examples/v1arch/asyncore/agent/ntforg/send-trap-over-ipv4-and-ipv6.py +++ b/examples/v1arch/asyncore/agent/ntforg/send-trap-over-ipv4-and-ipv6.py @@ -23,7 +23,7 @@ The following Net-SNMP commands will produce similar SNMP notification: """# from pysnmp.carrier.asyncore.dispatch import AsyncoreDispatcher -from pysnmp.carrier.asyncore.dgram import udp, udp6, unix +from pysnmp.carrier.asyncore.dgram import udp, udp6 from pyasn1.codec.ber import encoder from pysnmp.proto import api @@ -64,14 +64,6 @@ transportDispatcher.sendMessage( encoder.encode(trapMsg), udp6.domainName, ('::1', 162) ) -## Local domain socket -# transportDispatcher.registerTransport( -# unix.domainName, unix.UnixSocketTransport().openClientMode() -# ) -# transportDispatcher.sendMessage( -# encoder.encode(trapMsg), unix.domainName, '/tmp/snmp-manager' -# ) - # Dispatcher will finish as all scheduled messages are sent transportDispatcher.runDispatcher() diff --git a/examples/v1arch/asyncore/manager/cmdgen/fetch-scalar-value.py b/examples/v1arch/asyncore/manager/cmdgen/fetch-scalar-value.py index 9dd8fcc4..fd93e343 100644 --- a/examples/v1arch/asyncore/manager/cmdgen/fetch-scalar-value.py +++ b/examples/v1arch/asyncore/manager/cmdgen/fetch-scalar-value.py @@ -15,7 +15,7 @@ This script performs similar to the following Net-SNMP command: """# from pysnmp.carrier.asyncore.dispatch import AsyncoreDispatcher -from pysnmp.carrier.asyncore.dgram import udp, udp6, unix +from pysnmp.carrier.asyncore.dgram import udp, udp6 from pyasn1.codec.ber import encoder, decoder from pysnmp.proto import api from time import time @@ -92,17 +92,6 @@ transportDispatcher.jobStarted(1) # ) # transportDispatcher.jobStarted(1) -## Local domain socket -# transportDispatcher.registerTransport( -# unix.domainName, unix.UnixSocketTransport().openClientMode() -# ) -# -# Pass message to dispatcher -# transportDispatcher.sendMessage( -# encoder.encode(reqMsg), unix.domainName, '/tmp/snmp-agent' -# ) -# transportDispatcher.jobStarted(1) - # Dispatcher will finish as job#1 counter reaches zero transportDispatcher.runDispatcher() diff --git a/examples/v1arch/asyncore/manager/ntfrcv/listen-on-ipv4-and-ipv6-interfaces.py b/examples/v1arch/asyncore/manager/ntfrcv/listen-on-ipv4-and-ipv6-interfaces.py index 6a8cf024..7043b22d 100644 --- a/examples/v1arch/asyncore/manager/ntfrcv/listen-on-ipv4-and-ipv6-interfaces.py +++ b/examples/v1arch/asyncore/manager/ntfrcv/listen-on-ipv4-and-ipv6-interfaces.py @@ -21,7 +21,7 @@ with Notification Originators - UDP over IPv4 and UDP over IPv6. """# from pysnmp.carrier.asyncore.dispatch import AsyncoreDispatcher -from pysnmp.carrier.asyncore.dgram import udp, udp6, unix +from pysnmp.carrier.asyncore.dgram import udp, udp6 from pyasn1.codec.ber import decoder from pysnmp.proto import api @@ -73,11 +73,6 @@ transportDispatcher.registerTransport( udp6.domainName, udp6.Udp6SocketTransport().openServerMode(('::1', 162)) ) -## Local domain socket -# transportDispatcher.registerTransport( -# unix.domainName, unix.UnixSocketTransport().openServerMode('/tmp/snmp-manager') -# ) - transportDispatcher.jobStarted(1) try: -- cgit v1.2.1