diff options
Diffstat (limited to 'examples/hlapi/asyncore')
12 files changed, 26 insertions, 57 deletions
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 * |