call_test.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/usr/bin/env python2
  2. # -*- coding: utf-8 -*-
  3. """
  4. Created on Sat Dec 1 16:55:52 2018
  5. @author: dufs
  6. """
  7. import sshclient as sshClt
  8. import decodepasswd as decp
  9. import hostinfo
  10. if __name__ == "__main__":
  11. hostSet=set()
  12. hostSet.add(('10.102.52.8', 22444, 'iss', 'Iss@52.8!', 100))
  13. hostSet.add(('10.102.52.9', 22444, 'iss', 'Iss@52.8!', 101))
  14. hostSet.add(('10.102.52.10', 22444, 'iss', 'Iss@52.8!', 102))
  15. hostSet.add(('10.102.52.11', 22444, 'iss', 'Iss@52.8!', 103))
  16. hostSet.add(('10.102.52.12', 22444, 'iss', 'Iss@52.8!', 104))
  17. hostSet.add(('10.102.52.13', 22444, 'iss', 'Iss@52.8!', 105))
  18. hostSet.add(('10.102.52.16', 22444, 'iss', 'Iss@52.8!', 106))
  19. hostSet.add(('10.102.52.18', 22444, 'iss', 'Iss@52.8!', 107))
  20. hostSet.add(('10.102.52.19', 22444, 'iss', 'Iss@52.8!', 108))
  21. hostSet.add(('10.102.52.20', 22444, 'iss', 'Iss@52.8!', 109))
  22. hostSet.add(('10.102.52.21', 22444, 'iss', 'Iss@52.8!', 110))
  23. cmdSet=set()
  24. cmdSet.add(('disk', 'df -k'))
  25. cmdSet.add(('mem', 'free -m'))
  26. cmdSet.add(('vmstat', 'vmstat 1 5'))
  27. cmdSet.add(('ps', 'ps -fu iss'))
  28. #result=sshClt.ssh_batch_cmd(hostSet, cmdSet)
  29. #for res in result:
  30. # print res
  31. #decpass=decp.DecodePassword()
  32. #res=decpass.getdecodePassword('GaE+arhkPtNsGdsQOej3hw==', 'dWx0cmEtc3RhY2s=')
  33. #decpass.shutdownJVM()
  34. #print res
  35. res=hostinfo.get_hostinfo()
  36. print res