From fef6965a411d94256f6995fcc126d8b25ee853dd Mon Sep 17 00:00:00 2001 From: elie Date: Mon, 14 Dec 2015 07:11:03 +0000 Subject: more fixes to trap destination --- .../asyncore/agent/ntforg/send-inform-over-ipv4-and-ipv6.py | 8 +++++--- .../asyncore/agent/ntforg/send-trap-over-ipv4-and-ipv6.py | 10 +++++----- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'examples/v1arch') diff --git a/examples/v1arch/asyncore/agent/ntforg/send-inform-over-ipv4-and-ipv6.py b/examples/v1arch/asyncore/agent/ntforg/send-inform-over-ipv4-and-ipv6.py index eba3779d..fb1ff489 100644 --- a/examples/v1arch/asyncore/agent/ntforg/send-inform-over-ipv4-and-ipv6.py +++ b/examples/v1arch/asyncore/agent/ntforg/send-inform-over-ipv4-and-ipv6.py @@ -8,12 +8,12 @@ The following script sends SNMP INFORM notification using the following options: * with community name 'public' * over IPv4/UDP and IPv6/UDP * send INFORM notification -* to a Manager at 127.0.0.1:162 and [::1]:162 +* to a Manager at 195.218.195.228:162 and [::1]:162 * with TRAP ID 'coldStart' specified as an OID The following Net-SNMP command will produce similar SNMP notification: -| $ snmpinform -v2c -c public udp:127.0.0.1 0 1.3.6.1.6.3.1.1.5.1 +| $ snmpinform -v2c -c public udp:195.218.195.228 0 1.3.6.1.6.3.1.1.5.1 | $ snmpinform -v2c -c public udp6:[::1] 0 1.3.6.1.6.3.1.1.5.1 """# @@ -67,8 +67,9 @@ transportDispatcher.registerTransport( udp.domainName, udp.UdpSocketTransport().openClientMode() ) transportDispatcher.sendMessage( - encoder.encode(trapMsg), udp.domainName, ('localhost', 162) + encoder.encode(trapMsg), udp.domainName, ('195.218.195.228', 162) ) +transportDispatcher.jobStarted(1) # UDP/IPv6 transportDispatcher.registerTransport( @@ -77,6 +78,7 @@ transportDispatcher.registerTransport( transportDispatcher.sendMessage( encoder.encode(trapMsg), udp6.domainName, ('::1', 162) ) +transportDispatcher.jobStarted(1) # Dispatcher will finish as all scheduled messages are sent transportDispatcher.runDispatcher() 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 e0be25a8..a821f86b 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 @@ -9,7 +9,7 @@ following options: * with community name 'public' * over IPv4/UDP and IPv6/UDP * send TRAP notification -* to a Manager at 127.0.0.1:162 and [::1] +* to a Manager at 195.218.195.228:162 and [::1] * with TRAP ID 'coldStart' specified as an OID * include managed objects information: * with default Uptime value @@ -18,7 +18,7 @@ following options: The following Net-SNMP commands will produce similar SNMP notification: -| $ snmptrap -v1 -c public udp:127.0.0.1 1.3.6.1.4.1.20408.4.1.1.2 127.0.0.1 1 0 12345 +| $ snmptrap -v1 -c public udp:195.218.195.228 1.3.6.1.4.1.20408.4.1.1.2 127.0.0.1 1 0 12345 | $ snmptrap -v1 -c public udp6:[::1] 1.3.6.1.4.1.20408.4.1.1.2 127.0.0.1 1 0 12345 """# @@ -51,10 +51,10 @@ transportDispatcher = AsyncoreDispatcher() # UDP/IPv4 transportDispatcher.registerTransport( udp.domainName, udp.UdpSocketTransport().openClientMode() - ) +) transportDispatcher.sendMessage( - encoder.encode(trapMsg), udp.domainName, ('localhost', 162) - ) + encoder.encode(trapMsg), udp.domainName, ('195.218.195.228', 162) +) # UDP/IPv6 transportDispatcher.registerTransport( -- cgit v1.2.1