Django项目:CMDB(服务器硬件资产自动采集系统)--05--05CMDB采集硬件数据的插件

 1 #__init__.py
 2 # ————————05CMDB采集硬件数据的插件————————
 3 from config import settings
 4 import importlib
 5 # ————————05CMDB采集硬件数据的插件————————
 6 
 7 # ————————01CMDB获取服务器基本信息————————
 8 from src.plugins.basic import BasicPlugin
 9 
10 def get_server_info(hostname=None):
11     """
12     获取服务器基本信息
13     :param hostname: agent模式时,hostname为空;salt或ssh模式时,hostname表示要连接的远程服务器
14     :return:
15     """
16     response = BasicPlugin(hostname).execute()#获取基本信息
17     """
18     class BaseResponse(object):
19         def __init__(self):
20             self.status = True
21             self.message = None
22             self.data = None
23             self.error = None   
24     """
25     # ————————05CMDB采集硬件数据的插件————————
26     if not response.status:#获取基本信息出错
27         return response
28     # 如果基本信息获取完没有出错,就去获取其他硬件信息
29     for k, v in settings.PLUGINS_DICT.items(): # 采集硬件数据的插件
30         #k是名字 V是路径 #'cpu': 'src.plugins.cpu.CpuPlugin',
31         module_path, cls_name = v.rsplit('.', 1) #rsplit() 方法通过指定分隔符对字符串进行分割并返回一个列表
32         cls = getattr(importlib.import_module(module_path), cls_name)#反射 #动态导入
33         obj = cls(hostname).execute()# 去执行 .py文件
34         response.data[k] = obj  #在字典前 添加 执行 .py文件 的名字
35     # ————————05CMDB采集硬件数据的插件————————
36 
37     return response
38 
39 if __name__ == '__main__':
40     ret = get_server_info()
41 # ————————01CMDB获取服务器基本信息————————
#__init__.py

 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 # 资产信息API
14 ASSET_API = "http://127.0.0.1:8000/api/asset"
15 # ————————02CMDB将服务器基本信息提交到API接口————————
16 
17 # ————————03CMDB信息安全API接口交互认证————————
18 # 用于API认证的KEY
19 KEY = '299095cc-1330-11e5-b06a-a45e60bec08b' #认证的密码
20 # 用于API认证的请求头
21 AUTH_KEY_NAME = 'auth-key'
22 # ————————03CMDB信息安全API接口交互认证————————
23 
24 
25 # ————————04CMDB本地(Agent)模式客户端唯一标识(ID)————————
26 # Agent模式保存服务器唯一ID的文件
27 CERT_FILE_PATH = os.path.join(BASEDIR, 'config', 'cert') #文件路径
28 # ————————04CMDB本地(Agent)模式客户端唯一标识(ID)————————
29 
30 # ————————05CMDB采集硬件数据的插件————————
31 # 采集硬件数据的插件
32 PLUGINS_DICT = {
33     'cpu': 'src.plugins.cpu.CpuPlugin',
34     'disk': 'src.plugins.disk.DiskPlugin',
35     'main_board': 'src.plugins.main_board.MainBoardPlugin',
36     'memory': 'src.plugins.memory.MemoryPlugin',
37     'nic': 'src.plugins.nic.NicPlugin',
38 }
39 # ————————05CMDB采集硬件数据的插件————————
#settings.py

 1 # cpu.py
 2 # ————————05CMDB采集硬件数据的插件————————
 3 from .base import BasePlugin  #采集资产的方式  和  系统平台
 4 from lib.response import BaseResponse #提交数据的类型(字典)
 5 import wmi #Windows操作系统上管理数据和操作的基础设施
 6 
 7 class CpuPlugin(BasePlugin):
 8     def windows(self):
 9         response = BaseResponse() #提交数据的类型(字典)
10         try:
11             output =wmi.WMI().Win32_Processor() #获取CPU相关信息
12             response.data = self.windows_parse(output)  #解析相关信息 返回结果 #存到字典
13         except Exception as e:
14             response.status = False
15         return response
16 
17     @staticmethod#返回函数的静态方法
18     def windows_parse(content):
19         response = {}
20         cpu_physical_set = set()#set()函数创建一个无序不重复元素集,可进行关系测试,删除重复数据,还可以计算交集、差集、并集等。
21         for item in content:
22             response['cpu_model'] = item.Manufacturer  # cpu型号
23             response['cpu_count'] = item.NumberOfCores  # cpu核心个量
24             cpu_physical_set.add(item.DeviceID) #CPU物理个量
25         response['cpu_physical_count'] = len(cpu_physical_set)#CPU物理个量
26         return response #返回结果
27 
28 # ————————05CMDB采集硬件数据的插件————————
# cpu.py

 1 # disk.py
 2 # ————————05CMDB采集硬件数据的插件————————
 3 from .base import BasePlugin  #采集资产的方式  和  系统平台
 4 from lib.response import BaseResponse #提交数据的类型(字典)
 5 import wmi #Windows操作系统上管理数据和操作的基础设施
 6 
 7 class DiskPlugin(BasePlugin):
 8     def windows(self):
 9         response = BaseResponse() #提交数据的类型(字典)
10         try:
11             output =wmi.WMI().Win32_DiskDrive() #获取磁盘相关信息
12             response.data = self.windows_parse(output) #解析相关信息 返回结果 #存到字典
13         except Exception as e:
14             response.status = False
15         return response
16 
17     @staticmethod#返回函数的静态方法
18     def windows_parse(content):
19         response = {}
20         for item in content:
21             item_dict = {}
22             item_dict['slot'] = item.Index                      #插槽位
23             item_dict['pd_type'] = item.InterfaceType           #磁盘型号
24             item_dict['capacity'] = round(int(item.Size) / (1024**3))   # 磁盘容量
25             item_dict['model'] = item.Model  #磁盘类型
26             response[item_dict['slot']] = item_dict #分割存每个 磁盘信息
27         return response #返回结果
28 
29 # ————————05CMDB采集硬件数据的插件————————
# disk.py

 1 # main_board.py
 2 # ————————05CMDB采集硬件数据的插件————————
 3 from .base import BasePlugin #采集资产的方式  和  系统平台
 4 from lib.response import BaseResponse  #提交数据的类型(字典)
 5 import wmi #Windows操作系统上管理数据和操作的基础设施
 6 
 7 class MainBoardPlugin(BasePlugin):
 8     def windows(self):
 9         response = BaseResponse() #提交数据的类型(字典)
10         try:
11             output =wmi.WMI().Win32_BaseBoard() #获取主板相关信息
12             response.data = self.windows_parse(output)  #解析相关信息 返回结果 #存到字典
13         except Exception as e:
14             response.status = False
15         return response
16 
17     @staticmethod#返回函数的静态方法
18     def windows_parse(content):
19         response = {}
20         for item in content:
21             response['Manufacturer'] = item.Manufacturer #主板制造商
22             response['model'] = item.Name                 #主板型号
23             response['sn'] = item.SerialNumber             #主板SN号
24         return response #返回结果
25 
26 # ————————05CMDB采集硬件数据的插件————————
# main_board.py

 1 # memory.py
 2 # ————————05CMDB采集硬件数据的插件————————
 3 from .base import BasePlugin  #采集资产的方式  和  系统平台
 4 from lib.response import BaseResponse #提交数据的类型(字典)
 5 import wmi #Windows操作系统上管理数据和操作的基础设施
 6 
 7 class MemoryPlugin(BasePlugin):
 8     def windows(self):
 9         response = BaseResponse()  #提交数据的类型(字典)
10         try:
11             output =wmi.WMI().Win32_PhysicalMemory()  #获取内存相关信息
12             response.data = self.windows_parse(output)
13         except Exception as e:
14             response.status = False
15         return response
16 
17     @staticmethod#返回函数的静态方法
18     def windows_parse(content):
19         response={}
20         for item in content:
21             item_dict = {}
22             item_dict['slot'] = item.DeviceLocator                          #插槽位
23             item_dict['manufacturer'] = item.Manufacturer                   # 内存制造商
24             item_dict['model'] =item.FormFactor                             # 内存型号
25             item_dict['Capacity'] = round(int(item.Capacity) / (1024**3))   # 内存容量
26             item_dict['sn'] = item.SerialNumber                              #内存SN号
27             item_dict['speed'] = item.Speed                                 #内存速度
28             response[item_dict['slot']] = item_dict                         #分割存每条  内存信息
29         return response
30 
31 # ————————05CMDB采集硬件数据的插件————————
# memory.py

 1 # nic.py
 2 # ————————05CMDB采集硬件数据的插件————————
 3 from .base import BasePlugin  #采集资产的方式  和  系统平台
 4 from lib.response import BaseResponse #提交数据的类型(字典)
 5 import wmi #Windows操作系统上管理数据和操作的基础设施
 6 
 7 class NicPlugin(BasePlugin):
 8     def windows(self):
 9         response = BaseResponse() #提交数据的类型(字典)
10         try:
11             output =wmi.WMI().Win32_NetworkAdapterConfiguration() #获取网卡相关信息
12             response.data = self.windows_parse(output) #解析相关信息 返回结果 #存到字典
13         except Exception as e:
14             response.status = False
15         return response
16 
17     @staticmethod#返回函数的静态方法
18     def windows_parse(content):
19         response={}
20         IPCM = 0  # 权重
21         for item in content:
22             if item.IPConnectionMetric: # 权重
23                 if item.IPConnectionMetric > IPCM: # 权重 #防止虚拟网卡
24                     item_dict = {}
25                     name=item.ServiceName                       # 网卡名称
26                     item_dict['hwaddr'] = item.MACAddress      # 网卡MAC地址
27                     item_dict['ipaddrs'] = item.IPAddress[0]    # IP地址
28                     item_dict['netmask'] = item.IPSubnet[0]     # IP子网掩码
29                     item_dict['up'] = item.IPEnabled            #是否有启用
30                     response[name] = item_dict
31                     IPCM = item.IPConnectionMetric  # 权重
32         return response
33 # ————————05CMDB采集硬件数据的插件————————
# nic.py

 1 {"os_platform": "Windows",
 2  "os_version": "Microsoft Windows 7 \u65d7\u8230\u7248",
 3  "hostname": "DKL18U83RFAQI3G",
 4 
 5 "cpu":{"status": true, "message": null,
 6 "data": {"cpu_model": "GenuineIntel","cpu_count": 2,"cpu_physical_count": 1},
 7 "error": null},
 8 
 9  "disk": {"status": true, "message": null,
10  "data": {"0":{"slot": 0,"pd_type": "IDE","capacity": 466,"model": "WDC WD5000AAKX-00ERMA0 ATA Device"}},
11  "error": null},
12 
13 "main_board": {"status": true, "message": null,
14 "data": {"Manufacturer": "BIOSTAR Group","model": "Base Board","sn": "None"},
15  "error": null},
16 
17 "memory": {"status": true, "message": null,
18 "data": {"DIMM0":{"Capacity": 4, "slot":"DIMM0", "model": 8,"speed": null,"manufacturer": "Manufacturer00","sn": "SerNum00"},
19          "DIMM2":{"Capacity": 4, "slot":"DIMM2", "model": 8,"speed": null,"manufacturer": "Manufacturer02","sn": "SerNum02"}},
20 "error": null},
21 
22 "nic": {"status": true, "message": null,
23 "data": {"RTL8167":{"up": true,"hwaddr": "B8:97:5A:07:73:8C","ipaddrs": "192.168.80.47","netmask": "255.255.255.0"}},
24 "error": null}}
all.out
 1 instance of Win32_BaseBoard
 2 {
 3     Caption = "Base Board";
 4     CreationClassName = "Win32_BaseBoard";
 5     Description = "Base Board";
 6     HostingBoard = TRUE;
 7     HotSwappable = FALSE;
 8     Manufacturer = "BIOSTAR Group";
 9     Name = "Base Board";
10     PoweredOn = TRUE;
11     Product = "G41D3+";
12     Removable = FALSE;
13     Replaceable = TRUE;
14     RequiresDaughterBoard = FALSE;
15     SerialNumber = "None";
16     Status = "OK";
17     Tag = "Base Board";
18     Version = "6.0";
19 };
20 
21 
22 instance of Win32_BaseBoard
23 {
24         Caption = "基板";
25         ConfigOptions = {};
26         CreationClassName = "Win32_BaseBoard";
27         Description = "基板";
28         HostingBoard = TRUE;
29         HotSwappable = FALSE;
30         Manufacturer = "Dell Inc.         ";
31         Name = "基板";
32         PoweredOn = TRUE;
33         Product = "03C38H";
34         Removable = FALSE;
35         Replaceable = TRUE;
36         RequiresDaughterBoard = FALSE;
37         SerialNumber = ".       .CN486432A91479.";
38         Status = "OK";
39         Tag = "Base Board";
40         Version = "   ";
41 };
board.out
 1 nstance of Win32_Processor
 2 {
 3     AddressWidth = 64;
 4     Architecture = 9;
 5     Availability = 3;
 6     Caption = "Intel64 Family 6 Model 23 Stepping 10";
 7     CpuStatus = 1;
 8     CreationClassName = "Win32_Processor";
 9     CurrentClockSpeed = 2715;
10     CurrentVoltage = 13;
11     DataWidth = 64;
12     Description = "Intel64 Family 6 Model 23 Stepping 10";
13     DeviceID = "CPU0";
14     ExtClock = 200;
15     Family = 11;
16     L2CacheSize = 1024;
17     L3CacheSize = 0;
18     L3CacheSpeed = 0;
19     Level = 6;
20     LoadPercentage = 0;
21     Manufacturer = "GenuineIntel";
22     MaxClockSpeed = 2715;
23     Name = "Intel(R) Celeron(R) CPU        E3500  @ 2.70GHz";
24     NumberOfCores = 2;
25     NumberOfLogicalProcessors = 2;
26     PowerManagementSupported = FALSE;
27     ProcessorId = "BFEBFBFF0001067A";
28     ProcessorType = 3;
29     Revision = 5898;
30     Role = "CPU";
31     SocketDesignation = "CPU 1";
32     Status = "OK";
33     StatusInfo = 3;
34     SystemCreationClassName = "Win32_ComputerSystem";
35     SystemName = "DKL18U83RFAQI3G";
36     UpgradeMethod = 1;
37     Version = "";
38 };
cpu.out
 1 instance of Win32_DiskDrive
 2 {
 3     BytesPerSector = 512;
 4     Capabilities = {3, 4, 10};
 5     CapabilityDescriptions = {"Random Access", "Supports Writing", "SMART Notification"};
 6     Caption = "Colorful SL200 128GB";
 7     ConfigManagerErrorCode = 0;
 8     ConfigManagerUserConfig = FALSE;
 9     CreationClassName = "Win32_DiskDrive";
10     Description = "磁盘驱动器";
11     DeviceID = "\\\\.\\PHYSICALDRIVE0";
12     FirmwareRevision = "0818";
13     Index = 0;
14     InterfaceType = "IDE";
15     Manufacturer = "(标准磁盘驱动器)";
16     MediaLoaded = TRUE;
17     MediaType = "Fixed hard disk media";
18     Model = "Colorful SL200 128GB";
19     Name = "\\\\.\\PHYSICALDRIVE0";
20     Partitions = 3;
21     PNPDeviceID = "SCSI\\DISK&VEN_&PROD_COLORFUL_SL200_1\\4&112D75BA&0&000000";
22     SCSIBus = 0;
23     SCSILogicalUnit = 0;
24     SCSIPort = 0;
25     SCSITargetId = 0;
26     SectorsPerTrack = 63;
27     SerialNumber = "AA000000000000000431";
28     Size = "128034708480";
29     Status = "OK";
30     SystemCreationClassName = "Win32_ComputerSystem";
31     SystemName = "XY";
32     TotalCylinders = "15566";
33     TotalHeads = 255;
34     TotalSectors = "250067790";
35     TotalTracks = "3969330";
36     TracksPerCylinder = 255;
37 };
38 
39 
40 instance of Win32_DiskDrive
41 {
42     BytesPerSector = 512;
43     Capabilities = {3, 4, 10};
44     CapabilityDescriptions = {"Random Access", "Supports Writing", "SMART Notification"};
45     Caption = "TOSHIBA MQ01ABF050";
46     ConfigManagerErrorCode = 0;
47     ConfigManagerUserConfig = FALSE;
48     CreationClassName = "Win32_DiskDrive";
49     Description = "磁盘驱动器";
50     DeviceID = "\\\\.\\PHYSICALDRIVE1";
51     FirmwareRevision = "AM001J";
52     Index = 1;
53     InterfaceType = "IDE";
54     Manufacturer = "(标准磁盘驱动器)";
55     MediaLoaded = TRUE;
56     MediaType = "Fixed hard disk media";
57     Model = "TOSHIBA MQ01ABF050";
58     Name = "\\\\.\\PHYSICALDRIVE1";
59     Partitions = 3;
60     PNPDeviceID = "SCSI\\DISK&VEN_TOSHIBA&PROD_MQ01ABF050\\4&112D75BA&0&010000";
61     SCSIBus = 1;
62     SCSILogicalUnit = 0;
63     SCSIPort = 0;
64     SCSITargetId = 0;
65     SectorsPerTrack = 63;
66     SerialNumber = "           Z5CKCTNMT";
67     Signature = 3014350181;
68     Size = "500105249280";
69     Status = "OK";
70     SystemCreationClassName = "Win32_ComputerSystem";
71     SystemName = "XY";
72     TotalCylinders = "60801";
73     TotalHeads = 255;
74     TotalSectors = "976768065";
75     TotalTracks = "15504255";
76     TracksPerCylinder = 255;
77 };
disk.out
 1 instance of Win32_PhysicalMemory
 2 {
 3     BankLabel = "BANK0";
 4     Capacity = "4294967296";
 5     Caption = "Physical Memory";
 6     CreationClassName = "Win32_PhysicalMemory";
 7     DataWidth = 64;
 8     Description = "Physical Memory";
 9     DeviceLocator = "DIMM0";
10     FormFactor = 8;
11     InterleaveDataDepth = 1;
12     InterleavePosition = 0;
13     Manufacturer = "Manufacturer00";
14     MemoryType = 17;
15     Name = "Physical Memory";
16     PartNumber = "ModulePartNumber00";
17     PositionInRow = 1;
18     SerialNumber = "SerNum00";
19     Tag = "Physical Memory 0";
20     TotalWidth = 64;
21     TypeDetail = 128;
22 };
23 
24 
25 instance of Win32_PhysicalMemory
26 {
27     BankLabel = "BANK2";
28     Capacity = "4294967296";
29     Caption = "Physical Memory";
30     CreationClassName = "Win32_PhysicalMemory";
31     DataWidth = 64;
32     Description = "Physical Memory";
33     DeviceLocator = "DIMM2";
34     FormFactor = 8;
35     InterleaveDataDepth = 1;
36     InterleavePosition = 0;
37     Manufacturer = "Manufacturer02";
38     MemoryType = 17;
39     Name = "Physical Memory";
40     PartNumber = "ModulePartNumber02";
41     PositionInRow = 1;
42     SerialNumber = "SerNum02";
43     Tag = "Physical Memory 2";
44     TotalWidth = 64;
45     TypeDetail = 128;
46 };
47 
48 
49 instance of Win32_PhysicalMemory
50 {
51         Attributes = 0;
52         BankLabel = "BANK 2";
53         Capacity = "4294967296";
54         Caption = "物理内存";
55         ConfiguredClockSpeed = 1600;
56         CreationClassName = "Win32_PhysicalMemory";
57         DataWidth = 64;
58         Description = "物理内存";
59         DeviceLocator = "ChannelB-DIMM0";
60         FormFactor = 12;
61         Manufacturer = "830B";
62         MemoryType = 24;
63         Name = "物理内存";
64         PartNumber = "NT4GC64B8HG0NS-DI ";
65         SerialNumber = "AA6E1B6E";
66         SMBIOSMemoryType = 24;
67         Speed = 1600;
68         Tag = "Physical Memory 1";
69         TotalWidth = 64;
70         TypeDetail = 128;
71 };
memory.out
  1 instance of Win32_NetworkAdapterConfiguration
  2 {
  3     Caption = "[00000000] WAN Miniport (SSTP)";
  4     Description = "WAN Miniport (SSTP)";
  5     DHCPEnabled = FALSE;
  6     Index = 0;
  7     InterfaceIndex = 2;
  8     IPEnabled = FALSE;
  9     ServiceName = "RasSstp";
 10     SettingID = "{71F897D7-EB7C-4D8D-89DB-AC80D9DD2270}";
 11 };
 12 
 13 
 14 instance of Win32_NetworkAdapterConfiguration
 15 {
 16     Caption = "[00000001] WAN Miniport (IKEv2)";
 17     Description = "WAN Miniport (IKEv2)";
 18     DHCPEnabled = FALSE;
 19     Index = 1;
 20     InterfaceIndex = 10;
 21     IPEnabled = FALSE;
 22     ServiceName = "RasAgileVpn";
 23     SettingID = "{29898C9D-B0A4-4FEF-BDB6-57A562022CEE}";
 24 };
 25 
 26 
 27 instance of Win32_NetworkAdapterConfiguration
 28 {
 29     Caption = "[00000002] WAN Miniport (L2TP)";
 30     Description = "WAN Miniport (L2TP)";
 31     DHCPEnabled = FALSE;
 32     Index = 2;
 33     InterfaceIndex = 3;
 34     IPEnabled = FALSE;
 35     ServiceName = "Rasl2tp";
 36     SettingID = "{E43D242B-9EAB-4626-A952-46649FBB939A}";
 37 };
 38 
 39 
 40 instance of Win32_NetworkAdapterConfiguration
 41 {
 42     Caption = "[00000003] WAN Miniport (PPTP)";
 43     Description = "WAN Miniport (PPTP)";
 44     DHCPEnabled = FALSE;
 45     Index = 3;
 46     InterfaceIndex = 4;
 47     IPEnabled = FALSE;
 48     ServiceName = "PptpMiniport";
 49     SettingID = "{DF4A9D2C-8742-4EB1-8703-D395C4183F33}";
 50 };
 51 
 52 
 53 instance of Win32_NetworkAdapterConfiguration
 54 {
 55     Caption = "[00000004] WAN Miniport (PPPOE)";
 56     Description = "WAN Miniport (PPPOE)";
 57     DHCPEnabled = FALSE;
 58     Index = 4;
 59     InterfaceIndex = 5;
 60     IPEnabled = FALSE;
 61     ServiceName = "RasPppoe";
 62     SettingID = "{8E301A52-AFFA-4F49-B9CA-C79096A1A056}";
 63 };
 64 
 65 
 66 instance of Win32_NetworkAdapterConfiguration
 67 {
 68     Caption = "[00000005] WAN Miniport (IPv6)";
 69     Description = "WAN Miniport (IPv6)";
 70     DHCPEnabled = FALSE;
 71     Index = 5;
 72     InterfaceIndex = 6;
 73     IPEnabled = FALSE;
 74     ServiceName = "NdisWan";
 75     SettingID = "{9A399D81-2EAD-4F23-BCDD-637FC13DCD51}";
 76 };
 77 
 78 
 79 instance of Win32_NetworkAdapterConfiguration
 80 {
 81     Caption = "[00000006] WAN Miniport (Network Monitor)";
 82     Description = "WAN Miniport (Network Monitor)";
 83     DHCPEnabled = FALSE;
 84     Index = 6;
 85     InterfaceIndex = 7;
 86     IPEnabled = FALSE;
 87     ServiceName = "NdisWan";
 88     SettingID = "{5BF54C7E-91DA-457D-80BF-333677D7E316}";
 89 };
 90 
 91 
 92 instance of Win32_NetworkAdapterConfiguration
 93 {
 94     Caption = "[00000007] Realtek PCIe FE Family Controller";
 95     DatabasePath = "%SystemRoot%\\System32\\drivers\\etc";
 96     DefaultIPGateway = {"192.168.80.1"};
 97     DefaultTTL = 64;
 98     Description = "Realtek PCIe FE Family Controller";
 99     DHCPEnabled = TRUE;
100     DHCPLeaseExpires = "20180622195709.000000+480";
101     DHCPLeaseObtained = "20180622175709.000000+480";
102     DHCPServer = "192.168.80.1";
103     DNSDomainSuffixSearchOrder = {};
104     DNSEnabledForWINSResolution = FALSE;
105     DNSHostName = "DKL18U83RFAQI3G";
106     DNSServerSearchOrder = {"192.168.80.1", "218.85.157.99"};
107     DomainDNSRegistrationEnabled = FALSE;
108     FullDNSRegistrationEnabled = TRUE;
109     GatewayCostMetric = {0};
110     Index = 7;
111     InterfaceIndex = 11;
112     IPAddress = {"192.168.80.54", "fe80::c912:33b9:df1d:90b7"};
113     IPConnectionMetric = 20;
114     IPEnabled = TRUE;
115     IPFilterSecurityEnabled = FALSE;
116     IPSecPermitIPProtocols = {};
117     IPSecPermitTCPPorts = {};
118     IPSecPermitUDPPorts = {};
119     IPSubnet = {"255.255.255.0", "64"};
120     MACAddress = "B8:97:5A:07:73:8C";
121     PMTUBHDetectEnabled = TRUE;
122     PMTUDiscoveryEnabled = TRUE;
123     ServiceName = "RTL8167";
124     SettingID = "{57DC49CC-DC9F-4583-A411-F4837D4E5310}";
125     TcpipNetbiosOptions = 0;
126     WINSEnableLMHostsLookup = TRUE;
127     WINSScopeID = "";
128 };
129 
130 
131 instance of Win32_NetworkAdapterConfiguration
132 {
133     Caption = "[00000008] WAN Miniport (IP)";
134     Description = "WAN Miniport (IP)";
135     DHCPEnabled = FALSE;
136     Index = 8;
137     InterfaceIndex = 8;
138     IPEnabled = FALSE;
139     ServiceName = "NdisWan";
140     SettingID = "{2CAA64ED-BAA3-4473-B637-DEC65A14C8AA}";
141 };
142 
143 
144 instance of Win32_NetworkAdapterConfiguration
145 {
146     Caption = "[00000009] Microsoft ISATAP Adapter";
147     Description = "Microsoft ISATAP Adapter";
148     DHCPEnabled = FALSE;
149     Index = 9;
150     InterfaceIndex = 12;
151     IPEnabled = FALSE;
152     ServiceName = "tunnel";
153     SettingID = "{409C2A87-0D21-4979-AC19-BD58EBDDC442}";
154 };
155 
156 
157 instance of Win32_NetworkAdapterConfiguration
158 {
159     Caption = "[00000010] RAS Async Adapter";
160     Description = "RAS Async Adapter";
161     DHCPEnabled = FALSE;
162     Index = 10;
163     InterfaceIndex = 9;
164     IPEnabled = FALSE;
165     ServiceName = "AsyncMac";
166     SettingID = "{78032B7E-4968-42D3-9F37-287EA86C0AAA}";
167 };
168 
169 
170 instance of Win32_NetworkAdapterConfiguration
171 {
172     Caption = "[00000011] Microsoft 6to4 Adapter";
173     Description = "Microsoft 6to4 Adapter";
174     DHCPEnabled = FALSE;
175     Index = 11;
176     InterfaceIndex = 13;
177     IPEnabled = FALSE;
178     ServiceName = "tunnel";
179     SettingID = "{4A3D2A58-3B35-4FAE-BE66-14F485520E20}";
180 };
181 
182 
183 instance of Win32_NetworkAdapterConfiguration
184 {
185     Caption = "[00000013] Microsoft ISATAP Adapter";
186     Description = "Microsoft ISATAP Adapter";
187     DHCPEnabled = FALSE;
188     Index = 13;
189     InterfaceIndex = 14;
190     IPEnabled = FALSE;
191     ServiceName = "tunnel";
192     SettingID = "{DE650C82-C0E5-4561-9048-F05B56D0C30C}";
193 };
194 
195 
196 instance of Win32_NetworkAdapterConfiguration
197 {
198     Caption = "[00000015] Microsoft ISATAP Adapter";
199     Description = "Microsoft ISATAP Adapter";
200     DHCPEnabled = FALSE;
201     Index = 15;
202     InterfaceIndex = 15;
203     IPEnabled = FALSE;
204     ServiceName = "tunnel";
205     SettingID = "{5196115C-0551-4B1C-AA16-D30B64FFB538}";
206 };
207 
208 
209 instance of Win32_NetworkAdapterConfiguration
210 {
211     Caption = "[00000016] VirtualBox Host-Only Ethernet Adapter";
212     DatabasePath = "%SystemRoot%\\System32\\drivers\\etc";
213     DefaultTTL = 64;
214     Description = "VirtualBox Host-Only Ethernet Adapter";
215     DHCPEnabled = FALSE;
216     DNSDomainSuffixSearchOrder = {};
217     DNSEnabledForWINSResolution = FALSE;
218     DNSHostName = "DKL18U83RFAQI3G";
219     DomainDNSRegistrationEnabled = FALSE;
220     FullDNSRegistrationEnabled = TRUE;
221     Index = 16;
222     InterfaceIndex = 16;
223     IPAddress = {"192.168.137.1", "fe80::8104:5b2a:19de:41e7"};
224     IPConnectionMetric = 10;
225     IPEnabled = TRUE;
226     IPFilterSecurityEnabled = FALSE;
227     IPSecPermitIPProtocols = {};
228     IPSecPermitTCPPorts = {};
229     IPSecPermitUDPPorts = {};
230     IPSubnet = {"255.255.255.0", "64"};
231     MACAddress = "0A:00:27:00:00:10";
232     PMTUBHDetectEnabled = TRUE;
233     PMTUDiscoveryEnabled = TRUE;
234     ServiceName = "VBoxNetAdp";
235     SettingID = "{DF5268F5-C995-4010-984D-F9EA4C3889BE}";
236     TcpipNetbiosOptions = 0;
237     WINSEnableLMHostsLookup = TRUE;
238     WINSScopeID = "";
239 };
240 
241 
242 instance of Win32_NetworkAdapterConfiguration
243 {
244     Caption = "[00000017] Microsoft ISATAP Adapter";
245     Description = "Microsoft ISATAP Adapter";
246     DHCPEnabled = FALSE;
247     Index = 17;
248     InterfaceIndex = 17;
249     IPEnabled = FALSE;
250     ServiceName = "tunnel";
251     SettingID = "{C21107AF-5813-4D7B-A4C1-3C16CA00FA2C}";
252 };
nic.out

猜你喜欢

转载自www.cnblogs.com/ujq3/p/9230926.html