summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2018-02-24 22:23:50 +0100
committerIlya Etingof <etingof@gmail.com>2018-02-25 00:08:01 +0100
commit0a29dd1f35da0523708e7f0bed5cd3ceb28ee538 (patch)
tree2b0739b67406d4121eb2ecd95cea0cba4819614e /examples
parentf38ae966c0ebb53a24af4f8d1484b9b01233e8ab (diff)
downloadpysnmp-git-0a29dd1f35da0523708e7f0bed5cd3ceb28ee538.tar.gz
many backward-compatibility aids dropped
Diffstat (limited to 'examples')
-rw-r--r--examples/v1arch/asyncore/agent/cmdrsp/implementing-scalar-mib-objects-over-ipv4-and-ipv6.py7
-rw-r--r--examples/v1arch/asyncore/agent/ntforg/send-trap-over-ipv4-and-ipv6.py10
-rw-r--r--examples/v1arch/asyncore/manager/cmdgen/fetch-scalar-value.py13
-rw-r--r--examples/v1arch/asyncore/manager/ntfrcv/listen-on-ipv4-and-ipv6-interfaces.py7
4 files changed, 4 insertions, 33 deletions
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: