Home > other >  Useful pysnmp H3C equipment management? Ask questions about the mib
Useful pysnmp H3C equipment management? Ask questions about the mib

Time:03-12

Want to use pysnmp read H3C switches CPU information, function is as follows:
========================
Def getCpuUsage (target) :
# ObjectIdentity class is responsible for the MIB object recognition,
# assigned to query the OID object or name
Sysname=ObjectIdentity (" 1.3.6.1.4.1.25506.2.6.1.1.1.1.6.0 ")
# using the ObjectType class initializes the query object
Obj1=ObjectType (sysname)
# getCMD method is used to query and returns the result is an iterator, you need to use the next () to value
# transfer parameters are as defined above variables, v2c, for example, if it is v3, communityData replace for userData)
G=getCmd (engine, userData, target, the context, obj1)
# values
_, _, _, result=next (g)
# print
For I in result:
Print (I)
==========================
Run error:
SNMPv2 - SMI: : enterprises. 25506.2.6.1.1.1.1.6.0=No to Instance currently exists at this OID

Could you tell me how can get H3C mib files? How can quickly converted to the corresponding mib py files? Or how can I put this OID added to the existing in the mib files?
Consult tall person!

CodePudding user response:

The mib files, but how to convert py files? Consult tall person
  • Related