diff options
author | elie <elie> | 2015-12-19 21:07:51 +0000 |
---|---|---|
committer | elie <elie> | 2015-12-19 21:07:51 +0000 |
commit | 986c0a7f581a8966f156ab609998a9908d2a69c0 (patch) | |
tree | 2da1d669f38b6e0e1f709b8c25d165bc477abe98 | |
parent | 10a43697b989a7c960c81c1b6b9180e9f4143ff7 (diff) | |
download | pysnmp-git-986c0a7f581a8966f156ab609998a9908d2a69c0.tar.gz |
notification origination examples debugged and adjusted to work
with demo.snmplabs.com out-of-the-box
26 files changed, 51 insertions, 111 deletions
diff --git a/examples/hlapi/asyncio/agent/ntforg/default-v1-trap.py b/examples/hlapi/asyncio/agent/ntforg/default-v1-trap.py index e11fbc90..e670c915 100644 --- a/examples/hlapi/asyncio/agent/ntforg/default-v1-trap.py +++ b/examples/hlapi/asyncio/agent/ntforg/default-v1-trap.py @@ -17,13 +17,8 @@ using the following options: Functionally similar to: -| $ snmptrap -v1 -c public demo.snmplabs.com \ -| 1.3.6.1.4.1.20408.4.1.1.2 \ -| 0.0.0.0 \ -| 1 \ -| 0 \ -| 0 -| '1.3.6.1.2.1.1.1.0' s 'my system' +| $ snmptrap -v1 -c public demo.snmplabs.com 1.3.6.1.4.1.20408.4.1.1.2 0.0.0.0 1 0 0 '1.3.6.1.2.1.1.1.0' s 'my system' +| """# import asyncio diff --git a/examples/hlapi/asyncio/agent/ntforg/multiple-notifications-at-once.py b/examples/hlapi/asyncio/agent/ntforg/multiple-notifications-at-once.py index 7907b3c3..5dfdfdbc 100644 --- a/examples/hlapi/asyncio/agent/ntforg/multiple-notifications-at-once.py +++ b/examples/hlapi/asyncio/agent/ntforg/multiple-notifications-at-once.py @@ -45,6 +45,11 @@ def sendone(snmpEngine, hostname, notifyType): if errorIndication: print(errorIndication) + elif errorStatus: + print('%s: at %s' % (errorStatus.prettyPrint(), errorIndex and varBinds[int(errorIndex)-1][0] or '?')) + else: + for varBind in varBinds: + print(' = '.join([x.prettyPrint() for x in varBind])) snmpEngine = SnmpEngine() diff --git a/examples/hlapi/asyncore/agent/ntforg/default-v1-trap.py b/examples/hlapi/asyncore/agent/ntforg/default-v1-trap.py index 8f48dbe9..43dddce8 100644 --- a/examples/hlapi/asyncore/agent/ntforg/default-v1-trap.py +++ b/examples/hlapi/asyncore/agent/ntforg/default-v1-trap.py @@ -17,13 +17,7 @@ using the following options: Functionally similar to: -| $ snmptrap -v1 -c public demo.snmplabs.com \ -| 1.3.6.1.4.1.20408.4.1.1.2 \ -| 0.0.0.0 \ -| 1 \ -| 0 \ -| 0 -| '1.3.6.1.2.1.1.1.0' s 'my system' +| $ snmptrap -v1 -c public demo.snmplabs.com 1.3.6.1.4.1.20408.4.1.1.2 0.0.0.0 1 0 0 '1.3.6.1.2.1.1.1.0' s 'my system' """# from pysnmp.hlapi.asyncore import * diff --git a/examples/hlapi/asyncore/agent/ntforg/multiple-informs-at-once.py b/examples/hlapi/asyncore/agent/ntforg/multiple-informs-at-once.py index 05cad09b..d6c21c20 100644 --- a/examples/hlapi/asyncore/agent/ntforg/multiple-informs-at-once.py +++ b/examples/hlapi/asyncore/agent/ntforg/multiple-informs-at-once.py @@ -12,6 +12,9 @@ Send multiple SNMP notifications at once using the following options: * with TRAP ID 'coldStart' specified as a MIB symbol * include managed object information specified as var-bind objects pair +| $ snmpinform -v2c -c public demo.snmplabs.com 123 1.3.6.1.6.3.1.1.5.1 +| $ snmpinform -v3 -u usr-md5-des -l authPriv -A authkey1 -X privkey1 demo.snmplabs.com 123 1.3.6.1.6.3.1.1.5.1 + """# from pysnmp.hlapi.asyncore import * @@ -19,13 +22,13 @@ from pysnmp.hlapi.asyncore import * # ( ( authData, transportTarget ), ... ) targets = ( # 1-st target (SNMPv2c over IPv4/UDP) - ( CommunityData('public'), - UdpTransportTarget(('demo.snmplabs.com', 162)), - ContextData() ), + (CommunityData('public'), + UdpTransportTarget(('demo.snmplabs.com', 162)), + ContextData()), # 2-nd target (SNMPv3 over IPv4/UDP) - ( UsmUserData('usr-md5-des', 'authkey1', 'privkey1'), - UdpTransportTarget(('demo.snmplabs.com', 162)), - ContextData() ), + (UsmUserData('usr-md5-des', 'authkey1', 'privkey1'), + UdpTransportTarget(('demo.snmplabs.com', 162)), + ContextData()), ) def cbFun(snmpEngine, sendRequestHandle, errorIndication, diff --git a/examples/hlapi/asyncore/agent/ntforg/multiple-traps-at-once.py b/examples/hlapi/asyncore/agent/ntforg/multiple-traps-at-once.py index 40175d11..7b9c877f 100644 --- a/examples/hlapi/asyncore/agent/ntforg/multiple-traps-at-once.py +++ b/examples/hlapi/asyncore/agent/ntforg/multiple-traps-at-once.py @@ -13,6 +13,9 @@ wait for responses asynchronously: * with TRAP ID 'coldStart' specified as a MIB symbol * include managed object information specified as var-bind objects pair +| $ snmptrap -v1 -c public demo.snmplabs.com 1.3.6.1.4.1.20408.4.1.1.2 195.218.195.228 6 432 12345 1.3.6.1.2.1.1.1.0 s 'my system' +| $ snmptrap -v2c -c public demo.snmplabs.com 123 1.3.6.1.6.3.1.1.5.1 + """# from pysnmp.hlapi.asyncore import * diff --git a/examples/hlapi/asyncore/agent/ntforg/running-multiple-snmp-engines-at-once.py b/examples/hlapi/asyncore/agent/ntforg/running-multiple-snmp-engines-at-once.py index 80e7f2c2..9078873e 100644 --- a/examples/hlapi/asyncore/agent/ntforg/running-multiple-snmp-engines-at-once.py +++ b/examples/hlapi/asyncore/agent/ntforg/running-multiple-snmp-engines-at-once.py @@ -25,6 +25,9 @@ data packet should be handed over. The selection criteria we employ here is based on peer's UDP port number. Other selection criterias are also possible. +| $ snmpinform -v2c -c public demo.snmplabs.com:1162 123 1.3.6.1.6.3.1.1.5.1 +| $ snmpinform -v3 -u usr-md5-des -l authPriv -A authkey1 -X privkey1 demo.snmplabs.com 123 1.3.6.1.6.3.1.1.5.1 + """# from pysnmp.hlapi.asyncore import * from pysnmp.carrier.asyncore.dispatch import AsyncoreDispatcher diff --git a/examples/hlapi/asyncore/sync/agent/ntforg/custom-contextengineid.py b/examples/hlapi/asyncore/sync/agent/ntforg/custom-contextengineid.py index f25da4ce..0c02b962 100644 --- a/examples/hlapi/asyncore/sync/agent/ntforg/custom-contextengineid.py +++ b/examples/hlapi/asyncore/sync/agent/ntforg/custom-contextengineid.py @@ -17,11 +17,7 @@ the ContextEngineId being used. Functionally similar to: -| $ snmpinform -v3 -l authNoPriv -u usr-md5-none -A authkey1 \ -| -E 0x8000000004030201 -| demo.snmplabs.com \ -| 12345 \ -| 1.3.6.1.6.3.1.1.5.2 +| $ snmpinform -v3 -l authNoPriv -u usr-md5-none -A authkey1 -E 0x8000000004030201 demo.snmplabs.com 12345 1.3.6.1.6.3.1.1.5.2 """# from pysnmp.hlapi import * diff --git a/examples/hlapi/asyncore/sync/agent/ntforg/custom-contextname.py b/examples/hlapi/asyncore/sync/agent/ntforg/custom-contextname.py index 31171760..096a83d1 100644 --- a/examples/hlapi/asyncore/sync/agent/ntforg/custom-contextname.py +++ b/examples/hlapi/asyncore/sync/agent/ntforg/custom-contextname.py @@ -17,11 +17,7 @@ the ContextName being used. Functionally similar to: -| $ snmpinform -v3 -l authNoPriv -u usr-md5-none -A authkey1 \ -| -n my-context \ -| demo.snmplabs.com \ -| 12345 \ -| 1.3.6.1.6.3.1.1.5.2 +| $ snmpinform -v3 -l authNoPriv -u usr-md5-none -A authkey1 -n my-context demo.snmplabs.com 12345 0.3.6.1.6.3.1.1.5.2 """# from pysnmp.hlapi import * diff --git a/examples/hlapi/asyncore/sync/agent/ntforg/custom-v1-trap.py b/examples/hlapi/asyncore/sync/agent/ntforg/custom-v1-trap.py index 41ae4cc3..cd95324c 100644 --- a/examples/hlapi/asyncore/sync/agent/ntforg/custom-v1-trap.py +++ b/examples/hlapi/asyncore/sync/agent/ntforg/custom-v1-trap.py @@ -19,13 +19,7 @@ Original v1 TRAP fields are mapped into dedicated variable-bindings, Functionally similar to: -| $ snmptrap -v1 -c public demo.snmplabs.com \ -| 1.3.6.1.4.1.20408.4.1.1.2 \ -| 127.0.0.1 \ -| 6 \ -| 432 \ -| 12345 \ -| '1.3.6.1.2.1.1.1.0' s 'my system' +| $ snmptrap -v1 -c public demo.snmplabs.com 1.3.6.1.4.1.20408.4.1.1.2 127.0.0.1 6 432 12345 '1.3.6.1.2.1.1.1.0' s 'my system' """# from pysnmp.hlapi import * diff --git a/examples/hlapi/asyncore/sync/agent/ntforg/default-v1-trap.py b/examples/hlapi/asyncore/sync/agent/ntforg/default-v1-trap.py index 42308bcb..aa7d5f9a 100644 --- a/examples/hlapi/asyncore/sync/agent/ntforg/default-v1-trap.py +++ b/examples/hlapi/asyncore/sync/agent/ntforg/default-v1-trap.py @@ -17,13 +17,7 @@ using the following options: Functionally similar to: -| $ snmptrap -v1 -c public demo.snmplabs.com \ -| 1.3.6.1.4.1.20408.4.1.1.2 \ -| 0.0.0.0 \ -| 1 \ -| 0 \ -| 0 -| '1.3.6.1.2.1.1.1.0' s 'my system' +| $ snmptrap -v1 -c public demo.snmplabs.com 1.3.6.1.4.1.20408.4.1.1.2 0.0.0.0 1 0 0 1.3.6.1.2.1.1.1.0 s 'my system' """# from pysnmp.hlapi import * diff --git a/examples/hlapi/asyncore/sync/agent/ntforg/send-notification-with-additional-varbinds.py b/examples/hlapi/asyncore/sync/agent/ntforg/send-notification-with-additional-varbinds.py index 7ae42902..e5f2a590 100644 --- a/examples/hlapi/asyncore/sync/agent/ntforg/send-notification-with-additional-varbinds.py +++ b/examples/hlapi/asyncore/sync/agent/ntforg/send-notification-with-additional-varbinds.py @@ -13,11 +13,7 @@ Send SNMP notification using the following options: Functionally similar to: -| $ snmpinform -v2c -c public -| demo.snmplabs.com \ -| 12345 \ -| 1.3.6.1.6.3.1.1.5.1 \ -| 1.3.6.1.2.1.1.1.0 s 'my system' +| $ snmpinform -v2c -c public demo.snmplabs.com 12345 1.3.6.1.6.3.1.1.5.1 1.3.6.1.2.1.1.1.0 s 'my system' """# from pysnmp.hlapi import * diff --git a/examples/hlapi/asyncore/sync/agent/ntforg/v2c-trap-via-notification-type.py b/examples/hlapi/asyncore/sync/agent/ntforg/v2c-trap-via-notification-type.py index ddf66e14..60bd2b6b 100644 --- a/examples/hlapi/asyncore/sync/agent/ntforg/v2c-trap-via-notification-type.py +++ b/examples/hlapi/asyncore/sync/agent/ntforg/v2c-trap-via-notification-type.py @@ -14,9 +14,7 @@ in *NOTIFICATION-TYPE* SMI macro. Functionally similar to: -| $ snmptrap -v2c -c public demo.snmplabs.com \ -| 12345 -| 1.3.6.1.4.1.20408.4.1.1.2 +| $ snmptrap -v2c -c public demo.snmplabs.com 12345 1.3.6.1.4.1.20408.4.1.1.2 """# from pysnmp.hlapi import * diff --git a/examples/hlapi/asyncore/sync/agent/ntforg/v3-inform.py b/examples/hlapi/asyncore/sync/agent/ntforg/v3-inform.py index 5d8e284a..7707f7ed 100644 --- a/examples/hlapi/asyncore/sync/agent/ntforg/v3-inform.py +++ b/examples/hlapi/asyncore/sync/agent/ntforg/v3-inform.py @@ -13,11 +13,7 @@ Send SNMP INFORM notification using the following options: Functionally similar to: -| $ snmpinform -v3 -l authPriv -u usr-sha-aes -A authkey1 -X privkey1 \ -| demo.snmplabs.com \ -| 12345 \ -| 1.3.6.1.4.1.20408.4.1.1.2 \ -| '1.3.6.1.2.1.1.1.0' s 'my system' +| $ snmpinform -v3 -l authPriv -u usr-md5-des -A authkey1 -X privkey1 demo.snmplabs.com 12345 1.3.6.1.4.1.20408.4.1.1.2 '1.3.6.1.2.1.1.1.0' s 'my system' """# from pysnmp.hlapi import * diff --git a/examples/hlapi/asyncore/sync/agent/ntforg/v3-trap.py b/examples/hlapi/asyncore/sync/agent/ntforg/v3-trap.py index fb644e45..7a5fc146 100644 --- a/examples/hlapi/asyncore/sync/agent/ntforg/v3-trap.py +++ b/examples/hlapi/asyncore/sync/agent/ntforg/v3-trap.py @@ -5,7 +5,8 @@ SNMPv3 TRAP: auth SHA, privacy: AES128 Send SNMP notification using the following options: * SNMPv3 -* with local snmpEngineId = 0x8000000001020304 (must configure at Receiver) +* with authoritative snmpEngineId = 0x8000000001020304 + (USM must be configured at the Receiver accordingly) * with user 'usr-sha-aes128', auth: SHA, priv: AES128 * over IPv4/UDP * send TRAP notification @@ -18,12 +19,7 @@ we will use static (e.g. not autogenerated) version of snmpEngineId. Functionally similar to: -| $ snmptrap -v3 -l authPriv -u usr-sha-aes -A authkey1 -X privkey1 \ -| -a SHA -x AES \ -| demo.snmplabs.com \ -| 12345 \ -| 1.3.6.1.4.1.20408.4.1.1.2 \ -| '1.3.6.1.2.1.1.1.0' s 'my system' +| $ snmptrap -v3 -l authPriv -u usr-sha-aes -A authkey1 -X privkey1 -a SHA -x AES demo.snmplabs.com 12345 1.3.6.1.4.1.20408.4.1.1.2 '1.3.6.1.2.1.1.1.0' s 'my system' """# from pysnmp.hlapi import * diff --git a/examples/hlapi/trollius/agent/ntforg/default-v1-trap.py b/examples/hlapi/trollius/agent/ntforg/default-v1-trap.py index f5f4879f..81ef565d 100644 --- a/examples/hlapi/trollius/agent/ntforg/default-v1-trap.py +++ b/examples/hlapi/trollius/agent/ntforg/default-v1-trap.py @@ -18,13 +18,7 @@ using the following options: Functionally similar to: -| $ snmptrap -v1 -c public demo.snmplabs.com \ -| 1.3.6.1.4.1.20408.4.1.1.2 \ -| 0.0.0.0 \ -| 1 \ -| 0 \ -| 0 -| '1.3.6.1.2.1.1.1.0' s 'my system' +| $ snmptrap -v1 -c public demo.snmplabs.com 1.3.6.1.4.1.20408.4.1.1.2 0.0.0.0 1 0 0 1.3.6.1.2.1.1.1.0 s 'my system' """# import trollius @@ -52,6 +46,11 @@ def run(): if errorIndication: print(errorIndication) + elif errorStatus: + print('%s: at %s' % (errorStatus.prettyPrint(), errorIndex and varBinds[int(errorIndex)-1][0] or '?')) + else: + for varBind in varBinds: + print(' = '.join([x.prettyPrint() for x in varBind])) snmpEngine.transportDispatcher.closeDispatcher() diff --git a/examples/hlapi/twisted/agent/ntforg/default-v1-trap.py b/examples/hlapi/twisted/agent/ntforg/default-v1-trap.py index c17e3cfa..21eb7b7c 100644 --- a/examples/hlapi/twisted/agent/ntforg/default-v1-trap.py +++ b/examples/hlapi/twisted/agent/ntforg/default-v1-trap.py @@ -17,13 +17,7 @@ using the following options: Functionally similar to: -| $ snmptrap -v1 -c public demo.snmplabs.com \ -| 1.3.6.1.4.1.20408.4.1.1.2 \ -| 0.0.0.0 \ -| 1 \ -| 0 \ -| 0 -| '1.3.6.1.2.1.1.1.0' s 'my system' +| $ snmptrap -v1 -c public demo.snmplabs.com 1.3.6.1.4.1.20408.4.1.1.2 0.0.0.0 1 0 0 1.3.6.1.2.1.1.1.0 s 'my system' """# from twisted.internet.task import react diff --git a/examples/hlapi/twisted/agent/ntforg/multiple-notifications-at-once.py b/examples/hlapi/twisted/agent/ntforg/multiple-notifications-at-once.py index f4dc8aef..e6ff1165 100644 --- a/examples/hlapi/twisted/agent/ntforg/multiple-notifications-at-once.py +++ b/examples/hlapi/twisted/agent/ntforg/multiple-notifications-at-once.py @@ -4,10 +4,10 @@ Multiple concurrent notifications Send multiple SNMP notifications at once using the following options: -* SNMPv2c and SNMPv3 -* with community name 'public' or USM username usr-md5-des +* SNMPv2c +* with community name 'public' * over IPv4/UDP -* send INFORM notification +* send TRAP and INFORM notification * to multiple Managers * with TRAP ID 'coldStart' specified as a MIB symbol * include managed object information specified as var-bind objects pair @@ -18,12 +18,8 @@ what leads to excessive tables information. Functionally similar to: +| $ snmptrap -v2c -c public demo.snmplabs.com 12345 1.3.6.1.6.3.1.1.5.2 | $ snmpinform -v2c -c public demo.snmplabs.com 12345 1.3.6.1.6.3.1.1.5.2 -| -| $ snmpinform -v3 -l authNoPriv -u usr-md5-none -A authkey1 \ -| demo.snmplabs.com \ -| 12345 \ -| 1.3.6.1.6.3.1.1.5.2 """# from twisted.internet.defer import DeferredList 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 fb1ff489..6e29c4c6 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 @@ -13,7 +13,7 @@ The following script sends SNMP INFORM notification using the following options: The following Net-SNMP command will produce similar SNMP notification: -| $ snmpinform -v2c -c public udp:195.218.195.228 0 1.3.6.1.6.3.1.1.5.1 +| $ snmpinform -v2c -c public udp:demo.snmplabs.com 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,7 +67,7 @@ transportDispatcher.registerTransport( udp.domainName, udp.UdpSocketTransport().openClientMode() ) transportDispatcher.sendMessage( - encoder.encode(trapMsg), udp.domainName, ('195.218.195.228', 162) + encoder.encode(trapMsg), udp.domainName, ('demo.snmplabs.com', 162) ) transportDispatcher.jobStarted(1) 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 a821f86b..e662fc72 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 @@ -18,7 +18,7 @@ following options: The following Net-SNMP commands will produce similar SNMP notification: -| $ 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 udp:demo.snmplabs.com 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 """# @@ -53,7 +53,7 @@ transportDispatcher.registerTransport( udp.domainName, udp.UdpSocketTransport().openClientMode() ) transportDispatcher.sendMessage( - encoder.encode(trapMsg), udp.domainName, ('195.218.195.228', 162) + encoder.encode(trapMsg), udp.domainName, ('demo.snmplabs.com', 162) ) # UDP/IPv6 diff --git a/examples/v3arch/asyncore/agent/ntforg/multiple-different-notifications-at-once.py b/examples/v3arch/asyncore/agent/ntforg/multiple-different-notifications-at-once.py index 45e2d82f..237b8e0e 100644 --- a/examples/v3arch/asyncore/agent/ntforg/multiple-different-notifications-at-once.py +++ b/examples/v3arch/asyncore/agent/ntforg/multiple-different-notifications-at-once.py @@ -20,9 +20,6 @@ security settings: Functionally similar to: | $ snmpinform -v3 -l authPriv -u usr-md5-none -A authkey1 195.218.195.228 0 1.3.6.1.6.3.1.1.5.1 1.3.6.1.2.1.1.1.0 s 'Example notification' - -and - | $ snmpinform -v2c -c public 195.218.195.228 0 1.3.6.1.6.3.1.1.5.1 1.3.6.1.2.1.1.1.0 s 'Example notification' """# diff --git a/examples/v3arch/asyncore/agent/ntforg/send-custom-pdu.py b/examples/v3arch/asyncore/agent/ntforg/send-custom-pdu.py index 0219b1d1..150b7dfc 100644 --- a/examples/v3arch/asyncore/agent/ntforg/send-custom-pdu.py +++ b/examples/v3arch/asyncore/agent/ntforg/send-custom-pdu.py @@ -15,7 +15,7 @@ framework for further treatment. Functionally similar to: -| $ snmptrap -v1 -c public 195.218.195.228 1.3.6.1.6.3.1.1.5.1 0.0.0.0 1 0 123 +| $ snmptrap -v2c -c public demo.snmplabs.com 0 1.3.6.1.6.3.1.1.5.1 """# from pysnmp.entity import engine, config diff --git a/examples/v3arch/asyncore/agent/ntforg/send-inform-to-multiple-managers.py b/examples/v3arch/asyncore/agent/ntforg/send-inform-to-multiple-managers.py index 6faf8d44..77686670 100644 --- a/examples/v3arch/asyncore/agent/ntforg/send-inform-to-multiple-managers.py +++ b/examples/v3arch/asyncore/agent/ntforg/send-inform-to-multiple-managers.py @@ -18,13 +18,7 @@ security settings: Functionally similar to: | $ snmptrap -v2c -c public 195.218.195.228 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' - -and - | $ snmptrap -v2c -c public 195.218.195.228 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' - -and - | $ snmptrap -v2c -c public 195.218.195.228 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' """# diff --git a/examples/v3arch/asyncore/agent/ntforg/send-notification-over-ipv4-and-ipv6.py b/examples/v3arch/asyncore/agent/ntforg/send-notification-over-ipv4-and-ipv6.py index b1bb9fb6..467d0132 100644 --- a/examples/v3arch/asyncore/agent/ntforg/send-notification-over-ipv4-and-ipv6.py +++ b/examples/v3arch/asyncore/agent/ntforg/send-notification-over-ipv4-and-ipv6.py @@ -18,9 +18,6 @@ network protocols: Functionally similar to: | $ snmptrap -v2c -c public udp:195.218.195.228 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' - -and - | $ snmptrap -v2c -c public udp6:[::1] 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' """# diff --git a/examples/v3arch/asyncore/agent/ntforg/send-trap-to-multiple-managers.py b/examples/v3arch/asyncore/agent/ntforg/send-trap-to-multiple-managers.py index b93a2716..bf2e39d9 100644 --- a/examples/v3arch/asyncore/agent/ntforg/send-trap-to-multiple-managers.py +++ b/examples/v3arch/asyncore/agent/ntforg/send-trap-to-multiple-managers.py @@ -18,13 +18,7 @@ following options: Functionally similar to: | $ snmptrap -v2c -c public 195.218.195.228 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' - -and - | $ snmptrap -v2c -c public 195.218.195.228 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' - -and - | $ snmptrap -v2c -c public 195.218.195.228 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' """# diff --git a/examples/v3arch/asyncore/agent/ntforg/usm-md5-none.py b/examples/v3arch/asyncore/agent/ntforg/usm-md5-none.py index dd6ed53e..66d0a040 100644 --- a/examples/v3arch/asyncore/agent/ntforg/usm-md5-none.py +++ b/examples/v3arch/asyncore/agent/ntforg/usm-md5-none.py @@ -7,7 +7,7 @@ Send SNMP INFORM notification using the following options: * SNMPv3 * with user 'usr-md5-none', auth: MD5, priv NONE * over IPv4/UDP -* to a Manager at 195.218.195.228:162 +* to a Manager at demo.snmplabs.com:162 * send INFORM notification * with TRAP ID 'warmStart' specified as an OID * include managed object information 1.3.6.1.2.1.1.5.0 = 'system name' diff --git a/examples/v3arch/asyncore/agent/ntforg/v1-trap.py b/examples/v3arch/asyncore/agent/ntforg/v1-trap.py index bb6ab1be..a79dd0ce 100644 --- a/examples/v3arch/asyncore/agent/ntforg/v1-trap.py +++ b/examples/v3arch/asyncore/agent/ntforg/v1-trap.py @@ -18,7 +18,7 @@ Send SNMP notification using the following options: Functionally similar to: -| $ snmptrap -v1 -c public 195.218.195.228 1.3.6.1.4.1.20408.4.1.1.2 195.218.195.228 6 432 12345 1.3.6.1.2.1.1.1.0 s 'my system' +| $ snmptrap -v1 -c public demo.snmplabs.com 1.3.6.1.4.1.20408.4.1.1.2 195.218.195.228 6 432 12345 1.3.6.1.2.1.1.1.0 s 'my system' """# from pysnmp.entity import engine, config |