From 2f24177c361ba4d9deba2d7378f84aa96111db80 Mon Sep 17 00:00:00 2001 From: elie Date: Mon, 14 Sep 2015 05:20:24 +0000 Subject: * synchronous oneliner apps redesigned to offer Python generator-based API along with a more comprehensive set of accepted parameters. * massively documented (in Sphinx, NumPy style) --- .../manager/cmdgen/get-v2c-custom-timeout.py | 36 ++++++++++++---------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'examples/v3arch/trollius/manager/cmdgen/get-v2c-custom-timeout.py') 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 -- cgit v1.2.1