12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #!@PYTHON@
- # Copyright (C) 2012 Internet Systems Consortium.
- #
- # Permission to use, copy, modify, and distribute this software for any
- # purpose with or without fee is hereby granted, provided that the above
- # copyright notice and this permission notice appear in all copies.
- #
- # THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
- # DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
- # INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
- # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- # FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- """
- BIND 10 showtech program.
- """
- import sys; sys.path.append ('@@PYTHONPATH@@')
- from isc.sysinfo import *
- def main():
- s = SysInfo()
- print('BIND 10 ShowTech tool')
- print('---------------------')
- print('\nCPU');
- print(' + Number of processors: ' + str(s.get_num_processors()))
- print(' + Endianness: ' + s.get_endianness())
- print('\nPlatform');
- print(' + Operating system: ' + s.get_platform_name())
- print(' + Distribution: ' + s.get_platform_distro())
- print(' + Kernel version: ' + s.get_platform_version())
- if s.get_platform_is_smp():
- print(' + SMP kernel: yes')
- else:
- print(' + SMP kernel: no')
- print(' + Machine name: ' + s.get_platform_machine())
- print(' + Uptime: %d seconds' % (s.get_uptime()))
- l = s.get_loadavg()
- print(' + Loadavg: %f %f %f' % (l[0], l[1], l[2]))
- print('\nMemory');
- print(' + Total: %d bytes' % (s.get_mem_total()))
- print(' + Free: %d bytes' % (s.get_mem_free()))
- print(' + Cached: %d bytes' % (s.get_mem_cached()))
- print(' + Buffers: %d bytes' % (s.get_mem_buffers()))
- print(' + Swap total: %d bytes' % (s.get_mem_swap_total()))
- print(' + Swap free: %d bytes' % (s.get_mem_swap_free()))
- print('\nNetwork');
- print(' + Hostname: ' + s.get_hostname())
- print('')
- if __name__ == '__main__':
- main()
|