monkey/infection_monkey/system_info/linux_info_collector.py

33 lines
781 B
Python
Raw Normal View History

import logging
2015-12-09 22:33:44 +08:00
from . import InfoCollector
2018-05-16 20:19:59 +08:00
from SSH_info_collector import SSHCollector
2015-12-09 22:33:44 +08:00
__author__ = 'uri'
LOG = logging.getLogger(__name__)
2015-12-09 22:33:44 +08:00
class LinuxInfoCollector(InfoCollector):
"""
System information collecting module for Linux operating systems
"""
def __init__(self):
2015-12-09 22:33:44 +08:00
super(LinuxInfoCollector, self).__init__()
def get_info(self):
"""
Collect Linux system information
Hostname, process list and network subnets
:return: Dict of system information
"""
LOG.debug("Running Linux collector")
2015-12-09 22:33:44 +08:00
self.get_hostname()
self.get_process_list()
2017-09-10 18:11:51 +08:00
self.get_network_info()
self.get_azure_info()
self.info['ssh_info'] = SSHCollector.get_info()
return self.info
2018-05-16 20:19:59 +08:00