diff options
author | elie <elie> | 2015-05-31 19:35:10 +0000 |
---|---|---|
committer | elie <elie> | 2015-05-31 19:35:10 +0000 |
commit | bea11dfe16e6714737b6f5016697206a038f051b (patch) | |
tree | 439ca11bab4cacb13f6438d50ad8500e902fdd82 /examples/v3arch/oneliner/agent/ntforg/inform-v2c-with-mib-lookup.py | |
parent | 8a7fa29b9b4cd263db4b283704bda1c09eb002e6 (diff) | |
download | pysnmp-bea11dfe16e6714737b6f5016697206a038f051b.tar.gz |
Major overhaul related to PySMI integration and Standard SNMP Applications
API redesign:
* MibVariable becomes ObjectIdentity and moves to pysnmp.smi.rfc1902
* ObjectType and NotificationType classes resempling corresponding MIB MACROs
implemented
* SNMP Standard Applications and examples modified to support ObjectType
and NotificationType parameters
Diffstat (limited to 'examples/v3arch/oneliner/agent/ntforg/inform-v2c-with-mib-lookup.py')
-rw-r--r-- | examples/v3arch/oneliner/agent/ntforg/inform-v2c-with-mib-lookup.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/v3arch/oneliner/agent/ntforg/inform-v2c-with-mib-lookup.py b/examples/v3arch/oneliner/agent/ntforg/inform-v2c-with-mib-lookup.py index ca51d28..330b6b2 100644 --- a/examples/v3arch/oneliner/agent/ntforg/inform-v2c-with-mib-lookup.py +++ b/examples/v3arch/oneliner/agent/ntforg/inform-v2c-with-mib-lookup.py @@ -19,8 +19,11 @@ errorIndication, errorStatus, errorIndex, varBinds = ntfOrg.sendNotification( ntforg.CommunityData('public'), ntforg.UdpTransportTarget(('localhost', 162)), 'inform', - ntforg.MibVariable('SNMPv2-MIB', 'coldStart'), - ( ntforg.MibVariable('SNMPv2-MIB', 'sysName', 0), 'my system' ), + ntforg.NotificationType( + ntforg.ObjectIdentity('SNMPv2-MIB', 'coldStart') + ).addVarBinds( + ( ntforg.ObjectIdentity('SNMPv2-MIB', 'sysName', 0), 'my system' ) + ), lookupNames=True, lookupValues=True ) |