summaryrefslogtreecommitdiff
path: root/examples/v3arch/asyncio/manager/cmdgen/get-v2c-custom-timeout.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/v3arch/asyncio/manager/cmdgen/get-v2c-custom-timeout.py')
-rw-r--r--examples/v3arch/asyncio/manager/cmdgen/get-v2c-custom-timeout.py37
1 files changed, 20 insertions, 17 deletions
diff --git a/examples/v3arch/asyncio/manager/cmdgen/get-v2c-custom-timeout.py b/examples/v3arch/asyncio/manager/cmdgen/get-v2c-custom-timeout.py
index c2ef8b5..93efaba 100644
--- a/examples/v3arch/asyncio/manager/cmdgen/get-v2c-custom-timeout.py
+++ b/examples/v3arch/asyncio/manager/cmdgen/get-v2c-custom-timeout.py
@@ -1,20 +1,23 @@
-#
-# GET Command Generator
-#
-# Send a SNMP GET request
-# with SNMPv2c, community 'public'
-# using Asyncio 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 Python 3.4 and later!
-#
+"""
+Fetch scalar value
+++++++++++++++++++
+
+Send SNMP GET request with the following options:
+
+* with SNMPv2c, community 'public'
+* using Asyncio 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 Python 3.4 and later!
+
+"""#
from pysnmp.carrier.asyncio.dgram import udp
from pysnmp.entity.rfc3413.asyncio import cmdgen
from pysnmp.entity import engine, config