Advertisement
cyberbob61

Untitled

Jun 8th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. snmp=os.popen('snmpget -Oqv -v 2c -c public %s 1.3.6.1.2.1.1.1.0' % (ipvar)).read()
  2. #model
  3. premodel = re.findall
  4. regex = re.compile(r"(?:NE40E-[A-Z].*[0-9]|S53\d+\S*|Eudemon\d+\S*|Quidway.S\d+\S*)")
  5. premodel = regex.findall(snmp)
  6. model = premodel[0] if len(premodel) > 0 else ''
  7. model = str(model)
  8.  
  9. #version
  10. preversion = re.findall("V[0-9]{3}R[0-9]{3}C[0-9]{2}[A-Z0-9]*",snmp)
  11. version = ''.join(map(str, preversion))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement