/// <summary> /// Initializes a new instance of the <see cref="KunLunServer" /> class. /// </summary> /// <param name="x">The x.</param> /// <param name="eSightIp">The e sight ip.</param> public void MakeDetail(HWDeviceDetail x, string eSightIp) { this.ESight = eSightIp; this.CPUNums = x.CPUNums; this.Description = x.Description; this.DN = x.DN; this.DeviceId = $"{eSightIp}-{ x.DN}"; this.IpAddress = x.IpAddress; this.MemoryCapacity = x.MemoryCapacity; this.Mode = x.Mode; this.Name = x.Name; this.ProductSN = x.ProductSN; this.Status = x.Status; this.Type = x.Type; this.UUID = x.UUID; this.SmmMacAddr = x.SmmMacAddr; this.RealTimePower = x.RealTimePower; this.CPUCores = x.CPUCores; this.BmcMacAddr = x.BmcMacAddr; this.DiskList = x.DiskList ?? new List <HWDisk>(); this.PowerSupplyList = x.PSUList ?? new List <HWPSU>(); this.FanList = x.FANList ?? new List <HWFAN>(); this.BoardList = x.BoardList ?? new List <HWBoard>(); this.RaidList = x.RaidList ?? new List <HWRAID>(); }
/// <summary> /// The make detail. /// </summary> /// <param name="detail">The detail.</param> /// <param name="eSightIp">The e sight ip.</param> public void MakeDetail(HWDeviceDetail detail, string eSightIp) { var hmm = new HWHMM { DN = detail.DN, IpAddress = detail.IpAddress, Name = detail.Name, Type = detail.Type, UUID = detail.UUID, OriStatus = detail.Status, SmmMacAddr = detail.SmmMacAddr, RealTimePower = detail.RealTimePower, ProductSN = detail.ProductSN }; this.DN = detail.DN; this.ServerName = $"{eSightIp}-{detail.Name}"; this.ESight = eSightIp; this.DeviceId = $"{eSightIp}-{ detail.DN}"; this.HmmInfo = hmm; this.FanList = detail.FANList; this.SwitchList = detail.BoardList.Where(x => x.BoardType == 1) .Select(x => new ChildSwithBoard(x, eSightIp)).ToList(); this.PowerSupplyList = detail.PSUList; }
/// <summary> /// 开启首次更新的任务 /// </summary> public void StartFirstUpdateTask() { Task.Run(() => { Thread.Sleep(TimeSpan.FromSeconds(60)); DeviceFirst = ESightSyncInstance.Session.GetServerDetails(this.Dn); UpdateAction(DeviceFirst, this.AlarmSn); }); }
/// <summary> /// The make child blade detail. /// </summary> /// <param name="detail"> /// The detail. /// </param> public void MakeChildBladeDetail(HWDeviceDetail detail) { this.CPUList = detail.CPUList; this.DiskList = detail.DiskList; this.MemoryList = detail.MemoryList; this.MezzList = detail.MezzList; this.RaidList = detail.RaidList; this.UUID = detail.UUID; this.Status = detail.Status; this.Mode = detail.Mode; }
/// <summary> /// The make child blade detail. /// </summary> /// <param name="detail"> /// The detail. /// </param> public void MakeChildBladeDetail(HWDeviceDetail detail) { this.CPUList = detail.CPUList; this.DiskList = detail.DiskList; this.MemoryList = detail.MemoryList; this.RaidList = detail.RaidList; this.UUID = detail.UUID; this.Status = detail.Status; this.Mode = detail.Mode; this.Type = detail.Type; this.ProductSn = detail.ProductSN; }
/// <summary> /// 更新子刀片 /// </summary> /// <param name="model">The model.</param> public void UpdateSwitchBoard(HWDeviceDetail model) { try { this.OnNotifyError($"UpdateSwitchBoard Error.eSight not support. eSight:{this.ESightIp} Dn:{model.DN}. "); //BladeConnector.Instance.UpdateSwitch(model); } catch (Exception ex) { this.OnNotifyError($"UpdateSwitchBoard Error.eSight:{this.ESightIp} Dn:{model.DN}. ", ex); } }
/// <summary> /// 更新子刀片 /// </summary> /// <param name="model">The model.</param> public void UpdateChildBladeServer(HWDeviceDetail model) { try { var server = new ChildBlade(this.ESightIp); server.MakeChildBladeDetail(model); BladeConnector.Instance.UpdateChildBlade(server); } catch (Exception ex) { this.OnNotifyError($"UpdateChildBladeServer Error.eSight:{this.ESightIp} Dn:{model.DN}. ", ex); } }
/// <summary> /// 更新机架 /// </summary> /// <param name="model">The model.</param> public void UpdateRackServer(HWDeviceDetail model) { try { var server = new RackServer(); server.MakeDetail(model, this.ESightIp); RackConnector.Instance.UpdateRack(server); } catch (Exception ex) { this.OnNotifyError($"UpdateRackServer Error.eSight:{this.ESightIp} Dn:{model.DN}. ", ex); } }
/// <summary> /// 更新机架 /// </summary> /// <param name="model">The model.</param> /// <param name="alarmSn">The alarm sn.</param> private void UpdateRackServer(HWDeviceDetail model, int alarmSn) { try { logger.NotifyProcess.Info($"Start Update RackServer:{model.DN}"); var server = new RackServer(); server.MakeDetail(model, this.ESightIp); RackConnector.Instance.UpdateRack(server, false); } catch (Exception ex) { logger.NotifyProcess.Error(ex, $"UpdateRackServer Error.Dn:{model.DN}.[alarmSn:{alarmSn}]"); } }
/// <summary> /// 更新昆仑 /// </summary> /// <param name="model">The model.</param> public void UpdateKunLunServer(HWDeviceDetail model) { try { var server = new KunLunServer(); server.ESight = this.ESightIp; server.MakeDetail(model); KunLunConnector.Instance.UpdateKunLun(server); } catch (Exception ex) { this.OnNotifyError($"UpdateKunLunServer Error.eSight:{this.ESightIp} Dn:{model.DN}. ", ex); } }
/// <summary> /// 当Dn为高密子服务器的DN时,需要更新整个管理板 /// </summary> /// <param name="model">The model.</param> /// <param name="alarmSn">The alarm sn.</param> private void UpdateChildHighdensityServer(HWDeviceDetail model, int alarmSn) { try { logger.NotifyProcess.Info($"Start Update Child HighdensityServer:{model.DN} .[alarmSn:{alarmSn}]"); //更新子刀片 var server = new ChildHighdensity(this.ESightIp); server.MakeChildBladeDetail(model); HighdensityConnector.Instance.UpdateChildBoard(server, false); } catch (Exception ex) { logger.NotifyProcess.Error(ex, $"UpdateChildHighdensityServer Error.Dn:{model.DN} .[alarmSn:{alarmSn}] "); } }
/// <summary> /// The make child blade detail. /// </summary> /// <param name="detail"> /// The detail. /// </param> public void MakeChildBladeDetail(HWDeviceDetail detail) { this.DN = detail.DN; this.Name = detail.Name; this.IpAddress = detail.IpAddress; this.DeviceId = $"{this.ESight}-{ detail.DN}"; this.CPUList = detail.CPUList; this.DiskList = detail.DiskList; this.MemoryList = detail.MemoryList; this.MezzList = detail.MezzList; this.RaidList = detail.RaidList; this.UUID = detail.UUID; this.Status = detail.Status; this.Mode = detail.Mode; }
/// <summary> /// 更新高密子服务器 /// </summary> /// <param name="model">The model.</param> public void UpdateChildHighdensityServer(HWDeviceDetail model) { try { var server = new ChildHighdensity(); server.DN = model.DN; server.Name = model.Name; server.IpAddress = model.IpAddress; server.MakeChildBladeDetail(model); HighdensityConnector.Instance.UpdateChildBoard(server); } catch (Exception ex) { this.OnNotifyError($"UpdateChildHighdensityServer Error.eSight:{this.ESightIp} Dn:{model.DN}. ", ex); } }
/// <summary> /// The make detail. /// </summary> /// <param name="detail"> /// The detail. /// </param> public void MakeDetail(HWDeviceDetail detail) { var hmm = new HWHMM { DN = detail.DN, IpAddress = detail.IpAddress, Name = detail.Name, Type = detail.Type, UUID = detail.UUID, Status = detail.Status, SmmMacAddr = detail.SmmMacAddr, RealTimePower = detail.RealTimePower, ProductSN = detail.ProductSN }; this.HmmInfo = hmm; this.FanList = detail.FANList; this.PowerSupplyList = detail.PSUList; }
/// <summary> /// 更新刀片机架 /// </summary> /// <param name="model">The model.</param> public void UpdateBladeServer(HWDeviceDetail model) { try { var server = new BladeServer { DN = model.DN, ServerName = model.Name, Manufacturer = string.Empty, ServerModel = model.Mode, IpAddress = model.IpAddress, Location = string.Empty, Status = model.Status }; server.MakeDetail(model, this.ESightIp); BladeConnector.Instance.UpdateMainWithOutChildBlade(server); } catch (Exception ex) { this.OnNotifyError($"UpdateBladeServer Error.eSight:{this.ESightIp} Dn:{model.DN}. ", ex); } }
/// <summary> /// The make detail. /// </summary> /// <param name="detail">The detail.</param> /// <param name="eSightIp">The e sight ip.</param> public void MakeDetail(HWDeviceDetail detail, string eSightIp) { //高密服务器根据管理板Dn查询详情返回的是第一个子刀片的dn因此不等于deatial的dn var hmm = new HWHMM { DN = this.DN, IpAddress = detail.IpAddress, Name = detail.Name, Type = detail.Type, UUID = detail.UUID, Status = detail.Status, SmmMacAddr = detail.SmmMacAddr, RealTimePower = detail.RealTimePower, ProductSN = detail.ProductSN }; this.ESight = eSightIp; //this.DN = detail.DN; this.DeviceId = $"{eSightIp}-{ this.DN}"; this.HmmInfo = hmm; this.FanList = detail.FANList; this.PowerSupplyList = detail.PSUList; }
/// <summary> /// 更新高密管理板 /// </summary> /// <param name="model">The model.</param> /// <param name="alarmSn">The alarm sn.</param> private void UpdateHighdensityServer(HWDeviceDetail model, int alarmSn) { try { logger.NotifyProcess.Info($"Start Update HighdensityServer:{model.DN} .[alarmSn:{alarmSn}]"); var server = new HighdensityServer { DN = model.DN, ServerName = model.Name, Manufacturer = string.Empty, ServerModel = model.Mode, IpAddress = model.IpAddress, Location = string.Empty, Status = model.Status }; server.MakeDetail(model, this.ESightIp); HighdensityConnector.Instance.UpdateMain(server, false); } catch (Exception ex) { logger.NotifyProcess.Error(ex, $"UpdateHighdensityServer Error.Dn:{model.DN} .[alarmSn:{alarmSn}] "); } }
/// <summary> /// Initializes a new instance of the <see cref="RackServer" /> class. /// </summary> /// <param name="x">The x.</param> /// <param name="eSightIp">The e sight ip.</param> public void MakeDetail(HWDeviceDetail x, string eSightIp) { this.ServerName = x.Name; this.iBMCIPv4Address = x.IpAddress; this.ESight = eSightIp; this.Type = x.Type; this.UUID = x.UUID; this.Status = x.Status; this.AveragePower = x.AveragePower; this.PeakPower = x.PeakPower; this.PowerConsumption = x.PowerConsumption; this.DNSServerIP = x.DNSServerIP; this.DNSName = x.DNSName; this.ProductSN = x.ProductSN; this.HostName = x.HostName; this.CPUNums = x.CPUNums; this.CPUCores = x.CPUCores; this.CPUList = x.CPUList ?? new List <HWCPU>(); this.MemoryCapacity = x.MemoryCapacity; //this.BMCVersion = x.BMCVersion; this.DN = x.DN; this.BoardList = x.BoardList ?? new List <HWBoard>(); this.DeviceId = $"{eSightIp}-{ x.DN}"; }
public bool CheckIsChange(HWDeviceDetail firstDevice, HWDeviceDetail lastDevice) { return(JsonUtil.SerializeObject(firstDevice) != JsonUtil.SerializeObject(lastDevice)); }