Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def lol(XEP, OID0):
- break_flag = False
- for (errorIndication, errorStatus, errorIndex, varBinds) in nextCmd \
- (SnmpEngine(),
- CommunityData(COMMUNITY_r),
- UdpTransportTarget((IP1, PORT)),
- ContextData(),
- ObjectType(ObjectIdentity(OID0))):
- if break_flag:
- print("Work completed.")
- break
- if errorIndication:
- print(errorIndication)
- break
- elif errorStatus:
- print('%s at %s' % (errorStatus.prettyPrint(), errorIndex and varBinds[int(errorIndex) - 1][0] or '?'))
- break
- else:
- for varBind in varBinds:
- name, value = varBind
- result = match(MATCH_STRING0, name.prettyPrint())
- if result:
- result = match(MATCH_BREAK0, name.prettyPrint())
- if match(XEP, value.prettyPrint()):
- collection0.update({"mac": name.prettyPrint()[45:]})
- collection0.update({"state": value.prettyPrint()})
- if not result:
- break_flag = True
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement