博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Django项目:CMDB(服务器硬件资产自动采集系统)--11--07CMDB文件模式测试采集硬件数据...
阅读量:4678 次
发布时间:2019-06-09

本文共 78183 字,大约阅读时间需要 260 分钟。

 

1 #settings.py 2 # ————————01CMDB获取服务器基本信息———————— 3 import os 4  5 BASEDIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))##当前路径 6  7 # 采集资产的方式,选项有:agent(默认), salt, ssh 8 MODE = 'agent' 9 10 # ————————01CMDB获取服务器基本信息————————11 12 # ————————02CMDB将服务器基本信息提交到API接口————————13 # 资产信息API14 # ————————06CMDB测试Linux系统采集硬件数据的命令————————15 # ASSET_API = "http://127.0.0.1:8000/api/asset"16 ASSET_API = "http://192.168.80.53:8000/api/asset"17 # ————————06CMDB测试Linux系统采集硬件数据的命令————————18 19 # ————————02CMDB将服务器基本信息提交到API接口————————20 21 # ————————03CMDB信息安全API接口交互认证————————22 # 用于API认证的KEY23 KEY = '299095cc-1330-11e5-b06a-a45e60bec08b' #认证的密码24 # 用于API认证的请求头25 AUTH_KEY_NAME = 'auth-key'26 # ————————03CMDB信息安全API接口交互认证————————27 28 29 # ————————04CMDB本地(Agent)模式客户端唯一标识(ID)————————30 # Agent模式保存服务器唯一ID的文件31 CERT_FILE_PATH = os.path.join(BASEDIR, 'config', 'cert') #文件路径32 # ————————04CMDB本地(Agent)模式客户端唯一标识(ID)————————33 34 # ————————05CMDB采集硬件数据的插件————————35 # 采集硬件数据的插件36 PLUGINS_DICT = {37     'cpu': 'src.plugins.cpu.CpuPlugin',38     'disk': 'src.plugins.disk.DiskPlugin',39     'main_board': 'src.plugins.main_board.MainBoardPlugin',40     'memory': 'src.plugins.memory.MemoryPlugin',41     'nic': 'src.plugins.nic.NicPlugin',42 }43 # ————————05CMDB采集硬件数据的插件————————44 45 # ————————07CMDB文件模式测试采集硬件数据————————46 # 是否测试模式,测试模时候数据从files目录下读取信息  选项有:#True  False47 TEST_MODE = True48 # ————————07CMDB文件模式测试采集硬件数据————————
#settings.py

 

 

1 #base.py 2 # ————————01CMDB获取服务器基本信息———————— 3 from config import settings  #配置文件 4  5 class BasePlugin(object): 6     def __init__(self, hostname=''): 7  8         # ————————07CMDB文件模式测试采集硬件数据———————— 9         self.test_mode = settings.TEST_MODE#是否测试模式10         # ————————07CMDB文件模式测试采集硬件数据————————11 12         if hasattr(settings, 'MODE'):13             self.mode = settings.MODE #采集资产的方式14         else:15             self.mode = 'agent'#默认,采集资产的方式16     def execute(self):17 18         # ————————06CMDB测试Linux系统采集硬件数据的命令————————19         # return self.windows()20         try:#判断系统平台类型21 22             # ————————07CMDB文件模式测试采集硬件数据————————23             if self.test_mode:  # 是否测试模式24                 return self.test()  # 测试模式25             # ————————07CMDB文件模式测试采集硬件数据————————26 27             import platform  # 获取操作系统信息 的模块28             if platform.system() == 'Linux':29                 return self.linux() #执行 #def linux(self):30             elif platform.system() == 'Windows':31                 return self.windows() #  执行 #def windows(self):32         except Exception as e:33             return '未知的系统平台类型!'34         # ————————06CMDB测试Linux系统采集硬件数据的命令————————35 36     def windows(self):37         raise Exception('您必须实现windows的方法')38 # ————————01CMDB获取服务器基本信息————————39 40     # ————————06CMDB测试Linux系统采集硬件数据的命令————————41     def linux(self):42         raise Exception('您必须实现linux的方法')43     # ————————06CMDB测试Linux系统采集硬件数据的命令————————44 45     # ————————07CMDB文件模式测试采集硬件数据————————46     def test(self):#测试模式47         raise Exception('您必须实现test的方法')48     # ————————07CMDB文件模式测试采集硬件数据————————
#base.py

 

 

 

 

1 # basic.py  2 # ————————01CMDB获取服务器基本信息————————  3 from .base import BasePlugin #采集资产的方式  4 from lib.response import BaseResponse   #提交数据的类型  5 import platform  #platform模块给我们提供了很多方法去获取操作系统的信息  6   7 # ————————06CMDB测试Linux系统采集硬件数据的命令————————  8 # import wmi#Windows操作系统上管理数据和操作的基础设施   #linux写无法导入这个模块  9 # ————————06CMDB测试Linux系统采集硬件数据的命令———————— 10 """ 11 本模块基于windows操作系统,依赖wmi和win32com库,需要提前使用pip进行安装, 12 我们依然可以通过pip install pypiwin32来安装win32com模块 13 或者下载安装包手动安装。 14 """ 15  16 class BasicPlugin(BasePlugin): 17     def os_platform(self):#获取系统平台 18         # ————————07CMDB文件模式测试采集硬件数据———————— 19         # output=platform.system() #windows和Linux 都可以执行 20         # return output.strip()#strip() 方法用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列。 21  22         try: 23             if self.test_mode:  # 是否测试模式 24                 output = 'Linux'  # 选择要测试的系统(windows和Linux或者苹果等未知的系统) 25                 return output.strip()  # strip() 方法用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列。 26             output = platform.system() #windows和Linux 都可以执行 27             return output.strip()  # strip() 方法用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列。 28         except Exception as e: 29             return '未知的系统平台!' 30         # ————————07CMDB文件模式测试采集硬件数据———————— 31  32     def os_version(self):#获取系统版本 33         # output = wmi.WMI().Win32_OperatingSystem()[0].Caption 34         # return output.strip()#strip() 方法用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列。 35  36         # ————————06CMDB测试Linux系统采集硬件数据的命令———————— 37         try: 38  39             # ————————07CMDB文件模式测试采集硬件数据———————— 40             if self.test_mode:  # 是否测试模式 41                 output = """CentOS release 6.6 (Final)\nKernel \r on an \m""" 42                 result = output.strip().split('\n')[0]  # strip() 方法用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列。#split() 通过指定分隔符对字符串进行切片 43                 return result 44             # ————————07CMDB文件模式测试采集硬件数据———————— 45  46             if platform.system() == 'Linux': 47                 import subprocess  # 启动一个新的进程并且与之通信 48                 output = subprocess.getoutput('cat /etc/issue')  # Linux系统下的命令 49                 result = output.strip().split('\n')[0]  # split() 通过指定分隔符对字符串进行切片 50                 # strip() 方法用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列。 51                 return result 52             if platform.system() == 'Windows': 53                 import wmi  # Windows操作系统上管理数据和操作的基础设施   #linux写无法导入这个模块 54                 output = wmi.WMI().Win32_OperatingSystem()[0].Caption  # Windows系统下的命令 55                 result = output.strip() 56                 # strip() 方法用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列。 57                 return result 58         except Exception as e: 59             return '未知的系统版本!' 60         # ————————06CMDB测试Linux系统采集硬件数据的命令———————— 61  62     def os_hostname(self):#获取主机名 63         # output = wmi.WMI().Win32_OperatingSystem()[0].CSName 64         # return output.strip()#strip() 方法用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列。 65  66         # ————————06CMDB测试Linux系统采集硬件数据的命令———————— 67         try: 68  69             # ————————07CMDB文件模式测试采集硬件数据———————— 70             if self.test_mode:  # 是否测试模式 71                 output = 'test.com' 72                 return output.strip()  # strip() 方法用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列。 73             # ————————07CMDB文件模式测试采集硬件数据———————— 74  75             if platform.system() == 'Linux': 76                 import subprocess  # 启动一个新的进程并且与之通信 77                 output = subprocess.getoutput('hostname')  # Linux系统下的命令 78                 return output.strip()  # strip() 方法用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列。 79             elif platform.system() == 'Windows': 80                 import wmi # Windows操作系统上管理数据和操作的基础设施   #linux写无法导入这个模块 81                 output = wmi.WMI().Win32_OperatingSystem()[0].CSName  # Windows系统下的命令 82                 return output.strip()  # strip() 方法用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列。 83         except Exception as e: 84             return '未知的主机名!' 85         # ————————06CMDB测试Linux系统采集硬件数据的命令———————— 86  87     def windows(self): 88         response = BaseResponse()#提交数据的类型 89         try: 90             ret = { 91                 'os_platform': self.os_platform(),#系统平台 92                 'os_version': self.os_version(),#系统版本 93                 'hostname': self.os_hostname(),#主机名 94             } 95             response.data = ret #字典形式 96             print('windows服务器基本信息:',response.data) 97         except Exception as e: 98             response.status = False#获取信息时出现错误 99         return response100     """101     class BaseResponse(object): #提交数据的类型102     def __init__(self):103         self.status = True      #状态104         self.message = None     #消息105         self.data = None        #数据内容106         self.error = None       #错误信息107 108     """109 # ————————01CMDB获取服务器基本信息————————110 111     # ————————06CMDB测试Linux系统采集硬件数据的命令————————112     def linux(self):113         response = self.windows() #因为执行同样的方法,所以,就不重复写。114         print('linux服务器基本信息:', response.data)115         return response116     # ————————06CMDB测试Linux系统采集硬件数据的命令————————117 118     # ————————07CMDB文件模式测试采集硬件数据————————119     def test(self):120         response = self.windows() #因为执行同样的方法,所以,就不重复写。121         print('test服务器基本信息:', response.data)122         return response123     # ————————07CMDB文件模式测试采集硬件数据————————
# basic.py

 

 

 

1 # cpu.py 2 # ————————05CMDB采集硬件数据的插件———————— 3 from .base import BasePlugin  #采集资产的方式  和  系统平台 4 from lib.response import BaseResponse #提交数据的类型(字典) 5  6 # ————————06CMDB测试Linux系统采集硬件数据的命令———————— 7 # import wmi#Windows操作系统上管理数据和操作的基础设施   #linux写无法导入这个模块 8 # ————————06CMDB测试Linux系统采集硬件数据的命令———————— 9 10 class CpuPlugin(BasePlugin):11     def windows(self):12         response = BaseResponse() #提交数据的类型(字典)13         try:14             # ————————06CMDB测试Linux系统采集硬件数据的命令————————15             import wmi#Windows操作系统上管理数据和操作的基础设施   #linux写无法导入这个模块16             # ————————06CMDB测试Linux系统采集硬件数据的命令————————17             output =wmi.WMI().Win32_Processor() #获取CPU相关信息18             response.data = self.windows_parse(output)  #解析相关信息 返回结果 #存到字典19         except Exception as e:20             response.status = False21         return response22 23     @staticmethod#返回函数的静态方法24     def windows_parse(content):25         response = {}26         cpu_physical_set = set()#set()函数创建一个无序不重复元素集,可进行关系测试,删除重复数据,还可以计算交集、差集、并集等。27         for item in content:28             response['cpu_model'] = item.Manufacturer  # cpu型号29             response['cpu_count'] = item.NumberOfCores  # cpu核心个量30             cpu_physical_set.add(item.DeviceID) #CPU物理个量31         response['cpu_physical_count'] = len(cpu_physical_set)#CPU物理个量32         return response #返回结果33 34 # ————————05CMDB采集硬件数据的插件————————35 36     # ————————07CMDB文件模式测试采集硬件数据————————37     def test(self):38         response = BaseResponse() #提交数据的类型(字典)39         import os  # 操作系统层面执行40         from config.settings import BASEDIR  # 获取路径41         try:42             output = open(os.path.join(BASEDIR, 'files/linux_out/cpu.out'), 'r').read() #打开文件获取内容43             response.data = self.linux_parse(output)#解析shell命令返回结果44         except Exception as e:45             response.status = False46         return response47     # ————————07CMDB文件模式测试采集硬件数据————————48 49 # ————————06CMDB测试Linux系统采集硬件数据的命令————————50     def linux(self):51         response = BaseResponse()  # 提交数据的类型(字典)52         try:53             import subprocess  # 启动一个新的进程并且与之通信54             shell_command = "cat /proc/cpuinfo"  # 定义命令 lscpu55             output = subprocess.getoutput(shell_command)  # linux系统上执行的命令56             response.data = self.linux_parse(output)  # 解析shell命令返回结果57         except Exception as e:58             response.status = False59         return response60 61     @staticmethod  # 返回函数的静态方法62     def linux_parse(content):  # 解析shell命令返回结果63         response = {
'cpu_count': 0, 'cpu_physical_count': 0, 'cpu_model': ''}64 cpu_physical_set = set() # set()函数创建一个无序不重复元素集,可进行关系测试,删除重复数据,还可以计算交集、差集、并集等。65 content = content.strip() # strip()方法用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列66 for item in content.split('\n\n'): # split()通过指定分隔符对字符串进行切片67 for row_line in item.split('\n'):68 key, value = row_line.split(':')69 key = key.strip()70 if key == 'processor':71 response['cpu_count'] += 1 # cpu核心个量72 elif key == 'physical id':73 cpu_physical_set.add(value) # CPU物理个量74 elif key == 'model name':75 if not response['cpu_model']:76 response['cpu_model'] = value # cpu型号77 response['cpu_physical_count'] = len(cpu_physical_set) # CPU物理个量78 return response79 # ————————06CMDB测试Linux系统采集硬件数据的命令————————
# cpu.py

 

 

1 # disk.py  2 # ————————05CMDB采集硬件数据的插件————————  3 from .base import BasePlugin  #采集资产的方式  和  系统平台  4 from lib.response import BaseResponse #提交数据的类型(字典)  5 # ————————06CMDB测试Linux系统采集硬件数据的命令————————  6 # import wmi#Windows操作系统上管理数据和操作的基础设施   #linux写无法导入这个模块  7 # ————————06CMDB测试Linux系统采集硬件数据的命令————————  8   9 class DiskPlugin(BasePlugin): 10     def windows(self): 11         response = BaseResponse() #提交数据的类型(字典) 12         try: 13             # ————————06CMDB测试Linux系统采集硬件数据的命令———————— 14             import wmi#Windows操作系统上管理数据和操作的基础设施   #linux写无法导入这个模块 15             # ————————06CMDB测试Linux系统采集硬件数据的命令———————— 16             output =wmi.WMI().Win32_DiskDrive() #获取磁盘相关信息 17             response.data = self.windows_parse(output) #解析相关信息 返回结果 #存到字典 18         except Exception as e: 19             response.status = False 20         return response 21  22     @staticmethod#返回函数的静态方法 23     def windows_parse(content): 24         response = {} 25         for item in content: 26             item_dict = {} 27             item_dict['slot'] = item.Index                      #插槽位 28             item_dict['pd_type'] = item.InterfaceType           #磁盘型号 29             item_dict['capacity'] = round(int(item.Size) / (1024**3))   # 磁盘容量 30             item_dict['model'] = item.Model  #磁盘类型 31             response[item_dict['slot']] = item_dict #分割存每个 磁盘信息 32         return response #返回结果 33 # ————————05CMDB采集硬件数据的插件———————— 34  35     # ————————07CMDB文件模式测试采集硬件数据———————— 36     def test(self): 37         response = BaseResponse() #提交数据的类型(字典) 38         import os  # 操作系统层面执行 39         from config.settings import BASEDIR  # 获取路径 40         try: 41             output = open(os.path.join(BASEDIR, 'files/linux_out/disk.out'), 'r').read() #打开文件获取内容 linux_virtual_out  linux_out 42             response.data = self.linux_parse(output)#解析shell命令返回结果 43         except Exception as e:#如果获取内容错误或者解析错误就换一个方式 44             try: 45                 output = open(os.path.join(BASEDIR, 'files/linux_virtual_out/disk.out'),'r').read()  # 打开文件获取内容 linux_virtual_out  linux_out 46                 response.data = self.linux_virtual_parse(output)  # 解析shell命令返回结果 47             except Exception as e:#如果 出现未知错误 48                 response.status = False 49         return response 50  51     # ————————07CMDB文件模式测试采集硬件数据———————— 52  53  54     # ————————06CMDB测试Linux系统采集硬件数据的命令———————— 55     def linux(self): 56         response = BaseResponse() #提交数据的类型(字典) 57         try: 58             import subprocess  # 启动一个新的进程并且与之通信 59             shell_command = "sudo MegaCli  -PDList -aALL"  #定义命令#需要安装 MegaCli 模块 60             output = subprocess.getoutput(shell_command) #linux系统上执行的命令 61             if 'MegaCli'in output: 62                 shell_command = "lsblk"  # 虚拟机 #lsblk 63                 output = subprocess.getoutput(shell_command)  # linux系统上执行的命令 64                 response.data = self.linux_virtual_parse(output)  # 解析shell命令返回结果 65             else: 66                 response.data = self.linux_parse(output)#解析shell命令返回结果 67         except Exception as e:  # 如果 出现未知错误 68             response.status = False 69         return response 70  71     def linux_virtual_parse(self, content):  # 解析shell命令返回结果 72         content = [i for i in content.split('\n') if i != '']  # split()通过指定分隔符对字符串进行切片 73         key_list = [i for i in content[0].split(' ') if i != '']  # split()通过指定分隔符对字符串进行切片 74         key_list[0] = 'slot'  # 替换key的名字 75         key_list[3] = 'capacity' 76         key_list[5] = 'pd_type' 77         ram_dict = {} 78         for i in content[1:]:  # 从列表下标1开始循环 79             segment = {} 80             value = [x for x in i.split(' ') if x != '']  # 如果不是空值就循环   # split()通过指定分隔符对字符串进行切片 81             filter = str(value)  # 列表转成字符串进行判断 82             if '攢' not in filter:  # '─'  '攢' #二级逻辑硬盘 83                 if '─' not in filter:  # '─'  '攢' #二级逻辑硬盘 84                     list = zip(key_list, value)  # zip() 函数用于将可迭代的对象作为参数,将对象中对应的元素打包成一个个元组,然后返回由这些元组组成的列表。 85                     for k, v in list: 86                         if k == 'capacity':  # 处理单位问题 87                             if 'G' in v: 88                                 l = v.split('G')  # split()通过指定分隔符对字符串进行切片 89                                 v = l[0] 90                             if 'M' in v:  # 处理单位问题 91                                 l = v.split('M')  # split()通过指定分隔符对字符串进行切片 92                                 s = l[0] 93                                 m = int(s) 94                                 v = m / 1024 95                         segment[k] = v 96                     ram_dict[value[0]] = segment 97         return ram_dict 98  99     def linux_parse(self, content):  # 解析shell命令返回结果100         import re  # 正则表达式101         response = {}102         result = []103         for row_line in content.split("\n\n\n\n"):  # split()通过指定分隔符对字符串进行切片104             result.append(row_line)  # 添加到列表105         for item in result:  # 循环列表106             temp_dict = {}107             for row in item.split('\n'):  # split()通过指定分隔符对字符串进行切片108                 if not row.strip():  # strip()方法用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列109                     continue110                 if len(row.split(':')) != 2:  # 测试长度111                     continue112                 key, value = row.split(':')  # split()通过指定分隔符对字符串进行切片113                 name = self.mega_patter_match(key)114                 if name:115                     if key == 'Raw Size':  # 磁盘容量116                         raw_size = re.search('(\d+\.\d+)',117                                              value.strip())  # Raw Size: 279.396 GB [0x22ecb25c Sectors]118                         if raw_size:119                             temp_dict[name] = raw_size.group()120                         else:121                             raw_size = '0'122                     else:123                         temp_dict[name] = value.strip()  # 磁盘型号  #磁盘类型124             if temp_dict:125                 response[temp_dict['slot']] = temp_dict  # 插槽位 #分割存每个 磁盘信息126         return response127 128     @staticmethod  # 返回函数的静态方法129     def mega_patter_match(needle):130         grep_pattern = {
'Slot': 'slot', 'Raw Size': 'capacity', 'Inquiry': 'model', 'PD Type': 'pd_type'}131 for key, value in grep_pattern.items():132 if needle.startswith(key): # 确定此字符串实例的开头是否与指定的字符串匹配133 return value134 return False135 # ————————06CMDB测试Linux系统采集硬件数据的命令————————
# disk.py

 

 

 

1 # main_board.py 2 # ————————05CMDB采集硬件数据的插件———————— 3 from .base import BasePlugin #采集资产的方式  和  系统平台 4 from lib.response import BaseResponse  #提交数据的类型(字典) 5 # ————————06CMDB测试Linux系统采集硬件数据的命令———————— 6 # import wmi#Windows操作系统上管理数据和操作的基础设施   #linux写无法导入这个模块 7 # ————————06CMDB测试Linux系统采集硬件数据的命令———————— 8  9 class MainBoardPlugin(BasePlugin):10     def windows(self):11         response = BaseResponse() #提交数据的类型(字典)12         try:13             # ————————06CMDB测试Linux系统采集硬件数据的命令————————14             import wmi#Windows操作系统上管理数据和操作的基础设施   #linux写无法导入这个模块15             # ————————06CMDB测试Linux系统采集硬件数据的命令————————16             output =wmi.WMI().Win32_BaseBoard() #获取主板相关信息17             response.data = self.windows_parse(output)  #解析相关信息 返回结果 #存到字典18         except Exception as e:19             response.status = False20         return response21 22     @staticmethod#返回函数的静态方法23     def windows_parse(content):24         response = {}25         for item in content:26             response['Manufacturer'] = item.Manufacturer #主板制造商27             response['model'] = item.Name                 #主板型号28             response['sn'] = item.SerialNumber             #主板SN号29         return response #返回结果30 # ————————05CMDB采集硬件数据的插件————————31 32     # ————————07CMDB文件模式测试采集硬件数据————————33     def test(self):34         response = BaseResponse() #提交数据的类型(字典)35         import os  # 操作系统层面执行36         from config.settings import BASEDIR  # 获取路径37         try:38             output = open(os.path.join(BASEDIR, 'files/linux_out/board.out'), 'r').read() #打开文件获取内容39             response.data = self.linux_parse(output)#解析shell命令返回结果40         except Exception as e:41             response.status = False42         return response43     # ————————07CMDB文件模式测试采集硬件数据————————44 45 # ————————06CMDB测试Linux系统采集硬件数据的命令————————46     def linux(self):47         response = BaseResponse() #提交数据的类型(字典)48         try:49             import subprocess  # 启动一个新的进程并且与之通信50             shell_command = "sudo dmidecode -t1" #定义命令51             output =subprocess.getoutput(shell_command) #linux系统上执行的命令52             response.data = self.linux_parse(output) #解析shell命令返回结果53         except Exception as e:54             response.status = False55         return response56 57     def linux_parse(self, content):#解析shell命令返回结果58         result = {}59         key_map = {
'Manufacturer': 'manufacturer', 'Product Name': 'model','Serial Number': 'sn',}60 for item in content.split('\n'): #split()通过指定分隔符对字符串进行切片61 row_data = item.strip().split(':') #strip()方法用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列62 if len(row_data) == 2:63 if row_data[0] in key_map:#如果在需要的字典里64 result[key_map[row_data[0]]] = row_data[1].strip() if row_data[1] else row_data[1]65 return result66 # ————————06CMDB测试Linux系统采集硬件数据的命令————————
# main_board.py

 

 

 

 

1 # memory.py  2 # ————————05CMDB采集硬件数据的插件————————  3 from .base import BasePlugin  #采集资产的方式  和  系统平台  4 from lib.response import BaseResponse #提交数据的类型(字典)  5 # ————————06CMDB测试Linux系统采集硬件数据的命令————————  6 # import wmi#Windows操作系统上管理数据和操作的基础设施   #linux写无法导入这个模块  7 # ————————06CMDB测试Linux系统采集硬件数据的命令————————  8   9 class MemoryPlugin(BasePlugin): 10     def windows(self): 11         response = BaseResponse()  #提交数据的类型(字典) 12         try: 13             # ————————06CMDB测试Linux系统采集硬件数据的命令———————— 14             import wmi#Windows操作系统上管理数据和操作的基础设施   #linux写无法导入这个模块 15             # ————————06CMDB测试Linux系统采集硬件数据的命令———————— 16             output =wmi.WMI().Win32_PhysicalMemory()  #获取内存相关信息 17             response.data = self.windows_parse(output) 18         except Exception as e: 19             response.status = False 20         return response 21  22     @staticmethod#返回函数的静态方法 23     def windows_parse(content): 24         response={} 25         for item in content: 26             item_dict = {} 27             item_dict['slot'] = item.DeviceLocator                          #插槽位 28             item_dict['manufacturer'] = item.Manufacturer                   # 内存制造商 29             item_dict['model'] =item.FormFactor                             # 内存型号 30             item_dict['Capacity'] = round(int(item.Capacity) / (1024**3))   # 内存容量 31             item_dict['sn'] = item.SerialNumber                              #内存SN号 32             item_dict['speed'] = item.Speed                                 #内存速度 33             response[item_dict['slot']] = item_dict                         #分割存每条  内存信息 34         return response 35  36 # ————————05CMDB采集硬件数据的插件———————— 37     # ————————07CMDB文件模式测试采集硬件数据———————— 38     def test(self): 39         response = BaseResponse() #提交数据的类型(字典) 40         import os  # 操作系统层面执行 41         from config.settings import BASEDIR  # 获取路径 42         try: 43             output = open(os.path.join(BASEDIR, 'files/linux_out/memory.out'), 'r').read()  #打开文件获取内容 linux_virtual_out linux_out 44             response.data = self.linux_parse(output)  # 解析shell命令返回结果 45         except Exception as e:#如果获取内容错误或者解析错误就换一个方式 46             try: 47                 output = open(os.path.join(BASEDIR, 'files/linux_virtual_out/memory.out'),'r').read()  # 打开文件获取内容 linux_virtual_out  linux_out 48                 response.data = self.linux_virtual_parse(output)  # 解析shell命令返回结果 49             except Exception as e: 50                 response.status = False 51         return response 52     # ————————07CMDB文件模式测试采集硬件数据———————— 53  54  55     # ————————06CMDB测试Linux系统采集硬件数据的命令———————— 56     def linux(self): 57         response = BaseResponse() #提交数据的类型(字典) 58         try: 59             import subprocess  # 启动一个新的进程并且与之通信 60             shell_command = "sudo dmidecode  -q -t 17 2>/dev/null" #定义命令 cat /proc/swaps   #swapon 61             output = subprocess.getoutput(shell_command) #linux系统上执行的命令 62             if not output: 63                 shell_command = "swapon"  # 定义命令 cat /proc/swaps   #swapon 64                 output = subprocess.getoutput(shell_command)  # linux系统上执行的命令 65                 response.data = self.linux_virtual_parse(output)  # 解析shell命令返回结果 66             else: 67                 response.data = self.linux_parse(output) # 解析shell命令返回结果 68         except Exception as e:  # 如果 出现未知错误 69             response.status = False 70         return response 71  72     def convert_mb_to_gb(self,value, default=0):#转换单位 73         try: 74             value = value.strip('MB') #strip()方法用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列 75             result = int(value) 76         except Exception as e: 77             result = default 78         return result 79  80     def linux_virtual_parse(self, content):  # 解析shell命令返回结果 81         content = [i for i in content.split('\n') if i != '']  # split()通过指定分隔符对字符串进行切片 82         key_list = [i for i in content[0].split(' ') if i != '']  # split()通过指定分隔符对字符串进行切片 83         key_list[0] = 'slot'  #替换key的名字 84         key_list[1] = 'model' 85         key_list[2] = 'capacity' 86         ram_dict = {} 87         for i in content[1:]:  # 从列表下标1开始循环 88             segment = {} 89             value = [x for x in i.split(' ') if x != '']#如果不是空值就循环   # split()通过指定分隔符对字符串进行切片 90             list = zip(key_list, value)  # zip() 函数用于将可迭代的对象作为参数,将对象中对应的元素打包成一个个元组,然后返回由这些元组组成的列表。 91             for k, v in list: 92                 if k=='capacity': #处理单位问题 93                     if 'M' in v: 94                         l = v.split('M') # split()通过指定分隔符对字符串进行切片 95                         v = l[0] 96                     if 'G' in v:  # 处理单位问题 97                         l = v.split('G') # split()通过指定分隔符对字符串进行切片 98                         s = l[0] 99                         m = int(s)100                         v = m * 1024101                 segment[k] = v102             ram_dict[value[0]] = segment103         return ram_dict104 105     def linux_parse(self, content): # 解析shell命令返回结果106         ram_dict = {}107         key_map = {
'Size': 'capacity','Locator': 'slot','Type': 'model','Speed': 'speed',108 'Manufacturer': 'manufacturer','Serial Number': 'sn',}109 devices = content.split('Memory Device') #split()通过指定分隔符对字符串进行切片110 for item in devices:111 item = item.strip() #strip()方法用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列112 if not item:113 continue114 if item.startswith('#'): #startswith()方法用于检查字符串是否是以指定子字符串开头115 continue116 segment = {}117 lines = item.split('\n\t') #split()通过指定分隔符对字符串进行切片118 for line in lines:119 if len(line.split(':')) > 1: #split()通过指定分隔符对字符串进行切片120 key, value = line.split(':') #split()通过指定分隔符对字符串进行切片121 else:122 key = line.split(':')[0] #split()通过指定分隔符对字符串进行切片123 value = ""124 if key in key_map:125 if key == 'Size': # 内存容量126 segment[key_map['Size']] = self.convert_mb_to_gb(value, 0) #转换单位127 else:128 segment[key_map[key.strip()]] = value.strip() #strip()方法用于移除字符串头尾指定的字符(默认为空格或换行符)或字符序列129 ram_dict[segment['slot']] = segment #插槽位 #分割存每条 内存信息130 return ram_dict131 # ————————06CMDB测试Linux系统采集硬件数据的命令————————
# memory.py

 

 

 

1 # nic.py  2 # ————————05CMDB采集硬件数据的插件————————  3 from .base import BasePlugin  #采集资产的方式  和  系统平台  4 from lib.response import BaseResponse #提交数据的类型(字典)  5 # ————————06CMDB测试Linux系统采集硬件数据的命令————————  6 # import wmi#Windows操作系统上管理数据和操作的基础设施   #linux写无法导入这个模块  7 # ————————06CMDB测试Linux系统采集硬件数据的命令————————  8   9 class NicPlugin(BasePlugin): 10     def windows(self): 11         response = BaseResponse() #提交数据的类型(字典) 12         try: 13             # ————————06CMDB测试Linux系统采集硬件数据的命令———————— 14             import wmi#Windows操作系统上管理数据和操作的基础设施   #linux写无法导入这个模块 15             # ————————06CMDB测试Linux系统采集硬件数据的命令———————— 16             output =wmi.WMI().Win32_NetworkAdapterConfiguration() #获取网卡相关信息 17             response.data = self.windows_parse(output) #解析相关信息 返回结果 #存到字典 18         except Exception as e: 19             response.status = False 20         return response 21  22     @staticmethod#返回函数的静态方法 23     def windows_parse(content): 24         response={} 25         IPCM = 0  # 权重 26         for item in content: 27             if item.IPConnectionMetric: # 权重 28                 if item.IPConnectionMetric > IPCM: # 权重 #防止虚拟网卡 29                     item_dict = {} 30                     name=item.ServiceName                       # 网卡名称 31                     item_dict['hwaddr'] = item.MACAddress      # 网卡MAC地址 32                     item_dict['ipaddrs'] = item.IPAddress[0]    # IP地址 33                     item_dict['netmask'] = item.IPSubnet[0]     # IP子网掩码 34                     item_dict['up'] = item.IPEnabled            #是否有启用 35                     response[name] = item_dict 36                     IPCM = item.IPConnectionMetric  # 权重 37         return response 38 # ————————05CMDB采集硬件数据的插件———————— 39  40     # ————————07CMDB文件模式测试采集硬件数据———————— 41     def test(self): 42         response = BaseResponse() #提交数据的类型(字典) 43         import os  # 操作系统层面执行 44         from config.settings import BASEDIR  # 获取路径 45         try: 46             output = open(os.path.join(BASEDIR, 'files/linux_out/nic.out'), 'r').read()  #打开文件获取内容 47             interfaces_info = self._interfaces_ip(output)  #接口 # 解析shell命令返回结果 48             self.standard(interfaces_info) # 内容进行 标准化 49             response.data = interfaces_info # 解析shell命令返回结果 50         except Exception as e: 51             response.status = False 52         return response 53     # ————————07CMDB文件模式测试采集硬件数据———————— 54  55  56     # ————————06CMDB测试Linux系统采集硬件数据的命令———————— 57     def linux(self): 58         response = BaseResponse() #提交数据的类型(字典) 59         try: 60             interfaces_info = self.linux_interfaces() #linux系统上执行的命令 61             self.standard(interfaces_info)  # 内容进行 标准化 62             response.data = interfaces_info # 解析shell命令返回结果 63         except Exception as e: 64             response.status = False 65         return response 66  67     def standard(self, interfaces_info):# 内容进行 标准化 68         for key, value in interfaces_info.items(): 69             ipaddrs = set()#set()函数创建一个无序不重复元素集,可进行关系测试,删除重复数据,还可以计算交集、差集、并集等。 70             netmask = set() 71             if not 'inet' in value: 72                 value['ipaddrs'] = ''           # IP地址 73                 value['netmask'] = ''           # IP子网掩码 74             else: 75                 for item in value['inet']: 76                     ipaddrs.add(item['address'])  # IP地址 77                     netmask.add(item['netmask'])  # IP子网掩码 78                 value['ipaddrs'] = '/'.join(ipaddrs) # IP地址 79                 value['netmask'] = '/'.join(netmask) # IP子网掩码 80                 del value['inet'] 81  82     def linux_interfaces(self):#获得* NIX / BSD变种接口信息 83         ifaces = dict() #dict() 函数用于创建一个字典。返回一个字典。 84         ip_path = 'ip' 85         if ip_path: 86             # ————————在使用#linux系统上执行的命令时开启———————— 87             import subprocess  # 启动一个新的进程并且与之通信 88             cmd1 = subprocess.getoutput('sudo {0} link show'.format(ip_path)) #定义命令ip link show 89             cmd2 = subprocess.getoutput('sudo {0} addr show'.format(ip_path)) #定义命令ip addr show 90             ifaces = self._interfaces_ip(cmd1 + '\n' + cmd2)  #linux系统上执行的命令 #接口 # 解析shell命令返回结果 91             # ————————在使用#linux系统上执行的命令时开启———————— 92         return ifaces 93  94     def which(self, exe): 95         import os  # 操作系统层面执行 96         def _is_executable_file_or_link(exe): 97             # 检查操作系统。X_OK不足够了,因为目录可能会执行 98             return (os.access(exe, os.X_OK) and 99                     (os.path.isfile(exe) or os.path.islink(exe)))100 101         if exe:102             if _is_executable_file_or_link(exe):103                 # executable in cwd or fullpath104                 return exe105 106             # 默认路径基于busybox的默认107             default_path = '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin'108             search_path = os.environ.get('PATH', default_path)109             path_ext = os.environ.get('PATHEXT', '.EXE')110             ext_list = path_ext.split(';')111 112             search_path = search_path.split(os.pathsep)113             if True:114                 """115             # 添加任何dirs default_path search_path不。如果116             # 没有PATH变量中发现操作系统。环境,那么这将是117             # 无为法。这将确保所有dirs default_path118             # 搜索,让salt.utils.which()调用时工作得很好119             # salt-call从cron(取决于平台120             # 有一个极其有限的路径)。121               """122                 search_path.extend(123                     [124                         x for x in default_path.split(os.pathsep)125                         if x not in search_path126                     ]127                 )128             for path in search_path:129                 full_path = os.path.join(path, exe)130                 if _is_executable_file_or_link(full_path):131                     return full_path132         return None133 134     def _number_of_set_bits_to_ipv4_netmask(self, set_bits):  # pylint: disable=C0103135         '''136         返回一个整数表示的IPv4网络掩码,面具。137 138         Ex. 0xffffff00 -> '255.255.255.0'139         '''140         return self.cidr_to_ipv4_netmask(self._number_of_set_bits(set_bits))141     def cidr_to_ipv4_netmask(self, cidr_bits):142         '''143         返回一个IPv4网络掩码144         '''145         try:146             cidr_bits = int(cidr_bits)147             if not 1 <= cidr_bits <= 32:148                 return ''149         except ValueError:150             return ''151         netmask = ''152         for idx in range(4):153             if idx:154                 netmask += '.'155             if cidr_bits >= 8:156                 netmask += '255'157                 cidr_bits -= 8158             else:159                 netmask += '{0:d}'.format(256 - (2 ** (8 - cidr_bits)))160                 cidr_bits = 0161         return netmask162     def _number_of_set_bits(self, x):163         '''164         返回的比特数,设置在一个32位整数165         #来自http://stackoverflow.com/a/4912729166         '''167         x -= (x >> 1) & 0x55555555168         x = ((x >> 2) & 0x33333333) + (x & 0x33333333)169         x = ((x >> 4) + x) & 0x0f0f0f0f170         x += x >> 8171         x += x >> 16172         return x & 0x0000003f173 174     def _interfaces_ip(self, out): #接口 # 解析shell命令返回结果175         import re  # 正则表达式176         '''177       使用ip来返回一个字典的接口的各种信息178       每个(向上/向下状态、ip地址、子网掩码和hwaddr)179         '''180         ret = dict()181         right_keys = ['name', 'hwaddr', 'up', 'netmask', 'ipaddrs']182 183         def parse_network(value, cols):184             '''185           子网掩码,返回一个元组的ip广播186           基于当前的关口187             '''188             brd = None189             if '/' in value:  # 我们有一个CIDR在这个地址190                 ip, cidr = value.split('/')  # pylint:禁用= C0103191             else:192                 ip = value  # pylint:禁用= C0103193                 cidr = 32194 195             if type_ == 'inet':196                 mask = self.cidr_to_ipv4_netmask(int(cidr))197                 if 'brd' in cols:198                     brd = cols[cols.index('brd') + 1]199             return (ip, mask, brd)200 201         groups = re.compile('\r?\n\\d').split(out)202         for group in groups:203             iface = None204             data = dict()205 206             for line in group.splitlines():207                 if ' ' not in line:208                     continue209                 match = re.match(r'^\d*:\s+([\w.\-]+)(?:@)?([\w.\-]+)?:\s+<(.+)>', line)210                 if match:211                     iface, parent, attrs = match.groups()212                     if 'UP' in attrs.split(','):213                         data['up'] = True214                     else:215                         data['up'] = False216                     if parent and parent in right_keys:217                         data[parent] = parent218                     continue219 220                 cols = line.split()221                 if len(cols) >= 2:222                     type_, value = tuple(cols[0:2])223                     iflabel = cols[-1:][0]224                     if type_ in ('inet',):225                         if 'secondary' not in cols:226                             ipaddr, netmask, broadcast = parse_network(value, cols)227                             if type_ == 'inet':228                                 if 'inet' not in data:229                                     data['inet'] = list()230                                 addr_obj = dict()231                                 addr_obj['address'] = ipaddr232                                 addr_obj['netmask'] = netmask233                                 addr_obj['broadcast'] = broadcast234                                 data['inet'].append(addr_obj)235 236                         else:237                             if 'secondary' not in data:238                                 data['secondary'] = list()239                             ip_, mask, brd = parse_network(value, cols)240                             data['secondary'].append({241                                 'type': type_,242                                 'address': ip_,243                                 'netmask': mask,244                                 'broadcast': brd,245                             })246                             del ip_, mask, brd247                     elif type_.startswith('link'):248                         data['hwaddr'] = value249             if iface:250                 if iface.startswith('pan') or iface.startswith('lo') or iface.startswith('v'):251                     del iface, data252                 else:253                     ret[iface] = data254                     del iface, data255         return ret256     # ————————06CMDB测试Linux系统采集硬件数据的命令————————
# nic.py

 

 

{
"os_platform": "Linux", "os_version": "CentOS release 6.6 (Final)","hostname": "c1.com","cpu": {
"status": true, "message": null,"data":{
"cpu_count": 24, "cpu_physical_count": 2, "cpu_model": " Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz"},"error": null},"disk": {
"status": true, "message": null, "data":{
"0": {
"slot": "0", "pd_type": "SAS", "capacity": "279.396", "model": "SEAGATE ST300MM0006 LS08S0K2B5NV"}, "1": {
"slot": "1", "pd_type": "SAS", "capacity": "279.396", "model": "SEAGATE ST300MM0006 LS08S0K2B5AH"}, "2": {
"slot": "2", "pd_type": "SATA", "capacity": "476.939", "model": "S1SZNSAFA01085L Samsung SSD 850 PRO 512GB EXM01B6Q"}, "3": {
"slot": "3", "pd_type": "SATA", "capacity": "476.939", "model": "S1AXNSAF912433K Samsung SSD 840 PRO Series DXM06B0Q"}, "4": {
"slot": "4", "pd_type": "SATA", "capacity": "476.939", "model": "S1AXNSAF303909M Samsung SSD 840 PRO Series DXM05B0Q"}, "5": {
"slot": "5", "pd_type": "SATA", "capacity": "476.939", "model": "S1AXNSAFB00549A Samsung SSD 840 PRO Series DXM06B0Q"}},"error": null}, "main_board": {
"status": true, "message": null, "data":{
"manufacturer": "Parallels Software International Inc.","model": "Parallels Virtual Platform","sn": "Parallels-1A 1B CB 3B 64 66 4B 13 86 B0 86 FF 7E 2B 20 30"},"error": null},"memory": {
"status": true, "message": null,"data":{
"DIMM #0": {
"capacity": 1024, "slot": "DIMM #0", "model": "DRAM", "speed": "667 MHz", "manufacturer": "Not Specified", "sn": "Not Specified"}, "DIMM #1": {
"capacity": 0, "slot": "DIMM #1", "model": "DRAM", "speed": "667 MHz", "manufacturer": "Not Specified", "sn": "Not Specified"}, "DIMM #2": {
"capacity": 0, "slot": "DIMM #2", "model": "DRAM", "speed": "667 MHz", "manufacturer": "Not Specified", "sn": "Not Specified"}, "DIMM #3": {
"capacity": 0, "slot": "DIMM #3", "model": "DRAM", "speed": "667 MHz", "manufacturer": "Not Specified", "sn": "Not Specified"}, "DIMM #4": {
"capacity": 0, "slot": "DIMM #4", "model": "DRAM", "speed": "667 MHz", "manufacturer": "Not Specified", "sn": "Not Specified"}, "DIMM #5": {
"capacity": 0, "slot": "DIMM #5", "model": "DRAM", "speed": "667 MHz", "manufacturer": "Not Specified", "sn": "Not Specified"}, "DIMM #6": {
"capacity": 0, "slot": "DIMM #6", "model": "DRAM", "speed": "667 MHz", "manufacturer": "Not Specified", "sn": "Not Specified"}, "DIMM #7": {
"capacity": 0, "slot": "DIMM #7", "model": "DRAM", "speed": "667 MHz", "manufacturer": "Not Specified", "sn": "Not Specified"}},"error": null}, "nic": {
"status": true, "message": null, "data":{
"eth0": {
"up": true, "hwaddr": "00:1c:42:a5:57:7a", "ipaddrs": "10.211.55.4", "netmask": "255.255.255.0"}},"error": null}}
all

 

SMBIOS 2.7 present.Handle 0x0001, DMI type 1, 27 bytesSystem Information    Manufacturer: Parallels Software International Inc.    Product Name: Parallels Virtual Platform    Version: None    Serial Number: Parallels-1A 1B CB 3B 64 66 4B 13 86 B0 86 FF 7E 2B 20 30    UUID: 3BCB1B1A-6664-134B-86B0-86FF7E2B2030    Wake-up Type: Power Switch    SKU Number: Undefined    Family: Parallels VM
board.out

 

processor    : 0vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 0siblings    : 12core id        : 0cpu cores    : 6apicid        : 0initial apicid    : 0fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.84clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 1vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 1siblings    : 12core id        : 0cpu cores    : 6apicid        : 32initial apicid    : 32fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.42clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 2vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 0siblings    : 12core id        : 1cpu cores    : 6apicid        : 2initial apicid    : 2fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.84clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 3vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 1siblings    : 12core id        : 1cpu cores    : 6apicid        : 34initial apicid    : 34fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.42clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 4vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 0siblings    : 12core id        : 2cpu cores    : 6apicid        : 4initial apicid    : 4fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.84clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 5vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 1siblings    : 12core id        : 2cpu cores    : 6apicid        : 36initial apicid    : 36fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.42clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 6vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 0siblings    : 12core id        : 3cpu cores    : 6apicid        : 6initial apicid    : 6fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.84clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 7vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 1siblings    : 12core id        : 3cpu cores    : 6apicid        : 38initial apicid    : 38fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.42clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 8vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 0siblings    : 12core id        : 4cpu cores    : 6apicid        : 8initial apicid    : 8fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.84clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 9vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 1siblings    : 12core id        : 4cpu cores    : 6apicid        : 40initial apicid    : 40fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.42clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 10vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 0siblings    : 12core id        : 5cpu cores    : 6apicid        : 10initial apicid    : 10fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.84clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 11vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 1siblings    : 12core id        : 5cpu cores    : 6apicid        : 42initial apicid    : 42fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.42clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 12vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 0siblings    : 12core id        : 0cpu cores    : 6apicid        : 1initial apicid    : 1fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.84clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 13vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 1siblings    : 12core id        : 0cpu cores    : 6apicid        : 33initial apicid    : 33fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.42clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 14vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 0siblings    : 12core id        : 1cpu cores    : 6apicid        : 3initial apicid    : 3fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.84clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 15vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 1siblings    : 12core id        : 1cpu cores    : 6apicid        : 35initial apicid    : 35fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.42clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 16vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 0siblings    : 12core id        : 2cpu cores    : 6apicid        : 5initial apicid    : 5fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.84clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 17vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 1siblings    : 12core id        : 2cpu cores    : 6apicid        : 37initial apicid    : 37fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.42clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 18vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 0siblings    : 12core id        : 3cpu cores    : 6apicid        : 7initial apicid    : 7fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.84clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 19vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 1siblings    : 12core id        : 3cpu cores    : 6apicid        : 39initial apicid    : 39fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.42clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 20vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 0siblings    : 12core id        : 4cpu cores    : 6apicid        : 9initial apicid    : 9fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.84clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 21vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 1siblings    : 12core id        : 4cpu cores    : 6apicid        : 41initial apicid    : 41fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.42clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 22vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 0siblings    : 12core id        : 5cpu cores    : 6apicid        : 11initial apicid    : 11fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.84clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:processor    : 23vendor_id    : GenuineIntelcpu family    : 6model        : 62model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzstepping    : 4cpu MHz        : 2099.921cache size    : 15360 KBphysical id    : 1siblings    : 12core id        : 5cpu cores    : 6apicid        : 43initial apicid    : 43fpu        : yesfpu_exception    : yescpuid level    : 13wp        : yesflags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep ermsbogomips    : 4199.42clflush size    : 64cache_alignment    : 64address sizes    : 46 bits physical, 48 bits virtualpower management:
cpu

 

Adapter #0Enclosure Device ID: 32Slot Number: 0Drive's postion: DiskGroup: 0, Span: 0, Arm: 0Enclosure position: 0Device Id: 0WWN: 5000C5007272C288Sequence Number: 2Media Error Count: 0Other Error Count: 0Predictive Failure Count: 0Last Predictive Failure Event Seq Number: 0PD Type: SASRaw Size: 279.396 GB [0x22ecb25c Sectors]Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]Coerced Size: 278.875 GB [0x22dc0000 Sectors]Firmware state: Online, Spun UpDevice Firmware Level: LS08Shield Counter: 0Successful diagnostics completion on :  N/ASAS Address(0): 0x5000c5007272c289SAS Address(1): 0x0Connected Port Number: 0(path0) Inquiry Data: SEAGATE ST300MM0006     LS08S0K2B5NV            FDE Enable: DisableSecured: UnsecuredLocked: UnlockedNeeds EKM Attention: NoForeign State: None Device Speed: 6.0Gb/s Link Speed: 6.0Gb/s Media Type: Hard Disk DeviceDrive Temperature :29C (84.20 F)PI Eligibility:  No Drive is formatted for PI information:  NoPI: No PIDrive's write cache : DisabledPort-0 :Port status: ActivePort's Linkspeed: 6.0Gb/s Port-1 :Port status: ActivePort's Linkspeed: Unknown Drive has flagged a S.M.A.R.T alert : NoEnclosure Device ID: 32Slot Number: 1Drive's postion: DiskGroup: 0, Span: 0, Arm: 1Enclosure position: 0Device Id: 1WWN: 5000C5007272DE74Sequence Number: 2Media Error Count: 0Other Error Count: 0Predictive Failure Count: 0Last Predictive Failure Event Seq Number: 0PD Type: SASRaw Size: 279.396 GB [0x22ecb25c Sectors]Non Coerced Size: 278.896 GB [0x22dcb25c Sectors]Coerced Size: 278.875 GB [0x22dc0000 Sectors]Firmware state: Online, Spun UpDevice Firmware Level: LS08Shield Counter: 0Successful diagnostics completion on :  N/ASAS Address(0): 0x5000c5007272de75SAS Address(1): 0x0Connected Port Number: 0(path0) Inquiry Data: SEAGATE ST300MM0006     LS08S0K2B5AH            FDE Enable: DisableSecured: UnsecuredLocked: UnlockedNeeds EKM Attention: NoForeign State: None Device Speed: 6.0Gb/s Link Speed: 6.0Gb/s Media Type: Hard Disk DeviceDrive Temperature :29C (84.20 F)PI Eligibility:  No Drive is formatted for PI information:  NoPI: No PIDrive's write cache : DisabledPort-0 :Port status: ActivePort's Linkspeed: 6.0Gb/s Port-1 :Port status: ActivePort's Linkspeed: Unknown Drive has flagged a S.M.A.R.T alert : NoEnclosure Device ID: 32Slot Number: 2Drive's postion: DiskGroup: 1, Span: 0, Arm: 0Enclosure position: 0Device Id: 2WWN: 50025388A075B731Sequence Number: 2Media Error Count: 0Other Error Count: 1158Predictive Failure Count: 0Last Predictive Failure Event Seq Number: 0PD Type: SATARaw Size: 476.939 GB [0x3b9e12b0 Sectors]Non Coerced Size: 476.439 GB [0x3b8e12b0 Sectors]Coerced Size: 476.375 GB [0x3b8c0000 Sectors]Firmware state: Online, Spun UpDevice Firmware Level: 1B6QShield Counter: 0Successful diagnostics completion on :  N/ASAS Address(0): 0x500056b37789abeeConnected Port Number: 0(path0) Inquiry Data: S1SZNSAFA01085L     Samsung SSD 850 PRO 512GB               EXM01B6QFDE Enable: DisableSecured: UnsecuredLocked: UnlockedNeeds EKM Attention: NoForeign State: None Device Speed: 6.0Gb/s Link Speed: 6.0Gb/s Media Type: Solid State DeviceDrive:  Not CertifiedDrive Temperature :25C (77.00 F)PI Eligibility:  No Drive is formatted for PI information:  NoPI: No PIDrive's write cache : DisabledDrive's NCQ setting : DisabledPort-0 :Port status: ActivePort's Linkspeed: 6.0Gb/s Drive has flagged a S.M.A.R.T alert : NoEnclosure Device ID: 32Slot Number: 3Drive's postion: DiskGroup: 1, Span: 0, Arm: 1Enclosure position: 0Device Id: 3WWN: 50025385A02A074FSequence Number: 2Media Error Count: 0Other Error Count: 0Predictive Failure Count: 0Last Predictive Failure Event Seq Number: 0PD Type: SATARaw Size: 476.939 GB [0x3b9e12b0 Sectors]Non Coerced Size: 476.439 GB [0x3b8e12b0 Sectors]Coerced Size: 476.375 GB [0x3b8c0000 Sectors]Firmware state: Online, Spun UpDevice Firmware Level: 6B0QShield Counter: 0Successful diagnostics completion on :  N/ASAS Address(0): 0x500056b37789abefConnected Port Number: 0(path0) Inquiry Data: S1AXNSAF912433K     Samsung SSD 840 PRO Series              DXM06B0QFDE Enable: DisableSecured: UnsecuredLocked: UnlockedNeeds EKM Attention: NoForeign State: None Device Speed: 6.0Gb/s Link Speed: 6.0Gb/s Media Type: Solid State DeviceDrive:  Not CertifiedDrive Temperature :28C (82.40 F)PI Eligibility:  No Drive is formatted for PI information:  NoPI: No PIDrive's write cache : DisabledDrive's NCQ setting : DisabledPort-0 :Port status: ActivePort's Linkspeed: 6.0Gb/s Drive has flagged a S.M.A.R.T alert : NoEnclosure Device ID: 32Slot Number: 4Drive's postion: DiskGroup: 1, Span: 1, Arm: 0Enclosure position: 0Device Id: 4WWN: 50025385A01FD838Sequence Number: 2Media Error Count: 0Other Error Count: 0Predictive Failure Count: 0Last Predictive Failure Event Seq Number: 0PD Type: SATARaw Size: 476.939 GB [0x3b9e12b0 Sectors]Non Coerced Size: 476.439 GB [0x3b8e12b0 Sectors]Coerced Size: 476.375 GB [0x3b8c0000 Sectors]Firmware state: Online, Spun UpDevice Firmware Level: 5B0QShield Counter: 0Successful diagnostics completion on :  N/ASAS Address(0): 0x500056b37789abf0Connected Port Number: 0(path0) Inquiry Data: S1AXNSAF303909M     Samsung SSD 840 PRO Series              DXM05B0QFDE Enable: DisableSecured: UnsecuredLocked: UnlockedNeeds EKM Attention: NoForeign State: None Device Speed: 6.0Gb/s Link Speed: 6.0Gb/s Media Type: Solid State DeviceDrive:  Not CertifiedDrive Temperature :27C (80.60 F)PI Eligibility:  No Drive is formatted for PI information:  NoPI: No PIDrive's write cache : DisabledDrive's NCQ setting : DisabledPort-0 :Port status: ActivePort's Linkspeed: 6.0Gb/s Drive has flagged a S.M.A.R.T alert : NoEnclosure Device ID: 32Slot Number: 5Drive's postion: DiskGroup: 1, Span: 1, Arm: 1Enclosure position: 0Device Id: 5WWN: 50025385A02AB5C9Sequence Number: 2Media Error Count: 0Other Error Count: 0Predictive Failure Count: 0Last Predictive Failure Event Seq Number: 0PD Type: SATARaw Size: 476.939 GB [0x3b9e12b0 Sectors]Non Coerced Size: 476.439 GB [0x3b8e12b0 Sectors]Coerced Size: 476.375 GB [0x3b8c0000 Sectors]Firmware state: Online, Spun UpDevice Firmware Level: 6B0QShield Counter: 0Successful diagnostics completion on :  N/ASAS Address(0): 0x500056b37789abf1Connected Port Number: 0(path0) Inquiry Data: S1AXNSAFB00549A     Samsung SSD 840 PRO Series              DXM06B0QFDE Enable: DisableSecured: UnsecuredLocked: UnlockedNeeds EKM Attention: NoForeign State: None Device Speed: 6.0Gb/s Link Speed: 6.0Gb/s Media Type: Solid State DeviceDrive:  Not CertifiedDrive Temperature :28C (82.40 F)PI Eligibility:  No Drive is formatted for PI information:  NoPI: No PIDrive's write cache : DisabledDrive's NCQ setting : DisabledPort-0 :Port status: ActivePort's Linkspeed: 6.0Gb/s Drive has flagged a S.M.A.R.T alert : NoExit Code: 0x00
disk.out

 

Memory Device    Total Width: 32 bits    Data Width: 32 bits    Size: 1024 MB    Form Factor: DIMM    Set: None    Locator: DIMM #0    Bank Locator: BANK #0    Type: DRAM    Type Detail: EDO    Speed: 667 MHz    Manufacturer: Not Specified    Serial Number: Not Specified    Asset Tag: Not Specified    Part Number: Not Specified    Rank: UnknownMemory Device    Total Width: 32 bits    Data Width: 32 bits    Size: No Module Installed    Form Factor: DIMM    Set: None    Locator: DIMM #1    Bank Locator: BANK #1    Type: DRAM    Type Detail: EDO    Speed: 667 MHz    Manufacturer: Not Specified    Serial Number: Not Specified    Asset Tag: Not Specified    Part Number: Not Specified    Rank: UnknownMemory Device    Total Width: 32 bits    Data Width: 32 bits    Size: No Module Installed    Form Factor: DIMM    Set: None    Locator: DIMM #2    Bank Locator: BANK #2    Type: DRAM    Type Detail: EDO    Speed: 667 MHz    Manufacturer: Not Specified    Serial Number: Not Specified    Asset Tag: Not Specified    Part Number: Not Specified    Rank: UnknownMemory Device    Total Width: 32 bits    Data Width: 32 bits    Size: No Module Installed    Form Factor: DIMM    Set: None    Locator: DIMM #3    Bank Locator: BANK #3    Type: DRAM    Type Detail: EDO    Speed: 667 MHz    Manufacturer: Not Specified    Serial Number: Not Specified    Asset Tag: Not Specified    Part Number: Not Specified    Rank: UnknownMemory Device    Total Width: 32 bits    Data Width: 32 bits    Size: No Module Installed    Form Factor: DIMM    Set: None    Locator: DIMM #4    Bank Locator: BANK #4    Type: DRAM    Type Detail: EDO    Speed: 667 MHz    Manufacturer: Not Specified    Serial Number: Not Specified    Asset Tag: Not Specified    Part Number: Not Specified    Rank: UnknownMemory Device    Total Width: 32 bits    Data Width: 32 bits    Size: No Module Installed    Form Factor: DIMM    Set: None    Locator: DIMM #5    Bank Locator: BANK #5    Type: DRAM    Type Detail: EDO    Speed: 667 MHz    Manufacturer: Not Specified    Serial Number: Not Specified    Asset Tag: Not Specified    Part Number: Not Specified    Rank: UnknownMemory Device    Total Width: 32 bits    Data Width: 32 bits    Size: No Module Installed    Form Factor: DIMM    Set: None    Locator: DIMM #6    Bank Locator: BANK #6    Type: DRAM    Type Detail: EDO    Speed: 667 MHz    Manufacturer: Not Specified    Serial Number: Not Specified    Asset Tag: Not Specified    Part Number: Not Specified    Rank: UnknownMemory Device    Total Width: 32 bits    Data Width: 32 bits    Size: No Module Installed    Form Factor: DIMM    Set: None    Locator: DIMM #7    Bank Locator: BANK #7    Type: DRAM    Type Detail: EDO    Speed: 667 MHz    Manufacturer: Not Specified    Serial Number: Not Specified    Asset Tag: Not Specified    Part Number: Not Specified    Rank: Unknown
memory.out

 

1: lo: 
mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:002: eth0:
mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:1c:42:a5:57:7a brd ff:ff:ff:ff:ff:ff3: virbr0:
mtu 1500 qdisc noqueue state UNKNOWN link/ether 52:54:00:a3:74:29 brd ff:ff:ff:ff:ff:ff4: virbr0-nic:
mtu 1500 qdisc noop state DOWN qlen 500 link/ether 52:54:00:a3:74:29 brd ff:ff:ff:ff:ff:ff1: lo:
mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever2: eth0:
mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:1c:42:a5:57:7a brd ff:ff:ff:ff:ff:ff inet 10.211.55.4/24 brd 10.211.55.255 scope global eth0 inet6 fdb2:2c26:f4e4:0:21c:42ff:fea5:577a/64 scope global dynamic valid_lft 2591752sec preferred_lft 604552sec inet6 fe80::21c:42ff:fea5:577a/64 scope link valid_lft forever preferred_lft forever3: virbr0:
mtu 1500 qdisc noqueue state UNKNOWN link/ether 52:54:00:a3:74:29 brd ff:ff:ff:ff:ff:ff inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr04: virbr0-nic:
mtu 1500 qdisc noop state DOWN qlen 500 link/ether 52:54:00:a3:74:29 brd ff:ff:ff:ff:ff:ff
nic.out

 

 

{    'os_platform': 'Linux',    'os_version': '\\S',    'hostname': 'DKL18U83RFAQI3G','cpu': {
'status': True,'message': None, 'data': {
'cpu_count': 1,'cpu_physical_count': 1,'cpu_model': ' Intel(R) Celeron(R) CPU E3500 @ 2.70GHz' }, 'error': None }, 'disk': {
'status': False,'message': None,'data': None, 'error': None }, 'main_board': {
'status': True,'message': None, 'data': {
'manufacturer': 'innotek GmbH','model': 'VirtualBox','sn': '0'}, 'error': None }, 'memory': {
'status': True,'message': None, 'data': {
'/dev/dm-1': {
'slot': '/dev/dm-1','model': 'partition','capacity': '820','USED': '8K','PRIO': '-1'}}, 'error': None }, 'nic': {
'status': True, 'message': None, 'data': {
'enp0s8': {
'up': True,'hwaddr': '08:00:27:75:03:bb','ipaddrs': '192.168.80.76','netmask': '255.255.255.0'} }, 'error': None }}
all

 

1 NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT2 sda               8:0    0    8.3G  0 disk3 ├─sda1            8:1    0    1G  0 part /boot4 └─sda2            8:2    0    7G  0 part5   ├─centos-root 253:0    0  6.2G  0 lvm  /6   └─centos-swap 253:1    0  820M  0 lvm  [SWAP]7 sdb               8:16   0  1.3G  0 disk8 sdc               8:32   0  3.1G  0 disk9 sr0              11:0    1 1024M  0 rom
disk.out

 

NAME      TYPE      SIZE USED PRIO/dev/dm-1 partition 820M   0B   -1/dev/dm-2 partition 2G   0B   -2
memory.out

 

 

转载于:https://www.cnblogs.com/ujq3/p/9254624.html

你可能感兴趣的文章
网络编程数据链路层
查看>>
项目延期原因及应对之道
查看>>
python3 判断数据类型
查看>>
Chrome浏览器 调试工具 vue-devtools 的安装和使用
查看>>
门面(Facade)模式
查看>>
html第一堂课
查看>>
IPv6 03-IPv6路由协议
查看>>
跨域请求
查看>>
Web 开发中很实用的10个效果
查看>>
HTML5上传文件显示进度
查看>>
友盟错误日志分析(转自:COCOACHINA shemy )
查看>>
HDU5336-XYZ and Drops-模拟
查看>>
powershell 查看程序的tcp网络连接
查看>>
C++技术问题总结-第12篇 设计模式原则
查看>>
Spring的事件处理
查看>>
利用Android属性动画实现Banner的原理与实践
查看>>
【MySQL案件】mysql登录-S失败
查看>>
白话经典算法系列之中的一个 冒泡排序的三种实现
查看>>
Eclipse断点调试
查看>>
ubuntu 步步为营之uclinux编译和移植(完整版)
查看>>