diff options
Diffstat (limited to 'examples/v3arch/trollius/manager/cmdgen')
5 files changed, 96 insertions, 86 deletions
diff --git a/examples/v3arch/trollius/manager/cmdgen/get-v1.py b/examples/v3arch/trollius/manager/cmdgen/get-v1.py index 3d14a15..9ecda4e 100644 --- a/examples/v3arch/trollius/manager/cmdgen/get-v1.py +++ b/examples/v3arch/trollius/manager/cmdgen/get-v1.py @@ -1,20 +1,22 @@ -# -# Command Generator -# -# Send SNMP GET request using the following options: -# -# * with SNMPv1, community 'public' -# * using Trollius framework for network transport -# * over IPv4/UDP -# * to an Agent at 195.218.195.228:161 -# * for an OID in string form -# -# This script performs similar to the following Net-SNMP command: -# -# $ snmpset -v1 -c public -ObentU 195.218.195.228 1.3.6.1.2.1.1.1.0 -# -# Requires Trollius framework! -# +""" +SNMPv1 GET +++++++++++ + +Send SNMP GET request using the following options: + +* with SNMPv1, community 'public' +* using Trollius framework for network transport +* over IPv4/UDP +* to an Agent at 195.218.195.228:161 +* for an OID in string form + +This script performs similar to the following Net-SNMP command: + +| $ snmpset -v1 -c public -ObentU 195.218.195.228 1.3.6.1.2.1.1.1.0 + +Requires Trollius framework! + +"""# from pysnmp.carrier.asyncio.dgram import udp from pysnmp.entity.rfc3413.asyncio import cmdgen from pysnmp.entity import engine, config diff --git a/examples/v3arch/trollius/manager/cmdgen/get-v2c-custom-timeout.py b/examples/v3arch/trollius/manager/cmdgen/get-v2c-custom-timeout.py index 4db7a8c..9da4301 100644 --- a/examples/v3arch/trollius/manager/cmdgen/get-v2c-custom-timeout.py +++ b/examples/v3arch/trollius/manager/cmdgen/get-v2c-custom-timeout.py @@ -1,20 +1,22 @@ -# -# GET Command Generator -# -# Send a SNMP GET request -# with SNMPv2c, community 'public' -# using Trollius framework for network transport -# over IPv4/UDP -# to an Agent at 195.218.195.228:161 -# wait 3 seconds for response, retry 5 times (plus one initial attempt) -# for an OID in string form -# -# This script performs similar to the following Net-SNMP command: -# -# $ snmpget -v2c -c public -ObentU -r 5 -t 1 195.218.195.228 1.3.6.1.2.1.1.1.0 -# -# Requires Trollius framework! -# +""" +Fetch scalar value with timeout ++++++++++++++++++++++++++++++++ + +Send a SNMP GET request +* with SNMPv2c, community 'public' +* using Trollius framework for network transport +* over IPv4/UDP +* to an Agent at 195.218.195.228:161 +* wait 3 seconds for response, retry 5 times (plus one initial attempt) +* for an OID in string form + +This script performs similar to the following Net-SNMP command: + +| $ snmpget -v2c -c public -ObentU -r 5 -t 1 195.218.195.228 1.3.6.1.2.1.1.1.0 + +Requires Trollius framework! + +"""# from pysnmp.carrier.asyncio.dgram import udp from pysnmp.entity.rfc3413.asyncio import cmdgen from pysnmp.entity import engine, config diff --git a/examples/v3arch/trollius/manager/cmdgen/getbulk-v3.py b/examples/v3arch/trollius/manager/cmdgen/getbulk-v3.py index 50f4e69..94839b4 100644 --- a/examples/v3arch/trollius/manager/cmdgen/getbulk-v3.py +++ b/examples/v3arch/trollius/manager/cmdgen/getbulk-v3.py @@ -1,21 +1,23 @@ -# -# GETBULK Command Generator -# -# Send a series of SNMP GETBULK requests -# with SNMPv3 with user 'usr-md5-des', MD5 auth and DES privacy protocols -# using Trollius framework for network transport -# over IPv4/UDP -# to an Agent at 195.218.195.228:161 -# with values non-repeaters = 0, max-repetitions = 25 -# for two OIDs in string form -# stop on end-of-mib condition for both OIDs -# -# This script performs similar to the following Net-SNMP command: -# -# $ snmpbulkwalk -v2c -c public -C n0 -C r25 -ObentU 195.218.195.228 1.3.6.1.2.1.1 1.3.6.1.4.1.1 -# -# Requires Trollius framework! -# +""" +BULK walk MIB ++++++++++++++ + +Send a series of SNMP GETBULK requests +* with SNMPv3 with user 'usr-md5-des', MD5 auth and DES privacy protocols +* using Trollius framework for network transport +* over IPv4/UDP +* to an Agent at 195.218.195.228:161 +* with values non-repeaters = 0, max-repetitions = 25 +* for two OIDs in string form +* stop on end-of-mib condition for both OIDs + +This script performs similar to the following Net-SNMP command: + +| $ snmpbulkwalk -v2c -c public -C n0 -C r25 -ObentU 195.218.195.228 1.3.6.1.2.1.1 1.3.6.1.4.1.1 + +Requires Trollius framework! + +"""# from pysnmp.entity import engine, config from pysnmp.proto import rfc1905 from pysnmp.entity.rfc3413.asyncio import cmdgen diff --git a/examples/v3arch/trollius/manager/cmdgen/getnext-v3.py b/examples/v3arch/trollius/manager/cmdgen/getnext-v3.py index 5b26bff..d5a852a 100644 --- a/examples/v3arch/trollius/manager/cmdgen/getnext-v3.py +++ b/examples/v3arch/trollius/manager/cmdgen/getnext-v3.py @@ -1,20 +1,22 @@ -# -# GETNEXT Command Generator -# -# Send a series of SNMP GETNEXT requests -# with SNMPv3 with user 'usr-none-none', no auth and no privacy protocols -# using Trollius framework for network transport -# over IPv4/UDP -# to an Agent at 195.218.195.228:161 -# for an OID in string form -# stop on end-of-mib condition for both OIDs -# -# This script performs similar to the following Net-SNMP command: -# -# $ snmpwalk -v2c -c public -ObentU 195.218.195.228 1.3.6.1.2.1.1 1.3.6.1.4.1.1 -# -# Requires Trollius framework! -# +""" +Walk MIB +++++++++ + +Send a series of SNMP GETNEXT requests +* with SNMPv3 with user 'usr-none-none', no auth and no privacy protocols +* using Trollius framework for network transport +* over IPv4/UDP +* to an Agent at 195.218.195.228:161 +* for an OID in string form +* stop on end-of-mib condition for both OIDs + +This script performs similar to the following Net-SNMP command: + +| $ snmpwalk -v2c -c public -ObentU 195.218.195.228 1.3.6.1.2.1.1 1.3.6.1.4.1.1 + +Requires Trollius framework! + +"""# from pysnmp.entity import engine, config from pysnmp.proto import rfc1905 from pysnmp.entity.rfc3413.asyncio import cmdgen diff --git a/examples/v3arch/trollius/manager/cmdgen/set-v2c.py b/examples/v3arch/trollius/manager/cmdgen/set-v2c.py index 966e78a..4939635 100644 --- a/examples/v3arch/trollius/manager/cmdgen/set-v2c.py +++ b/examples/v3arch/trollius/manager/cmdgen/set-v2c.py @@ -1,20 +1,22 @@ -# -# Command Generator -# -# Send SNMP SET request using the following options: -# -# * with SNMPv1, community 'public' -# * using Trollius framework for network transport -# * over IPv4/UDP -# * to an Agent at 195.218.195.228:161 -# * for OIDs in tuple form and an integer and string-typed values -# -# This script performs similar to the following Net-SNMP command: -# -# $ snmpset -v1 -c private -ObentU 195.218.195.228:161 1.3.6.1.2.1.1.9.1.3.1 s 'my value' 1.3.6.1.2.1.1.9.1.4.1 t 123 -# -# Requires Trollius framework! -# +""" +SET scalar value +++++++++++++++++ + +Send SNMP SET request using the following options: + +* with SNMPv1, community 'public' +* using Trollius framework for network transport +* over IPv4/UDP +* to an Agent at 195.218.195.228:161 +* for OIDs in tuple form and an integer and string-typed values + +This script performs similar to the following Net-SNMP command: + +| $ snmpset -v1 -c private -ObentU 195.218.195.228:161 1.3.6.1.2.1.1.9.1.3.1 s 'my value' 1.3.6.1.2.1.1.9.1.4.1 t 123 + +Requires Trollius framework! + +"""# from pysnmp.carrier.asyncio.dgram import udp from pysnmp.entity.rfc3413.asyncio import cmdgen from pysnmp.entity import engine, config |