Changeset 11727 in genesis for tools


Ignore:
Timestamp:
Feb 13, 2013, 7:35:56 PM (12 years ago)
Author:
rick
Message:

Not used anymore, causing import errors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/check-batch-cmd

    r11053 r11727  
    1717
    1818SSHPASS = None
    19 import pysnmp
    20 from pysnmp.entity.rfc3413.oneliner import cmdgen
    2119import netsnmp
    22 
    23 def snmp_test():
    24   errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(
    25       # SNMP v1
    26   #    cmdgen.CommunityData('test-agent', 'public', 0),
    27       # SNMP v2
    28       cmdgen.CommunityData('test-agent', 'public'),
    29       # SNMP v3
    30   #    cmdgen.UsmUserData('test-user', 'authkey1', 'privkey1'),
    31       cmdgen.UdpTransportTarget(('localhost', 161)),
    32       # Plain OID
    33       (1,3,6,1,2,1,1,1,0),
    34       # ((mib-name, mib-symbol), instance-id)
    35       (('SNMPv2-MIB', 'sysObjectID'), 0)
    36       )
    37  
    38   if errorIndication:
    39       print errorIndication
    40   else:
    41       if errorStatus:
    42           print '%s at %s\n' % (
    43               errorStatus.prettyPrint(),
    44               errorIndex and varBinds[int(errorIndex)-1] or '?'
    45               )
    46       else:
    47           for name, val in varBinds:
    48               print '%s = %s' % (name.prettyPrint(), val.prettyPrint())
    49 
    50 
    5120
    5221class CmdError(Exception):
Note: See TracChangeset for help on using the changeset viewer.