/// <summary>
        /// Queries the blade detial.
        /// </summary>
        /// <param name="x">The x.</param>
        public void QueryBladeDetial(BladeServer x)
        {
            var task = Task.Run(() =>
            {
                try
                {
                    var device = this.Session.GetServerDetails(x.DN);
                    x.MakeDetail(device);
                    x.ChildBlades.ForEach(m =>
                    {
                        var deviceDatail = this.Session.GetServerDetails(m.DN);
                        m.MakeChildBladeDetail(deviceDatail);
                    });

                    // 插入數據
                    BladeConnector.Instance.InsertDetials(x);
                }
                catch (Exception ex)
                {
                    this.OnError($"QueryBladeDetial Error:DN:{x.DN}", ex);
                }
            });

            this.taskList.Add(task);
        }
Exemple #2
0
        /// <summary>
        /// Queries the blade detial.
        /// </summary>
        /// <param name="x">The x.</param>
        private void QueryBladeDetial(BladeServer x)
        {
            var task = taskFactory.StartNew(() =>
            {
                try
                {
                    var device = this.Session.GetServerDetails(x.DN);
                    x.MakeDetail(device, this.ESightIp);
                    x.ChildBlades.ForEach(m =>
                    {
                        var deviceDatail = this.Session.GetServerDetails(m.DN);
                        m.MakeChildBladeDetail(deviceDatail);
                    });

                    // 插入數據
                    BladeConnector.Instance.SyncServer(x);
                }
                catch (Exception ex)
                {
                    OnPollingError($"QueryBladeDetial Error:DN:{x.DN}", ex);
                }
            }, cts.Token);

            this.taskList.Add(task);
        }
Exemple #3
0
 /// <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>
 /// 更新刀片机架
 /// </summary>
 /// <param name="model">The model.</param>
 /// <param name="alarmSn">The alarm sn.</param>
 private void UpdateBladeServer(HWDeviceDetail model, int alarmSn)
 {
     try
     {
         logger.NotifyProcess.Info($"Start Update BladeServer:{model.DN}.[alarmSn:{alarmSn}]");
         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.UpdateBlade(server, false);
     }
     catch (Exception ex)
     {
         logger.NotifyProcess.Error(ex, $"UpdateBladeServer Error. Dn:{model.DN}.[alarmSn:{alarmSn}]");
     }
 }