2017-12-31 19:46:07 +08:00
|
|
|
import logging
|
|
|
|
|
2015-12-09 22:33:44 +08:00
|
|
|
from . import InfoCollector
|
|
|
|
|
2015-11-30 21:29:30 +08:00
|
|
|
__author__ = 'uri'
|
|
|
|
|
2017-12-31 19:46:07 +08:00
|
|
|
LOG = logging.getLogger(__name__)
|
|
|
|
|
2015-11-30 21:29:30 +08:00
|
|
|
|
2015-12-09 22:33:44 +08:00
|
|
|
class LinuxInfoCollector(InfoCollector):
|
2015-11-30 21:29:30 +08:00
|
|
|
"""
|
|
|
|
System information collecting module for Linux operating systems
|
|
|
|
"""
|
|
|
|
|
|
|
|
def __init__(self):
|
2015-12-09 22:33:44 +08:00
|
|
|
super(LinuxInfoCollector, self).__init__()
|
2015-11-30 21:29:30 +08:00
|
|
|
|
|
|
|
def get_info(self):
|
2017-12-31 19:46:07 +08:00
|
|
|
"""
|
|
|
|
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()
|
2018-03-22 22:44:56 +08:00
|
|
|
self.get_azure_info()
|
2015-11-30 21:29:30 +08:00
|
|
|
return self.info
|