diff options
29 files changed, 67 insertions, 64 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 9dc6e354..816f975a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -10,6 +10,8 @@ Repository `tarball download <http://pysnmp.cvs.sourceforge.net/viewvc/pysnmp/py passed at the very end of var-binds. - All SNMP counters now incremented via '+= 1' rather than 'x = x + 1' to simplify their tracking by third-party code. +- Notification originator examples re-pointed to Notification Receiver + at demo.snmplabs.com. - Fix to snmpInvalidMsgs and snmpUnknownSecurityModels MIB symbols import at SNMPv3 MP model. diff --git a/examples/hlapi/asyncio/agent/ntforg/default-v1-trap.py b/examples/hlapi/asyncio/agent/ntforg/default-v1-trap.py index dbfb45a3..e11fbc90 100644 --- a/examples/hlapi/asyncio/agent/ntforg/default-v1-trap.py +++ b/examples/hlapi/asyncio/agent/ntforg/default-v1-trap.py @@ -35,7 +35,7 @@ def run(): errorIndication, errorStatus, errorIndex, varBinds = yield from sendNotification( snmpEngine, CommunityData('public', mpModel=0), - UdpTransportTarget(('localhost', 162)), + UdpTransportTarget(('demo.snmplabs.com', 162)), ContextData(), 'trap', NotificationType( 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 a67e374d..7907b3c3 100644 --- a/examples/hlapi/asyncio/agent/ntforg/multiple-notifications-at-once.py +++ b/examples/hlapi/asyncio/agent/ntforg/multiple-notifications-at-once.py @@ -19,7 +19,7 @@ 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 localhost 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 | $ snmptrap -v2c -c public demo.snmplabs.com 12345 1.3.6.1.6.3.1.1.5.2 """# @@ -51,5 +51,5 @@ snmpEngine = SnmpEngine() loop = asyncio.get_event_loop() loop.run_until_complete( asyncio.wait([sendone(snmpEngine, 'demo.snmplabs.com', 'trap'), - sendone(snmpEngine, 'localhost', 'inform')]) + sendone(snmpEngine, 'demo.snmplabs.com', 'inform')]) ) diff --git a/examples/hlapi/asyncore/agent/ntforg/default-v1-trap.py b/examples/hlapi/asyncore/agent/ntforg/default-v1-trap.py index f36009eb..8f48dbe9 100644 --- a/examples/hlapi/asyncore/agent/ntforg/default-v1-trap.py +++ b/examples/hlapi/asyncore/agent/ntforg/default-v1-trap.py @@ -33,7 +33,7 @@ snmpEngine = SnmpEngine() sendNotification( snmpEngine, CommunityData('public', mpModel=0), - UdpTransportTarget(('localhost', 162)), + UdpTransportTarget(('demo.snmplabs.com', 162)), ContextData(), 'trap', NotificationType( 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 c0ae96b0..05cad09b 100644 --- a/examples/hlapi/asyncore/agent/ntforg/multiple-informs-at-once.py +++ b/examples/hlapi/asyncore/agent/ntforg/multiple-informs-at-once.py @@ -20,11 +20,11 @@ from pysnmp.hlapi.asyncore import * targets = ( # 1-st target (SNMPv2c over IPv4/UDP) ( CommunityData('public'), - UdpTransportTarget(('localhost', 162)), + UdpTransportTarget(('demo.snmplabs.com', 162)), ContextData() ), # 2-nd target (SNMPv3 over IPv4/UDP) ( UsmUserData('usr-md5-des', 'authkey1', 'privkey1'), - UdpTransportTarget(('localhost', 162)), + UdpTransportTarget(('demo.snmplabs.com', 162)), ContextData() ), ) 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 729f2e5c..40175d11 100644 --- a/examples/hlapi/asyncore/agent/ntforg/multiple-traps-at-once.py +++ b/examples/hlapi/asyncore/agent/ntforg/multiple-traps-at-once.py @@ -21,11 +21,11 @@ from pysnmp.hlapi.asyncore import * targets = ( # 1-st target (SNMPv1 over IPv4/UDP) ( CommunityData('public', mpModel=0), - UdpTransportTarget(('localhost', 162)), + UdpTransportTarget(('demo.snmplabs.com', 162)), ContextData() ), # 2-nd target (SNMPv2c over IPv4/UDP) ( CommunityData('public'), - UdpTransportTarget(('localhost', 162)), + UdpTransportTarget(('demo.snmplabs.com', 162)), ContextData() ), ) 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 ce9db153..80e7f2c2 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 @@ -34,11 +34,11 @@ from pysnmp.carrier.asyncore.dispatch import AsyncoreDispatcher targets = ( # 1-st target (SNMPv2c over IPv4/UDP) ( CommunityData('public'), - UdpTransportTarget(('localhost', 1162)), + UdpTransportTarget(('demo.snmplabs.com', 1162)), ContextData() ), # 2-nd target (SNMPv3 over IPv4/UDP) ( UsmUserData('usr-md5-des', 'authkey1', 'privkey1'), - UdpTransportTarget(('localhost', 162)), + UdpTransportTarget(('demo.snmplabs.com', 162)), ContextData() ), ) diff --git a/examples/hlapi/asyncore/sync/agent/ntforg/custom-contextengineid.py b/examples/hlapi/asyncore/sync/agent/ntforg/custom-contextengineid.py index 2ccdafe6..f25da4ce 100644 --- a/examples/hlapi/asyncore/sync/agent/ntforg/custom-contextengineid.py +++ b/examples/hlapi/asyncore/sync/agent/ntforg/custom-contextengineid.py @@ -29,7 +29,7 @@ from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( sendNotification(SnmpEngine(), UsmUserData('usr-md5-none', 'authkey1'), - UdpTransportTarget(('localhost', 162)), + UdpTransportTarget(('demo.snmplabs.com', 162)), ContextData(OctetString(hexValue='8000000004030201')), 'inform', NotificationType(ObjectIdentity('1.3.6.1.6.3.1.1.5.2'))) diff --git a/examples/hlapi/asyncore/sync/agent/ntforg/custom-contextname.py b/examples/hlapi/asyncore/sync/agent/ntforg/custom-contextname.py index a087c7ef..31171760 100644 --- a/examples/hlapi/asyncore/sync/agent/ntforg/custom-contextname.py +++ b/examples/hlapi/asyncore/sync/agent/ntforg/custom-contextname.py @@ -29,7 +29,7 @@ from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( sendNotification(SnmpEngine(), UsmUserData('usr-md5-none', 'authkey1'), - UdpTransportTarget(('localhost', 162)), + UdpTransportTarget(('demo.snmplabs.com', 162)), ContextData(contextName='my-context'), 'inform', NotificationType(ObjectIdentity('1.3.6.1.6.3.1.1.5.2'))) 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 768ad26b..41ae4cc3 100644 --- a/examples/hlapi/asyncore/sync/agent/ntforg/custom-v1-trap.py +++ b/examples/hlapi/asyncore/sync/agent/ntforg/custom-v1-trap.py @@ -33,7 +33,7 @@ from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( sendNotification(SnmpEngine(), CommunityData('public', mpModel=0), - UdpTransportTarget(('localhost', 162)), + UdpTransportTarget(('demo.snmplabs.com', 162)), ContextData(), 'trap', NotificationType( 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 7d4a9d00..42308bcb 100644 --- a/examples/hlapi/asyncore/sync/agent/ntforg/default-v1-trap.py +++ b/examples/hlapi/asyncore/sync/agent/ntforg/default-v1-trap.py @@ -31,7 +31,7 @@ from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( sendNotification(SnmpEngine(), CommunityData('public', mpModel=0), - UdpTransportTarget(('localhost', 162)), + UdpTransportTarget(('demo.snmplabs.com', 162)), ContextData(), 'trap', NotificationType( 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 17cf8991..7ae42902 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 @@ -25,7 +25,7 @@ from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( sendNotification(SnmpEngine(), CommunityData('public'), - UdpTransportTarget(('localhost', 162)), + UdpTransportTarget(('demo.snmplabs.com', 162)), ContextData(), 'inform', NotificationType( 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 e5121b2b..ddf66e14 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 @@ -24,7 +24,7 @@ from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( sendNotification(SnmpEngine(), CommunityData('public'), - UdpTransportTarget(('localhost', 162)), + UdpTransportTarget(('demo.snmplabs.com', 162)), ContextData(), 'trap', NotificationType( diff --git a/examples/hlapi/asyncore/sync/agent/ntforg/v3-inform.py b/examples/hlapi/asyncore/sync/agent/ntforg/v3-inform.py index 39f5127e..5d8e284a 100644 --- a/examples/hlapi/asyncore/sync/agent/ntforg/v3-inform.py +++ b/examples/hlapi/asyncore/sync/agent/ntforg/v3-inform.py @@ -25,7 +25,7 @@ from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( sendNotification(SnmpEngine(), UsmUserData('usr-md5-des', 'authkey1', 'privkey1'), - UdpTransportTarget(('localhost', 162)), + UdpTransportTarget(('demo.snmplabs.com', 162)), ContextData(), 'inform', NotificationType( diff --git a/examples/hlapi/asyncore/sync/agent/ntforg/v3-trap.py b/examples/hlapi/asyncore/sync/agent/ntforg/v3-trap.py index ba62b398..fb644e45 100644 --- a/examples/hlapi/asyncore/sync/agent/ntforg/v3-trap.py +++ b/examples/hlapi/asyncore/sync/agent/ntforg/v3-trap.py @@ -33,7 +33,7 @@ errorIndication, errorStatus, errorIndex, varBinds = next( UsmUserData('usr-sha-aes128', 'authkey1', 'privkey1', authProtocol=usmHMACSHAAuthProtocol, privProtocol=usmAesCfb128Protocol), - UdpTransportTarget(('localhost', 162)), + UdpTransportTarget(('demo.snmplabs.com', 162)), ContextData(), 'trap', NotificationType( diff --git a/examples/hlapi/trollius/agent/ntforg/default-v1-trap.py b/examples/hlapi/trollius/agent/ntforg/default-v1-trap.py index dbfb63e4..f5f4879f 100644 --- a/examples/hlapi/trollius/agent/ntforg/default-v1-trap.py +++ b/examples/hlapi/trollius/agent/ntforg/default-v1-trap.py @@ -38,7 +38,7 @@ def run(): sendNotification( snmpEngine, CommunityData('public'), # mpModel=0), - UdpTransportTarget(('localhost', 162)), + UdpTransportTarget(('demo.snmplabs.com', 162)), ContextData(), 'inform', NotificationType( 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 e0839c30..f4dc8aef 100644 --- a/examples/hlapi/twisted/agent/ntforg/multiple-notifications-at-once.py +++ b/examples/hlapi/twisted/agent/ntforg/multiple-notifications-at-once.py @@ -70,4 +70,5 @@ def sendall(reactor, destinations): for hostname, notifyType in destinations ] ) -react(sendall, [[('localhost', 'trap'), ('localhost', 'inform')]]) +react(sendall, [[('demo.snmplabs.com', 'trap'), + ('demo.snmplabs.com', 'inform')]]) 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 ab5f6413..45e2d82f 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 @@ -12,18 +12,18 @@ security settings: * with user 'usr-md5-none', auth: MD5, priv NONE * over IPv4/UDP * send INFORM notification -* to multiple Managers at 127.0.0.1:162, 127.0.0.2:162 +* to multiple Managers at 195.218.195.228:162, 195.218.195.228:162 * with TRAP ID 'coldStart' specified as an OID * include managed objects information: 1.3.6.1.2.1.1.1.0 = 'Example Notificator' Functionally similar to: -| $ snmpinform -v3 -l authPriv -u usr-md5-none -A authkey1 127.0.0.1 0 1.3.6.1.6.3.1.1.5.1 1.3.6.1.2.1.1.1.0 s 'Example notification' +| $ 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 127.0.0.2 0 1.3.6.1.6.3.1.1.5.1 1.3.6.1.2.1.1.1.0 s 'Example notification' +| $ 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' """# from pysnmp.entity import engine, config @@ -60,14 +60,14 @@ config.addTransport( # First target config.addTargetAddr( snmpEngine, 'my-nms-1', - udp.domainName, ('127.0.0.1', 162), + udp.domainName, ('195.218.195.228', 162), 'my-creds-1', tagList='all-my-managers' ) # Second target config.addTargetAddr( snmpEngine, 'my-nms-2', - udp.domainName, ('127.0.0.1', 162), + udp.domainName, ('195.218.195.228', 162), 'my-creds-2', tagList='all-my-managers' ) diff --git a/examples/v3arch/asyncore/agent/ntforg/send-custom-pdu.py b/examples/v3arch/asyncore/agent/ntforg/send-custom-pdu.py index 10517547..0219b1d1 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 127.0.0.1 1.3.6.1.6.3.1.1.5.1 0.0.0.0 1 0 123 +| $ 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 """# from pysnmp.entity import engine, config @@ -43,7 +43,7 @@ config.addTransport( # Create named target config.addTargetAddr( snmpEngine, 'my-nms', - udp.domainName, ('127.0.0.1', 162), + udp.domainName, ('195.218.195.228', 162), 'my-creds' ) 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 ce82f60c..6faf8d44 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 @@ -9,7 +9,7 @@ security settings: * with community name 'public' * over IPv4/UDP * send TRAP notification -* to multiple Managers at 127.0.0.1:162, 127.0.0.2:162 +* to multiple Managers at 195.218.195.228:162, 195.218.195.228:162 * with TRAP ID 'coldStart' specified as an OID * include managed objects information: 1.3.6.1.2.1.1.1.0 = 'Example Notificator' @@ -17,15 +17,15 @@ security settings: Functionally similar to: -| $ snmptrap -v2c -c public 127.0.0.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' +| $ 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 127.0.0.2 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' +| $ 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 127.0.0.3 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' +| $ 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' """# from pysnmp.entity import engine, config @@ -52,21 +52,21 @@ config.addTransport( # First target config.addTargetAddr( snmpEngine, 'my-nms-1', - udp.domainName, ('127.0.0.1', 162), + udp.domainName, ('195.218.195.228', 162), 'my-creds', tagList='all-my-managers' ) # Second target config.addTargetAddr( snmpEngine, 'my-nms-2', - udp.domainName, ('127.0.0.2', 162), + udp.domainName, ('195.218.195.228', 162), 'my-creds', tagList='all-my-managers' ) # Third target config.addTargetAddr( snmpEngine, 'my-nms-3', - udp.domainName, ('127.0.0.3', 162), + udp.domainName, ('195.218.195.228', 162), 'my-creds', tagList='all-my-managers' ) 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 1c93e620..b1bb9fb6 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 @@ -17,7 +17,7 @@ network protocols: Functionally similar to: -| $ snmptrap -v2c -c public udp:127.0.0.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' +| $ 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 @@ -49,7 +49,7 @@ config.addTransport( ) config.addTargetAddr( snmpEngine, 'my-nms-1', - udp.domainName, ('127.0.0.1', 162), + udp.domainName, ('195.218.195.228', 162), 'my-creds', tagList='all-my-managers' ) diff --git a/examples/v3arch/asyncore/agent/ntforg/send-packet-from-specific-address.py b/examples/v3arch/asyncore/agent/ntforg/send-packet-from-specific-address.py index c7dfedb4..2577aaed 100644 --- a/examples/v3arch/asyncore/agent/ntforg/send-packet-from-specific-address.py +++ b/examples/v3arch/asyncore/agent/ntforg/send-packet-from-specific-address.py @@ -7,14 +7,14 @@ Send SNMP notification using the following options: * SNMPv1 * with community name 'public' * over IPv4/UDP -* to a Manager at 127.0.0.1 UDP port 162 -* from local address 127.0.0.1, UDP port 61024 +* to a Manager at 195.218.195.228 UDP port 162 +* from local address 0.0.0.0, UDP port 61024 * send TRAP notification * with TRAP ID 'coldStart' specified as an OID Functionally similar to: -| $ snmptrap -v1 -c public 127.0.0.1 1.3.6.1.6.3.1.1.5.1 0.0.0.0 1 0 0 +| $ snmptrap -v1 -c public 195.218.195.228 1.3.6.1.6.3.1.1.5.1 0.0.0.0 1 0 0 """# from pysnmp.entity import engine, config @@ -38,11 +38,11 @@ config.addTargetParams(snmpEngine, 'my-creds', 'my-area', 'noAuthNoPriv', 0) config.addTransport( snmpEngine, udp.domainName, - udp.UdpSocketTransport().openClientMode(iface=('127.0.0.1', 61024)) + udp.UdpSocketTransport().openClientMode(iface=('0.0.0.0', 61024)) ) config.addTargetAddr( snmpEngine, 'my-nms', - udp.domainName, ('127.0.0.1', 162), + udp.domainName, ('195.218.195.228', 162), 'my-creds', tagList='all-my-managers' ) 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 0f356697..b93a2716 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 @@ -9,7 +9,7 @@ following options: * with community name 'public' * over IPv4/UDP * send TRAP notification -* to multiple Managers at 127.0.0.1:162, 127.0.0.2:162 +* to multiple Managers at 195.218.195.228:162, 195.218.195.228:162 * with TRAP ID 'coldStart' specified as an OID * include managed objects information: 1.3.6.1.2.1.1.1.0 = 'Example Notificator' @@ -17,15 +17,15 @@ following options: Functionally similar to: -| $ snmptrap -v2c -c public 127.0.0.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' +| $ 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 127.0.0.2 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' +| $ 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 127.0.0.3 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' +| $ 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' """# from pysnmp.entity import engine, config @@ -52,21 +52,21 @@ config.addTransport( # First target config.addTargetAddr( snmpEngine, 'my-nms-1', - udp.domainName, ('127.0.0.1', 162), + udp.domainName, ('195.218.195.228', 162), 'my-creds', tagList='all-my-managers' ) # Second target config.addTargetAddr( snmpEngine, 'my-nms-2', - udp.domainName, ('127.0.0.2', 162), + udp.domainName, ('195.218.195.228', 162), 'my-creds', tagList='all-my-managers' ) # Third target config.addTargetAddr( snmpEngine, 'my-nms-3', - udp.domainName, ('127.0.0.3', 162), + udp.domainName, ('195.218.195.228', 162), 'my-creds', tagList='all-my-managers' ) diff --git a/examples/v3arch/asyncore/agent/ntforg/usm-md5-none.py b/examples/v3arch/asyncore/agent/ntforg/usm-md5-none.py index 116d6794..dd6ed53e 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 127.0.0.1:162 +* to a Manager at 195.218.195.228: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' @@ -41,7 +41,7 @@ config.addTransport( ) config.addTargetAddr( snmpEngine, 'my-nms', - udp.domainName, ('127.0.0.1', 162), + udp.domainName, ('195.218.195.228', 162), 'my-creds', tagList='all-my-managers' ) diff --git a/examples/v3arch/asyncore/agent/ntforg/v1-trap.py b/examples/v3arch/asyncore/agent/ntforg/v1-trap.py index 226788a7..bb6ab1be 100644 --- a/examples/v3arch/asyncore/agent/ntforg/v1-trap.py +++ b/examples/v3arch/asyncore/agent/ntforg/v1-trap.py @@ -7,18 +7,18 @@ Send SNMP notification using the following options: * SNMPv1 * with community name 'public' * over IPv4/UDP -* to a Manager at 127.0.0.1:162 +* to a Manager at 195.218.195.228:162 * send TRAP notification * with TRAP ID 'coldStart' specified as an OID * include managed objects information: * overriding Uptime value with 12345 -* overriding Agent Address with '127.0.0.1' +* overriding Agent Address with '195.218.195.228' * overriding Enterprise OID with 1.3.6.1.4.1.20408.4.1.1.2 * include managed object information '1.3.6.1.2.1.1.1.0' = 'my system' Functionally similar to: -| $ snmptrap -v1 -c public 127.0.0.1 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 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' """# from pysnmp.entity import engine, config @@ -44,7 +44,7 @@ config.addTransport( ) config.addTargetAddr( snmpEngine, 'my-nms', - udp.domainName, ('127.0.0.1', 162), + udp.domainName, ('195.218.195.228', 162), 'my-creds', tagList='all-my-managers' ) diff --git a/examples/v3arch/asyncore/agent/ntforg/v2c-inform.py b/examples/v3arch/asyncore/agent/ntforg/v2c-inform.py index 026d36ff..4e02f71b 100644 --- a/examples/v3arch/asyncore/agent/ntforg/v2c-inform.py +++ b/examples/v3arch/asyncore/agent/ntforg/v2c-inform.py @@ -8,7 +8,7 @@ Send SNMP INFORM notification using the following options: * with community name 'public' * over IPv4/UDP * send INFORM notification -* to a Manager at 127.0.0.1:162 +* to a Manager at 195.218.195.228:162 * with TRAP ID 'coldStart' specified as an OID * include managed objects information: 1.3.6.1.2.1.1.1.0 = 'Example Notificator' @@ -16,7 +16,7 @@ Send SNMP INFORM 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 'Example Notificator' 1.3.6.1.2.1.1.5.0 s 'Notificator Example' +| $ snmpinform -v2c -c public 195.218.195.228 12345 1.3.6.1.6.3.1.1.5.1 1.3.6.1.2.1.1.1.0 s 'Example Notificator' 1.3.6.1.2.1.1.5.0 s 'Notificator Example' """# from pysnmp.entity import engine, config diff --git a/examples/v3arch/asyncore/agent/ntforg/v2c-trap-via-notification-type.py b/examples/v3arch/asyncore/agent/ntforg/v2c-trap-via-notification-type.py index b72c5a7d..4d8f1756 100644 --- a/examples/v3arch/asyncore/agent/ntforg/v2c-trap-via-notification-type.py +++ b/examples/v3arch/asyncore/agent/ntforg/v2c-trap-via-notification-type.py @@ -8,7 +8,7 @@ Send SNMP TRAP notification using the following options: * with community name 'public' * over IPv4/UDP * send TRAP notification -* to a Manager at 127.0.0.1:162 +* to a Manager at 195.218.195.228:162 * with TRAP ID IF-MIB::ifLink as MIB symbol The IF-MIB::ifLink NOTIFICATION-TYPE implies including four other @@ -23,7 +23,7 @@ Where "x" is MIB table index (instance index). Functionally similar to: -| $ snmptrap -v2c -c public 127.0.0.1 0 1.3.6.1.6.3.1.1.5.3 IF-MIB::ifIndex."1" IF-MIB::ifAdminStatus."1" IF-MIB::ifOperStatus."1" IF-MIB::ifDescr."1" +| $ snmptrap -v2c -c public 195.218.195.228 0 1.3.6.1.6.3.1.1.5.3 IF-MIB::ifIndex."1" IF-MIB::ifAdminStatus."1" IF-MIB::ifOperStatus."1" IF-MIB::ifDescr."1" """# from pysnmp.entity import engine, config @@ -68,7 +68,7 @@ config.addTransport( ) config.addTargetAddr( snmpEngine, 'my-nms-1', - udp.domainName, ('127.0.0.1', 162), + udp.domainName, ('195.218.195.228', 162), 'my-creds', tagList='all-my-managers' ) diff --git a/examples/v3arch/asyncore/agent/ntforg/v2c-trap.py b/examples/v3arch/asyncore/agent/ntforg/v2c-trap.py index 2a926d88..91fcaf7f 100644 --- a/examples/v3arch/asyncore/agent/ntforg/v2c-trap.py +++ b/examples/v3arch/asyncore/agent/ntforg/v2c-trap.py @@ -8,7 +8,7 @@ Send SNMP TRAP notification using the following options: * with community name 'public' * over IPv4/UDP * send TRAP notification -* to a Manager at 127.0.0.1:162 +* to a Manager at 195.218.195.228:162 * with TRAP ID 'coldStart' specified as an OID * include managed objects information: 1.3.6.1.2.1.1.1.0 = 'Example Notificator' @@ -16,7 +16,7 @@ Send SNMP TRAP notification using the following options: Functionally similar to: -| $ snmptrap -v2c -c public 127.0.0.1 12345 1.3.6.1.4.1.20408.4.1.1.2 +| $ snmptrap -v2c -c public 195.218.195.228 12345 1.3.6.1.4.1.20408.4.1.1.2 """# from pysnmp.entity import engine, config @@ -42,7 +42,7 @@ config.addTransport( ) config.addTargetAddr( snmpEngine, 'my-nms', - udp.domainName, ('127.0.0.1', 162), + udp.domainName, ('195.218.195.228', 162), 'my-creds', tagList='all-my-managers' ) diff --git a/examples/v3arch/asyncore/agent/ntforg/v3-trap.py b/examples/v3arch/asyncore/agent/ntforg/v3-trap.py index a97a975d..90312ca7 100644 --- a/examples/v3arch/asyncore/agent/ntforg/v3-trap.py +++ b/examples/v3arch/asyncore/agent/ntforg/v3-trap.py @@ -8,7 +8,7 @@ Send SNMP TRAP notification using the following options: * with user 'usr-md5-des', auth: MD5, priv DES * over IPv4/UDP * send TRAP notification -* to a Manager at 127.0.0.1:162 +* to a Manager at 195.218.195.228:162 * with TRAP ID 'warmStart' specified as an OID * include managed object information 1.3.6.1.2.1.1.5.0 = 'system name' @@ -46,7 +46,7 @@ config.addTransport( ) config.addTargetAddr( snmpEngine, 'my-nms', - udp.domainName, ('127.0.0.1', 162), + udp.domainName, ('195.218.195.228', 162), 'my-creds', tagList='all-my-managers' ) |