#__init__.py
# ————————05CMDB采集硬件数据的插件————————
from config import settings
import importlib
# ————————05CMDB采集硬件数据的插件———————— # ————————01CMDB获取服务器基本信息————————
from src.plugins.basic import BasicPlugin def get_server_info(hostname=None):
"""
获取服务器基本信息
:param hostname: agent模式时,hostname为空;salt或ssh模式时,hostname表示要连接的远程服务器
:return:
"""
response = BasicPlugin(hostname).execute()#获取基本信息
"""
class BaseResponse(object):
def __init__(self):
self.status = True
self.message = None
self.data = None
self.error = None
"""
# ————————05CMDB采集硬件数据的插件————————
if not response.status:#获取基本信息出错
return response
# 如果基本信息获取完没有出错,就去获取其他硬件信息
for k, v in settings.PLUGINS_DICT.items(): # 采集硬件数据的插件
#k是名字 V是路径 #'cpu': 'src.plugins.cpu.CpuPlugin',
module_path, cls_name = v.rsplit('.', 1) #rsplit() 方法通过指定分隔符对字符串进行分割并返回一个列表
cls = getattr(importlib.import_module(module_path), cls_name)#反射 #动态导入
obj = cls(hostname).execute()# 去执行 .py文件
response.data[k] = obj #在字典前 添加 执行 .py文件 的名字
# ————————05CMDB采集硬件数据的插件———————— return response if __name__ == '__main__':
ret = get_server_info()
# ————————01CMDB获取服务器基本信息————————

#__init__.py

 #settings.py
# ————————01CMDB获取服务器基本信息————————
import os BASEDIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))##当前路径 # 采集资产的方式,选项有:agent(默认), salt, ssh
MODE = 'agent' # ————————01CMDB获取服务器基本信息———————— # ————————02CMDB将服务器基本信息提交到API接口————————
# 资产信息API
ASSET_API = "http://127.0.0.1:8000/api/asset"
# ————————02CMDB将服务器基本信息提交到API接口———————— # ————————03CMDB信息安全API接口交互认证————————
# 用于API认证的KEY
KEY = '299095cc-1330-11e5-b06a-a45e60bec08b' #认证的密码
# 用于API认证的请求头
AUTH_KEY_NAME = 'auth-key'
# ————————03CMDB信息安全API接口交互认证———————— # ————————04CMDB本地(Agent)模式客户端唯一标识(ID)————————
# Agent模式保存服务器唯一ID的文件
CERT_FILE_PATH = os.path.join(BASEDIR, 'config', 'cert') #文件路径
# ————————04CMDB本地(Agent)模式客户端唯一标识(ID)———————— # ————————05CMDB采集硬件数据的插件————————
# 采集硬件数据的插件
PLUGINS_DICT = {
'cpu': 'src.plugins.cpu.CpuPlugin',
'disk': 'src.plugins.disk.DiskPlugin',
'main_board': 'src.plugins.main_board.MainBoardPlugin',
'memory': 'src.plugins.memory.MemoryPlugin',
'nic': 'src.plugins.nic.NicPlugin',
}
# ————————05CMDB采集硬件数据的插件————————

#settings.py

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

# cpu.py

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

# disk.py

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

# main_board.py

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

# memory.py

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

# nic.py

 {"os_platform": "Windows",
"os_version": "Microsoft Windows 7 \u65d7\u8230\u7248",
"hostname": "DKL18U83RFAQI3G", "cpu":{"status": true, "message": null,
"data": {"cpu_model": "GenuineIntel","cpu_count": 2,"cpu_physical_count": 1},
"error": null}, "disk": {"status": true, "message": null,
"data": {"":{"slot": 0,"pd_type": "IDE","capacity": 466,"model": "WDC WD5000AAKX-00ERMA0 ATA Device"}},
"error": null}, "main_board": {"status": true, "message": null,
"data": {"Manufacturer": "BIOSTAR Group","model": "Base Board","sn": "None"},
"error": null}, "memory": {"status": true, "message": null,
"data": {"DIMM0":{"Capacity": 4, "slot":"DIMM0", "model": 8,"speed": null,"manufacturer": "Manufacturer00","sn": "SerNum00"},
"DIMM2":{"Capacity": 4, "slot":"DIMM2", "model": 8,"speed": null,"manufacturer": "Manufacturer02","sn": "SerNum02"}},
"error": null}, "nic": {"status": true, "message": null,
"data": {"RTL8167":{"up": true,"hwaddr": "B8:97:5A:07:73:8C","ipaddrs": "192.168.80.47","netmask": "255.255.255.0"}},
"error": null}}

all.out

 instance of Win32_BaseBoard
{
Caption = "Base Board";
CreationClassName = "Win32_BaseBoard";
Description = "Base Board";
HostingBoard = TRUE;
HotSwappable = FALSE;
Manufacturer = "BIOSTAR Group";
Name = "Base Board";
PoweredOn = TRUE;
Product = "G41D3+";
Removable = FALSE;
Replaceable = TRUE;
RequiresDaughterBoard = FALSE;
SerialNumber = "None";
Status = "OK";
Tag = "Base Board";
Version = "6.0";
}; instance of Win32_BaseBoard
{
Caption = "基板";
ConfigOptions = {};
CreationClassName = "Win32_BaseBoard";
Description = "基板";
HostingBoard = TRUE;
HotSwappable = FALSE;
Manufacturer = "Dell Inc. ";
Name = "基板";
PoweredOn = TRUE;
Product = "03C38H";
Removable = FALSE;
Replaceable = TRUE;
RequiresDaughterBoard = FALSE;
SerialNumber = ". .CN486432A91479.";
Status = "OK";
Tag = "Base Board";
Version = " ";
};

board.out

 nstance of Win32_Processor
{
AddressWidth = 64;
Architecture = 9;
Availability = 3;
Caption = "Intel64 Family 6 Model 23 Stepping 10";
CpuStatus = 1;
CreationClassName = "Win32_Processor";
CurrentClockSpeed = 2715;
CurrentVoltage = 13;
DataWidth = 64;
Description = "Intel64 Family 6 Model 23 Stepping 10";
DeviceID = "CPU0";
ExtClock = 200;
Family = 11;
L2CacheSize = 1024;
L3CacheSize = 0;
L3CacheSpeed = 0;
Level = 6;
LoadPercentage = 0;
Manufacturer = "GenuineIntel";
MaxClockSpeed = 2715;
Name = "Intel(R) Celeron(R) CPU E3500 @ 2.70GHz";
NumberOfCores = 2;
NumberOfLogicalProcessors = 2;
PowerManagementSupported = FALSE;
ProcessorId = "BFEBFBFF0001067A";
ProcessorType = 3;
Revision = 5898;
Role = "CPU";
SocketDesignation = "CPU 1";
Status = "OK";
StatusInfo = 3;
SystemCreationClassName = "Win32_ComputerSystem";
SystemName = "DKL18U83RFAQI3G";
UpgradeMethod = 1;
Version = "";
};

cpu.out

 instance of Win32_DiskDrive
{
BytesPerSector = 512;
Capabilities = {3, 4, 10};
CapabilityDescriptions = {"Random Access", "Supports Writing", "SMART Notification"};
Caption = "Colorful SL200 128GB";
ConfigManagerErrorCode = 0;
ConfigManagerUserConfig = FALSE;
CreationClassName = "Win32_DiskDrive";
Description = "磁盘驱动器";
DeviceID = "\\\\.\\PHYSICALDRIVE0";
FirmwareRevision = "";
Index = 0;
InterfaceType = "IDE";
Manufacturer = "(标准磁盘驱动器)";
MediaLoaded = TRUE;
MediaType = "Fixed hard disk media";
Model = "Colorful SL200 128GB";
Name = "\\\\.\\PHYSICALDRIVE0";
Partitions = 3;
PNPDeviceID = "SCSI\\DISK&VEN_&PROD_COLORFUL_SL200_1\\4&112D75BA&0&000000";
SCSIBus = 0;
SCSILogicalUnit = 0;
SCSIPort = 0;
SCSITargetId = 0;
SectorsPerTrack = 63;
SerialNumber = "AA000000000000000431";
Size = "";
Status = "OK";
SystemCreationClassName = "Win32_ComputerSystem";
SystemName = "XY";
TotalCylinders = "";
TotalHeads = 255;
TotalSectors = "";
TotalTracks = "";
TracksPerCylinder = 255;
}; instance of Win32_DiskDrive
{
BytesPerSector = 512;
Capabilities = {3, 4, 10};
CapabilityDescriptions = {"Random Access", "Supports Writing", "SMART Notification"};
Caption = "TOSHIBA MQ01ABF050";
ConfigManagerErrorCode = 0;
ConfigManagerUserConfig = FALSE;
CreationClassName = "Win32_DiskDrive";
Description = "磁盘驱动器";
DeviceID = "\\\\.\\PHYSICALDRIVE1";
FirmwareRevision = "AM001J";
Index = 1;
InterfaceType = "IDE";
Manufacturer = "(标准磁盘驱动器)";
MediaLoaded = TRUE;
MediaType = "Fixed hard disk media";
Model = "TOSHIBA MQ01ABF050";
Name = "\\\\.\\PHYSICALDRIVE1";
Partitions = 3;
PNPDeviceID = "SCSI\\DISK&VEN_TOSHIBA&PROD_MQ01ABF050\\4&112D75BA&0&010000";
SCSIBus = 1;
SCSILogicalUnit = 0;
SCSIPort = 0;
SCSITargetId = 0;
SectorsPerTrack = 63;
SerialNumber = " Z5CKCTNMT";
Signature = 3014350181;
Size = "";
Status = "OK";
SystemCreationClassName = "Win32_ComputerSystem";
SystemName = "XY";
TotalCylinders = "";
TotalHeads = 255;
TotalSectors = "";
TotalTracks = "";
TracksPerCylinder = 255;
};

disk.out

 instance of Win32_PhysicalMemory
{
BankLabel = "BANK0";
Capacity = "";
Caption = "Physical Memory";
CreationClassName = "Win32_PhysicalMemory";
DataWidth = 64;
Description = "Physical Memory";
DeviceLocator = "DIMM0";
FormFactor = 8;
InterleaveDataDepth = 1;
InterleavePosition = 0;
Manufacturer = "Manufacturer00";
MemoryType = 17;
Name = "Physical Memory";
PartNumber = "ModulePartNumber00";
PositionInRow = 1;
SerialNumber = "SerNum00";
Tag = "Physical Memory 0";
TotalWidth = 64;
TypeDetail = 128;
}; instance of Win32_PhysicalMemory
{
BankLabel = "BANK2";
Capacity = "";
Caption = "Physical Memory";
CreationClassName = "Win32_PhysicalMemory";
DataWidth = 64;
Description = "Physical Memory";
DeviceLocator = "DIMM2";
FormFactor = 8;
InterleaveDataDepth = 1;
InterleavePosition = 0;
Manufacturer = "Manufacturer02";
MemoryType = 17;
Name = "Physical Memory";
PartNumber = "ModulePartNumber02";
PositionInRow = 1;
SerialNumber = "SerNum02";
Tag = "Physical Memory 2";
TotalWidth = 64;
TypeDetail = 128;
}; instance of Win32_PhysicalMemory
{
Attributes = 0;
BankLabel = "BANK 2";
Capacity = "";
Caption = "物理内存";
ConfiguredClockSpeed = 1600;
CreationClassName = "Win32_PhysicalMemory";
DataWidth = 64;
Description = "物理内存";
DeviceLocator = "ChannelB-DIMM0";
FormFactor = 12;
Manufacturer = "830B";
MemoryType = 24;
Name = "物理内存";
PartNumber = "NT4GC64B8HG0NS-DI ";
SerialNumber = "AA6E1B6E";
SMBIOSMemoryType = 24;
Speed = 1600;
Tag = "Physical Memory 1";
TotalWidth = 64;
TypeDetail = 128;
};

memory.out

 instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000000] WAN Miniport (SSTP)";
Description = "WAN Miniport (SSTP)";
DHCPEnabled = FALSE;
Index = 0;
InterfaceIndex = 2;
IPEnabled = FALSE;
ServiceName = "RasSstp";
SettingID = "{71F897D7-EB7C-4D8D-89DB-AC80D9DD2270}";
}; instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000001] WAN Miniport (IKEv2)";
Description = "WAN Miniport (IKEv2)";
DHCPEnabled = FALSE;
Index = 1;
InterfaceIndex = 10;
IPEnabled = FALSE;
ServiceName = "RasAgileVpn";
SettingID = "{29898C9D-B0A4-4FEF-BDB6-57A562022CEE}";
}; instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000002] WAN Miniport (L2TP)";
Description = "WAN Miniport (L2TP)";
DHCPEnabled = FALSE;
Index = 2;
InterfaceIndex = 3;
IPEnabled = FALSE;
ServiceName = "Rasl2tp";
SettingID = "{E43D242B-9EAB-4626-A952-46649FBB939A}";
}; instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000003] WAN Miniport (PPTP)";
Description = "WAN Miniport (PPTP)";
DHCPEnabled = FALSE;
Index = 3;
InterfaceIndex = 4;
IPEnabled = FALSE;
ServiceName = "PptpMiniport";
SettingID = "{DF4A9D2C-8742-4EB1-8703-D395C4183F33}";
}; instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000004] WAN Miniport (PPPOE)";
Description = "WAN Miniport (PPPOE)";
DHCPEnabled = FALSE;
Index = 4;
InterfaceIndex = 5;
IPEnabled = FALSE;
ServiceName = "RasPppoe";
SettingID = "{8E301A52-AFFA-4F49-B9CA-C79096A1A056}";
}; instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000005] WAN Miniport (IPv6)";
Description = "WAN Miniport (IPv6)";
DHCPEnabled = FALSE;
Index = 5;
InterfaceIndex = 6;
IPEnabled = FALSE;
ServiceName = "NdisWan";
SettingID = "{9A399D81-2EAD-4F23-BCDD-637FC13DCD51}";
}; instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000006] WAN Miniport (Network Monitor)";
Description = "WAN Miniport (Network Monitor)";
DHCPEnabled = FALSE;
Index = 6;
InterfaceIndex = 7;
IPEnabled = FALSE;
ServiceName = "NdisWan";
SettingID = "{5BF54C7E-91DA-457D-80BF-333677D7E316}";
}; instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000007] Realtek PCIe FE Family Controller";
DatabasePath = "%SystemRoot%\\System32\\drivers\\etc";
DefaultIPGateway = {"192.168.80.1"};
DefaultTTL = 64;
Description = "Realtek PCIe FE Family Controller";
DHCPEnabled = TRUE;
DHCPLeaseExpires = "20180622195709.000000+480";
DHCPLeaseObtained = "20180622175709.000000+480";
DHCPServer = "192.168.80.1";
DNSDomainSuffixSearchOrder = {};
DNSEnabledForWINSResolution = FALSE;
DNSHostName = "DKL18U83RFAQI3G";
DNSServerSearchOrder = {"192.168.80.1", "218.85.157.99"};
DomainDNSRegistrationEnabled = FALSE;
FullDNSRegistrationEnabled = TRUE;
GatewayCostMetric = {0};
Index = 7;
InterfaceIndex = 11;
IPAddress = {"192.168.80.54", "fe80::c912:33b9:df1d:90b7"};
IPConnectionMetric = 20;
IPEnabled = TRUE;
IPFilterSecurityEnabled = FALSE;
IPSecPermitIPProtocols = {};
IPSecPermitTCPPorts = {};
IPSecPermitUDPPorts = {};
IPSubnet = {"255.255.255.0", ""};
MACAddress = "B8:97:5A:07:73:8C";
PMTUBHDetectEnabled = TRUE;
PMTUDiscoveryEnabled = TRUE;
ServiceName = "RTL8167";
SettingID = "{57DC49CC-DC9F-4583-A411-F4837D4E5310}";
TcpipNetbiosOptions = 0;
WINSEnableLMHostsLookup = TRUE;
WINSScopeID = "";
}; instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000008] WAN Miniport (IP)";
Description = "WAN Miniport (IP)";
DHCPEnabled = FALSE;
Index = 8;
InterfaceIndex = 8;
IPEnabled = FALSE;
ServiceName = "NdisWan";
SettingID = "{2CAA64ED-BAA3-4473-B637-DEC65A14C8AA}";
}; instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000009] Microsoft ISATAP Adapter";
Description = "Microsoft ISATAP Adapter";
DHCPEnabled = FALSE;
Index = 9;
InterfaceIndex = 12;
IPEnabled = FALSE;
ServiceName = "tunnel";
SettingID = "{409C2A87-0D21-4979-AC19-BD58EBDDC442}";
}; instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000010] RAS Async Adapter";
Description = "RAS Async Adapter";
DHCPEnabled = FALSE;
Index = 10;
InterfaceIndex = 9;
IPEnabled = FALSE;
ServiceName = "AsyncMac";
SettingID = "{78032B7E-4968-42D3-9F37-287EA86C0AAA}";
}; instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000011] Microsoft 6to4 Adapter";
Description = "Microsoft 6to4 Adapter";
DHCPEnabled = FALSE;
Index = 11;
InterfaceIndex = 13;
IPEnabled = FALSE;
ServiceName = "tunnel";
SettingID = "{4A3D2A58-3B35-4FAE-BE66-14F485520E20}";
}; instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000013] Microsoft ISATAP Adapter";
Description = "Microsoft ISATAP Adapter";
DHCPEnabled = FALSE;
Index = 13;
InterfaceIndex = 14;
IPEnabled = FALSE;
ServiceName = "tunnel";
SettingID = "{DE650C82-C0E5-4561-9048-F05B56D0C30C}";
}; instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000015] Microsoft ISATAP Adapter";
Description = "Microsoft ISATAP Adapter";
DHCPEnabled = FALSE;
Index = 15;
InterfaceIndex = 15;
IPEnabled = FALSE;
ServiceName = "tunnel";
SettingID = "{5196115C-0551-4B1C-AA16-D30B64FFB538}";
}; instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000016] VirtualBox Host-Only Ethernet Adapter";
DatabasePath = "%SystemRoot%\\System32\\drivers\\etc";
DefaultTTL = 64;
Description = "VirtualBox Host-Only Ethernet Adapter";
DHCPEnabled = FALSE;
DNSDomainSuffixSearchOrder = {};
DNSEnabledForWINSResolution = FALSE;
DNSHostName = "DKL18U83RFAQI3G";
DomainDNSRegistrationEnabled = FALSE;
FullDNSRegistrationEnabled = TRUE;
Index = 16;
InterfaceIndex = 16;
IPAddress = {"192.168.137.1", "fe80::8104:5b2a:19de:41e7"};
IPConnectionMetric = 10;
IPEnabled = TRUE;
IPFilterSecurityEnabled = FALSE;
IPSecPermitIPProtocols = {};
IPSecPermitTCPPorts = {};
IPSecPermitUDPPorts = {};
IPSubnet = {"255.255.255.0", ""};
MACAddress = "0A:00:27:00:00:10";
PMTUBHDetectEnabled = TRUE;
PMTUDiscoveryEnabled = TRUE;
ServiceName = "VBoxNetAdp";
SettingID = "{DF5268F5-C995-4010-984D-F9EA4C3889BE}";
TcpipNetbiosOptions = 0;
WINSEnableLMHostsLookup = TRUE;
WINSScopeID = "";
}; instance of Win32_NetworkAdapterConfiguration
{
Caption = "[00000017] Microsoft ISATAP Adapter";
Description = "Microsoft ISATAP Adapter";
DHCPEnabled = FALSE;
Index = 17;
InterfaceIndex = 17;
IPEnabled = FALSE;
ServiceName = "tunnel";
SettingID = "{C21107AF-5813-4D7B-A4C1-3C16CA00FA2C}";
};

nic.out

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

  1. Django项目:CMDB(服务器硬件资产自动采集系统)--12--08CMDB采集硬件数据日志记录

    #settings.py # ————————01CMDB获取服务器基本信息———————— import os BASEDIR = os.path.dirname(os.path.dirname(o ...

  2. Django项目:CMDB(服务器硬件资产自动采集系统)--11--07CMDB文件模式测试采集硬件数据

    #settings.py # ————————01CMDB获取服务器基本信息———————— import os BASEDIR = os.path.dirname(os.path.dirname(o ...

  3. Django项目:CMDB(服务器硬件资产自动采集系统)--06--06CMDB测试Linux系统采集硬件数据的命令01

    #base.py # ————————01CMDB获取服务器基本信息———————— from config import settings #配置文件 class BasePlugin(object ...

  4. Django项目:CMDB(服务器硬件资产自动采集系统)--07--06CMDB测试Linux系统采集硬件数据的命令02

    #settings.py """ Django settings for AutoCmdb project. Generated by 'django-admin sta ...

  5. Django项目:CMDB(服务器硬件资产自动采集系统)--10--06CMDB测试Linux系统采集硬件数据的命令05

    cd /py/AutoClient/bin python3 auto-client.py /usr/local/python3/bin/pip install requests python3 aut ...

  6. Django项目:CMDB(服务器硬件资产自动采集系统)--03--03CMDB信息安全API接口交互认证

    #settings.py """ Django settings for AutoCmdb project. Generated by 'django-admin sta ...

  7. Django项目:CMDB(服务器硬件资产自动采集系统)--02--02CMDB将服务器基本信息提交到API接口

    AutoCmdb # urls.py """AutoCmdb URL Configuration The `urlpatterns` list routes URLs t ...

  8. Django项目:CMDB(服务器硬件资产自动采集系统)--04--04CMDB本地(Agent)模式客户端唯一标识(ID)

    # client.py # ————————01CMDB获取服务器基本信息———————— from src import plugins #__init__.py from lib.serializ ...

  9. Django项目:CMDB(服务器硬件资产自动采集系统)--01--01CMDB获取服务器基本信息

    AutoClient #settings.py # ————————01CMDB获取服务器基本信息———————— import os BASEDIR = os.path.dirname(os.pat ...

随机推荐

  1. JPA 基本使用

    ORM简介 对象关系映射(Object Relational Mapping,简称ORM),是一种程序技术,用于实现面向对象编程语言里不同类型系统的数据之间的转换. 实现ORM思想的框架:Mybati ...

  2. 一个因为系统字号设置导致的rem计算渲染异常问题

    测试同学突然拿着一部手机过来说,H5渲染各个元素都变大了,有些元素撑出了屏幕外面. 本来以为是某个Webview的渲染兼容问题,结果发现所有的浏览器都这样. 莫名其妙,隐约感觉是 rem计算出了问题, ...

  3. 初识OpenCV-Python - 005: 识别视频中的蓝色

    此次主要学习了如何将BGR转成HSV,主要用到cv2.cvtColor()和cv2.inRange()函数来识别视频中的蓝色物体. code: import cv2import numpy as np ...

  4. Mybatis Resultmap 简化之超级父类

    我们在写 mybatis多表关联查询的时候 ,要配置  resultmap ,实在太麻烦.而这个超级父类 可以省去我们查询多表时的map public class SuperPojo extends ...

  5. Spark历险记之编译和远程任务提交

    Spark简介 Spark是加州大学伯克利分校AMP实验室(Algorithms, Machines, and People Lab)开发通用内存并行计算框架.Spark在2013年6月进入Apach ...

  6. idea创建web项目,springboot项目,maven项目

    web项目搭建 https://www.cnblogs.com/jxldjsn/p/8203859.html

  7. vue倒计时:天时分秒

    data数据定义 data () { return { curStartTime: '2019-07-31 08:00:00', day: '0', hour: '00', min: '00', se ...

  8. Java参数校验工具validation实践

    介绍 在项目开发当中,数据校验是你必须要考虑和面对的事情,为此要写上一大串的代码进行校验,这样就会导致代码冗余和一些管理的问题. 例如下面的代码: public void push(List<L ...

  9. vs Code打开新的文件会覆盖窗口中的文件?

    这是因为你单击文件名的缘故,这个是“预览模式”,所以再单击其他文件时,会覆盖当前打开的文件. 如果你要每次都打开新tab,那就双击文件名好了.这个逻辑和sublime是一样的. 补充: 预览模式是现在 ...

  10. CSS自动换行、强制不换行、强制断行、超出显示省略号

    转自:https://blog.csdn.net/liuyan19891230/article/details/50969393 P标签是默认是自动换行的,因此设置好宽度之后,能够较好的实现效果,但是 ...