showtech.py.in 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!@PYTHON@
  2. # Copyright (C) 2012 Internet Systems Consortium.
  3. #
  4. # Permission to use, copy, modify, and distribute this software for any
  5. # purpose with or without fee is hereby granted, provided that the above
  6. # copyright notice and this permission notice appear in all copies.
  7. #
  8. # THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
  9. # DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
  10. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
  11. # INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
  12. # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
  13. # FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
  14. # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  15. # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. """
  17. BIND 10 showtech program.
  18. """
  19. import sys; sys.path.append ('@@PYTHONPATH@@')
  20. from isc.sysinfo import *
  21. def main():
  22. s = SysInfo()
  23. print('BIND 10 ShowTech tool')
  24. print('---------------------')
  25. print('\nCPU');
  26. print(' + Number of processors: ' + str(s.get_num_processors()))
  27. print(' + Endianness: ' + s.get_endianness())
  28. print('\nPlatform');
  29. print(' + Operating system: ' + s.get_platform_name())
  30. print(' + Distribution: ' + s.get_platform_distro())
  31. print(' + Kernel version: ' + s.get_platform_version())
  32. if s.get_platform_is_smp():
  33. print(' + SMP kernel: yes')
  34. else:
  35. print(' + SMP kernel: no')
  36. print(' + Machine name: ' + s.get_platform_machine())
  37. print(' + Uptime: %d seconds' % (s.get_uptime()))
  38. l = s.get_loadavg()
  39. print(' + Loadavg: %f %f %f' % (l[0], l[1], l[2]))
  40. print('\nMemory');
  41. print(' + Total: %d bytes' % (s.get_mem_total()))
  42. print(' + Free: %d bytes' % (s.get_mem_free()))
  43. print(' + Cached: %d bytes' % (s.get_mem_cached()))
  44. print(' + Buffers: %d bytes' % (s.get_mem_buffers()))
  45. print(' + Swap total: %d bytes' % (s.get_mem_swap_total()))
  46. print(' + Swap free: %d bytes' % (s.get_mem_swap_free()))
  47. print('\nNetwork');
  48. print(' + Hostname: ' + s.get_hostname())
  49. print('')
  50. if __name__ == '__main__':
  51. main()