protected void Page_Load(object sender, EventArgs e)
        {
            HistoryValueDA mda = new HistoryValueDA();//	GetDeviceChanncelValuesList(
            DataTable dt = mda.GetDeviceChanncelValuesList(60001, 211, 21103, DateTime.Now.AddHours(-1), DateTime.Now);

            chLine.Series["Series1"].Points.DataBindXY(dt.Rows, "DeviceName", dt.Rows, "maxVal");//接收
            chLine.Series["Series1"]["DrawingStyle"] = "Cylinder";
        }
Example #2
0
        private void InitData()
        {
            BindGraid();
            string mDeviceID = Request.QueryString["id"];
            int iDeviceID = Convert.ToInt32(Request.QueryString["id"]);
            DeviceOR _objDev = new DeviceDA().SelectDeviceORByID(mDeviceID);
            PerfDBOR _Obj = new PerfDBDA().SelectDeviceDetail(mDeviceID);
            DeviceOREx _objDevEx = new DeviceDA().SelectDeviceORExByID(mDeviceID);

            State = _objDevEx.StatusVal;

            Health = _objDevEx.HealthStatusVal;

            lblState.Text = _objDevEx.State;

            lblServName.Text =  _objDev.DeviceName;
            lblAuthType.Text = _objDev.AuthType;
            lblVersion.Text = _objDev.Version;
            lblStartUpTime.Text = _Obj.StartUpTime;
            lblPort.Text = _objDev.Port;
            lblHostName.Text = _objDev.OperSystem;
            lblSystem.Text = _objDev.HostName;
            lblLastPollingTime.Text = _objDev.LastPollingTime.ToString();
            lblNextPollingTime.Text = _objDev.NextPollingTime.ToString();

            lblValue.Text = _Obj.ConnectionTime;
            lblUserNO.Text = _Obj.UserNO;

            lblServerSize.Text = _Obj.ServerSize;
            lblAverageExecutionTime.Text = _Obj.AverageExecutionTime;
            lblReadingTimes.Text = _Obj.ReadingTimes;
            lblWritingTimes.Text = _Obj.WritingTimes;
            lblBlockSize.Text = _Obj.BlockSize;

            #region 绑定 可用性
            DataPoint dp = new DataPoint();
            dp.LegendText = string.Format("{0}({1}%)", "可用", _objDev.AvailableRate);
            double[] d = { Convert.ToDouble(_objDev.AvailableRate) };
            dp.Color = Color.Green;
            dp.YValues = d;
            chtPerf.Series["Series1"].Points.Add(dp);

            dp = new DataPoint();
            dp.LegendText = string.Format("{0}({1}%)", "不可用", 100 - _objDev.AvailableRate);
            double[] dno = { Convert.ToDouble(100 - _objDev.AvailableRate) };
            dp.Color = Color.Red;
            dp.YValues = dno;
            chtPerf.Series["Series1"].Points.Add(dp);
            #endregion

            #region 绑定 共享的SGA
            DataPoint dpSGA = new DataPoint();
            dpSGA.LegendText = string.Format("{0}({1}M)", "库存储器大小", _Obj.LibraryMemorySize);
            double[] dSGA = { _Obj.LibraryMemorySize };
            dpSGA.Color = Color.Green;
            dpSGA.YValues = dSGA;
            chtSGA.Series["Series1"].Points.Add(dpSGA);

            dpSGA = new DataPoint();
            dpSGA.LegendText = string.Format("{0}({1}M)", "数据字典存储器", _Obj.DataDictionaryMemory);
            double[] dSGA2 = { _Obj.DataDictionaryMemory };
            dpSGA.Color = Color.Red;
            dpSGA.YValues = dSGA2;
            chtSGA.Series["Series1"].Points.Add(dpSGA);

            dpSGA = new DataPoint();
            dpSGA.LegendText = string.Format("{0}({1}M)", "SG区域大小", _Obj.SGSize);
            double[] dSGA3 = { _Obj.SGSize };
            dpSGA.Color = Color.Blue;
            dpSGA.YValues = dSGA3;
            chtSGA.Series["Series1"].Points.Add(dpSGA);

            dpSGA = new DataPoint();
            dpSGA.LegendText = string.Format("{0}({1}M)", "固定的区域大小", _Obj.FixedRegionSize);
            double[] dSGA4 = { _Obj.FixedRegionSize };
            dpSGA.Color = Color.Yellow;
            dpSGA.YValues = dSGA4;
            chtSGA.Series["Series1"].Points.Add(dpSGA);

            dpSGA = new DataPoint();
            dpSGA.LegendText = string.Format("{0}({1}M)", "缓冲存储器大小", _Obj.BufferMemorySize);
            double[] dSGA5 = { _Obj.BufferMemorySize };
            dpSGA.Color = Color.Orange;
            dpSGA.YValues = dSGA5;
            chtSGA.Series["Series1"].Points.Add(dpSGA);

            dpSGA = new DataPoint();
            dpSGA.LegendText = string.Format("{0}({1}M)", "共享池大小", _Obj.ShareSize);
            double[] dSGA6 = { _Obj.ShareSize };
            dpSGA.Color = Color.OldLace;
            dpSGA.YValues = dSGA6;
            chtSGA.Series["Series1"].Points.Add(dpSGA);
            #endregion

            #region 绑定,曲线
            HistoryValueDA mDA = new HistoryValueDA();

            DateTime StartTime = DateTime.Now.AddHours(-1);
            DateTime EndTime = DateTime.Now;

            // 连接时间-最后一小时
            DataTable dte = mDA.GetDeviceChanncelValue(iDeviceID, 41101, StartTime, EndTime);//流入错误数
            if (dte != null)
            {
                chLine.Series["Series1"].Points.DataBindXY(dte.Rows, "Time", dte.Rows, "MonitorValue");
            }

            // 用户活动性-最后一小时
            DataTable dt = mDA.GetDeviceChanncelValue(iDeviceID, 41201, StartTime, EndTime);//流入错误数
            if (dt != null)
            {
                chUserActivity.Series["Series1"].Points.DataBindXY(dt.Rows, "Time", dt.Rows, "MonitorValue");
            }

            #endregion
        }
        private void InitData()
        {
            //BindGraidDiskUsage();
            BindGraidVirtualSystem();
            string mDeviceID = Request.QueryString["id"];
            int iDeviceID = Convert.ToInt32(Request.QueryString["id"]);
            DeviceOR _objDev = new DeviceDA().SelectDeviceORByID(mDeviceID);
            DeviceOREx _objDevEx = new DeviceDA().SelectDeviceORExByID(mDeviceID);
            PerfVirtualOR _pv = new PerfVirtualMachineDA().SelectVirtualDetail(mDeviceID);

            lblMonitorName.Text = _objDev.DeviceName;
            lblDescribe.Text = _objDev.Describe;
            Health = _objDevEx.HealthStatusVal;
            State = _objDevEx.StatusVal;

            lblLastPollingTime.Text = _objDev.LastPollingTime.ToString();
            lblNextPollingTime.Text = _objDev.NextPollingTime.ToString();
            lblPerformance.Text = _objDevEx.State;

            lblPerf.Text = _objDevEx.State;

            lblCPUUtilizationRatio.Text = _pv.CPUUtilizationRatio.ToString();
            lblMemoryUtilization.Text = _pv.MemoryUtilization.ToString();
            lblCPUUtilization.Text = _pv.CPUUsage.ToString();
            //if (_pv.CPUUtilizationRatio > 50)
            //{
            //    lblCPUUtilization.Text = "异常";
            //}
            //else if (_pv.CPUUtilizationRatio < 50)
            //{
            //    lblCPUUtilization.Text = "正常";
            //}

            lblDiskUsage.Text = _pv.DiskUsage.ToString();
            lblNetworkUsage.Text = _pv.NetUsage.ToString();

            #region 绑定 可用性
            DataPoint dp = new DataPoint();
            dp.LegendText = string.Format("{0}({1}%)", "可用", _objDev.AvailableRate);
            double[] d = { Convert.ToDouble(_objDev.AvailableRate) };
            dp.Color = Color.Green;
            dp.YValues = d;
            chtPerf.Series["Series1"].Points.Add(dp);

            dp = new DataPoint();
            dp.LegendText = string.Format("{0}({1}%)", "不可用", 100 - _objDev.AvailableRate);
            double[] dno = { Convert.ToDouble(100 - _objDev.AvailableRate) };
            dp.Color = Color.Red;
            dp.YValues = dno;
            chtPerf.Series["Series1"].Points.Add(dp);
            #endregion

            //绑定,曲线
            HistoryValueDA mDA = new HistoryValueDA();
            #region 今天接收、发送
            DateTime StartTime = Convert.ToDateTime(string.Format("{0} 00:00:00", DateTime.Now.ToString("yyyy-MM-dd")));
            DateTime EndTime = Convert.ToDateTime(string.Format("{0} 23:59:59", DateTime.Now.ToString("yyyy-MM-dd")));

            // 磁盘、网络使用情况
            DataTable dte = mDA.GetDeviceChanncelValue(iDeviceID, 91303, StartTime, EndTime);//磁盘使用率
            if (dte != null)
            {
                chLine.Series["Series1"].Points.DataBindXY(dte.Rows, "Time", dte.Rows, "MonitorValue");
            }
            dte = mDA.GetDeviceChanncelValue(iDeviceID, 91403, StartTime, EndTime);//网络使用率
            if (dte != null)
            {
                chLine.Series["Series2"].Points.DataBindXY(dte.Rows, "Time", dte.Rows, "MonitorValue");
            }
            #endregion
        }
        private void InitData()
        {
            BindGraidConversationDetail();
            BindGraidThreadDetail();
            BindGraidPoolingDetails();
            BindGraidServerResponseTime();
            //BindGraidUndecided();
            BindGraidThreadWait();
            BindGraidJVMHeap();

            string mDeviceID = Request.QueryString["id"];
            int iDeviceID = Convert.ToInt32(Request.QueryString["id"]);
            DeviceOR _objDev = new DeviceDA().SelectDeviceORByID(mDeviceID);
            DeviceOREx _objDevEx = new DeviceDA().SelectDeviceORExByID(mDeviceID);
            PerfMiddlewareOR _pm = new PerfMiddlewareDA().SelectDeviceDetail(mDeviceID);
            lblState.Text = _objDev.Performance;
            State = _objDevEx.StatusVal;
            health = _objDevEx.HealthStatusVal;

            lblName.Text = _objDev.DeviceName;
            //lblWarningStatus.Text = _objDevEx.WarningStatus;
            lblType.Text = _objDevEx.TypeName;
            lblWeblogic.Text = _objDev.Version;
            lblPort.Text = _objDev.Port;
            lblHostName.Text = _pm.HostName;
            lblSystem.Text = _objDev.ServName;
            lblLastPollingTime.Text = _objDev.LastPollingTime.ToString();
            lblNextPollingTime.Text = _objDev.NextPollingTime.ToString();

            #region 绑定 可用性
            DataPoint dp = new DataPoint();
            dp.LegendText = string.Format("{0}({1}%)", "可用", _objDev.AvailableRate);
            double[] d = { Convert.ToDouble(_objDev.AvailableRate) };
            dp.Color = Color.Green;
            dp.YValues = d;
            chtPerf.Series["Series1"].Points.Add(dp);

            dp = new DataPoint();
            dp.LegendText = string.Format("{0}({1}%)", "不可用", 100 - _objDev.AvailableRate);
            double[] dno = { Convert.ToDouble(100 - _objDev.AvailableRate) };
            dp.Color = Color.Red;
            dp.YValues = dno;
            chtPerf.Series["Series1"].Points.Add(dp);
            #endregion

            //绑定,曲线
            HistoryValueDA mDA = new HistoryValueDA();

            #region 三个图形,绑定值
            DateTime StartTime = DateTime.Now.AddHours(-1);
            DateTime EndTime = DateTime.Now;

            // Web应用 -最近1小时最高用户会话(前5位)
            DataTable dte = new PerfMiddlewareDA().SelectWebSessionImg(iDeviceID, StartTime, EndTime);
            if (dte != null)
            {
                chLine.Series["Series1"].Points.DataBindXY(dte.Rows, "DeviceName", dte.Rows, "maxval");
                chLine.Series["Series1"].ChartType = SeriesChartType.Column;
                chLine.Series["Series1"]["DrawingStyle"] = "Cylinder";
            }
            //线程使用-最后1小时
            dte = new PerfMiddlewareDA().SelectWebSessionImg(iDeviceID, StartTime, EndTime);
            if (dte != null)
            {
                chThread.Series["Series1"].Points.DataBindXY(dte.Rows, "DeviceName", dte.Rows, "maxval");
                chThread.Series["Series1"].ChartType = SeriesChartType.Column;
                chThread.Series["Series1"]["DrawingStyle"] = "Cylinder";
            }

            //最近1小时的JVM堆使用情况图表
            dte = mDA.GetDeviceChanncelValue(iDeviceID, 22505, StartTime, EndTime);
            if (dte != null)
            {
                chJVMHeap.Series["Series1"].Points.DataBindXY(dte.Rows, "Time", dte.Rows, "MonitorValue");
                //chJVMHeap.ChartAreas[0].AxisY.LabelStyle.Format = "{0}KB";
            }
            #endregion
        }
Example #5
0
 /// <summary>
 /// Web应用 -最近1小时最高用户会话(前5位)
 /// </summary>
 /// <param name="DeviceID"></param>
 /// <param name="StartTime"></param>
 /// <param name="EndTime"></param>
 /// <returns></returns>
 public DataTable SelectWebSessionImg(int DeviceID, DateTime StartTime, DateTime EndTime)
 {
     string strTableName = new HistoryValueDA().GetTableName(DeviceID);
     if (string.IsNullOrEmpty(strTableName))
     {
         return null;
     }
     string sql = string.Format(@"
     select top 5 gro.*,ditem.DeviceName from (
         select  DeviceID,avg(monitorvalue) maxval from (
         select  DeviceID,convert(bigint, monitorvalue) monitorvalue
             from {0}
             where channelno=21102  and  MonitorTime>'{1}' and MonitorTime<'{2}'
         ) as d
         group by DeviceID
     ) as gro
     inner join t_DevItemList ditem on ditem.DeviceID= gro.DeviceID
     order by maxval", strTableName
                     ,StartTime.ToString("yyyy-MM-dd HH:mm:ss")
                     , EndTime.ToString("yyyy-MM-dd HH:mm:ss"));
     return db.ExecuteQuery(sql);
 }
        private void InitData()
        {
            BindGraidSystem();
            BindGraidDetail();
            BindGraidDisk();
            BindGraidPageSpace();
            BindGraidDiskStatistics();

            string mDeviceID = Request.QueryString["id"];
            int iDeviceID = Convert.ToInt32(Request.QueryString["id"]);
            DeviceOR _objDev = new DeviceDA().SelectDeviceORByID(mDeviceID);
            DeviceOREx _objDevEx = new DeviceDA().SelectDeviceORExByID(mDeviceID);
            PerfApplicationOR _pa = new PerfApplicationDA().SelectPerfApplication(mDeviceID);

            perf = _objDev.Performance;
            lblPerf.Text = _objDev.Performance;
            lblPerformance.Text = _objDev.Performance;
            lblDescribe.Text = _objDev.Describe;
            lblLastPollingTime.Text = _objDev.LastPollingTime.ToString();
            lblNextPollingTime.Text = _objDev.NextPollingTime.ToString();

            lblMonitorName.Text = _pa.MonitorName;
            lblHostName.Text = _pa.HostName;
            lblOperatingSystem.Text =_objDev.OperSystem;
            lblIP.Text = _objDev.IP;
            lblWarningStatus.Text = _objDevEx.WarningStatus;

            lblSwapMemoryUtilization.Text = _pa.SwapMemoryUtilization;
            lblSwapMemoryUtilizationMB.Text = _pa.SwapMemoryUtilizationMB;
            lblCPUMemoryUtilization.Text = _pa.CPUMemoryUtilization;
            lblPhysicalpMemoryUtilization.Text = _pa.PhysicalpMemoryUtilization;
            lblPhysicalpMemoryUtilizationMB.Text = _pa.PhysicalpMemoryUtilizationMB;
            lblFreePhysicalpMemory.Text = _pa.FreePhysicalpMemory;

            #region 绑定 可用性
            DataPoint dp = new DataPoint();
            dp.LegendText = string.Format("{0}({1}%)", "可用", _objDev.AvailableRate);
            double[] d = { Convert.ToDouble(_objDev.AvailableRate) };
            dp.Color = Color.Green;
            dp.YValues = d;
            chtPerf.Series["Series1"].Points.Add(dp);

            dp = new DataPoint();
            dp.LegendText = string.Format("{0}({1}%)", "不可用", 100 - _objDev.AvailableRate);
            double[] dno = { Convert.ToDouble(100 - _objDev.AvailableRate) };
            dp.Color = Color.Red;
            dp.YValues = dno;
            chtPerf.Series["Series1"].Points.Add(dp);
            #endregion

            #region 绑定,曲线
            HistoryValueDA mDA = new HistoryValueDA();

            DateTime StartTime = DateTime.Now.AddHours(-6);
            DateTime EndTime = DateTime.Now;

            DateTime SystemStartTime = DateTime.Now.AddHours(-1);

            // CPU及内存使用率 - 最近六小时内
            DataTable dte = mDA.GetDeviceChanncelValue(iDeviceID, 25301, StartTime, EndTime);//交换内存使用率
            if (dte != null)
            {
                chLine.Series["Series1"].Points.DataBindXY(dte.Rows, "Time", dte.Rows, "MonitorValue");
            }
            dte = mDA.GetDeviceChanncelValue(iDeviceID, 25302, StartTime, EndTime);//物理内存使用率
            if (dte != null)
            {
                chLine.Series["Series2"].Points.DataBindXY(dte.Rows, "Time", dte.Rows, "MonitorValue");
            }
            dte = mDA.GetDeviceChanncelValue(iDeviceID, 25303, StartTime, EndTime);//CPU使用率
            if (dte != null)
            {
                chLine.Series["Series3"].Points.DataBindXY(dte.Rows, "Time", dte.Rows, "MonitorValue");
            }

            // 系统负荷 - 近一小时
            DataTable dt = mDA.GetDeviceChanncelValue(iDeviceID, 25501, SystemStartTime, EndTime);//每分钟的Job数
            if (dt != null)
            {
                chSystemLoad.Series["Series1"].Points.DataBindXY(dt.Rows, "Time", dt.Rows, "MonitorValue");
            }
            dt = mDA.GetDeviceChanncelValue(iDeviceID, 25502, SystemStartTime, EndTime);//5分钟的Job数
            if (dt != null)
            {
                chSystemLoad.Series["Series2"].Points.DataBindXY(dt.Rows, "Time", dt.Rows, "MonitorValue");
            }
            dt = mDA.GetDeviceChanncelValue(iDeviceID, 25503, SystemStartTime, EndTime);//15分钟的Job数
            if (dt != null)
            {
                chSystemLoad.Series["Series3"].Points.DataBindXY(dt.Rows, "Time", dt.Rows, "MonitorValue");
            }

            #endregion
        }
Example #7
0
        /// <summary>
        /// 最近1小时的JVM堆使用情况
        /// </summary>
        public DataTable selectJVMHeap( int ParentDevID)
        {
            DateTime EndTime = DateTime.Now;
            DateTime StartTime= DateTime.Now.AddHours(-1);
            string strTableName = new HistoryValueDA().GetTableName(ParentDevID);
            if (string.IsNullOrEmpty(strTableName))
            {
                return null;
            }

            string sql = string.Format(@"select f.*,TotalHeap.MonitorValue TotalHeap,CurrentHeap.MonitorValue CurrentHeap
            from(
            select max(convert(float,d.monitorvalue)) MaxHeap
            ,min(convert(float,d.monitorvalue)) MinHeap,
            round(avg(convert(float,d.monitorvalue)) ,2) AverageHeap
             from {0}  d
            where d.ChannelNO=22505 and  MonitorTime>'{1}' and MonitorTime<'{2}'
            ) as f
            left join t_TmpValue TotalHeap on TotalHeap.DeviceID= {3} and TotalHeap.ChannelNO=22504
            left join t_TmpValue CurrentHeap on CurrentHeap.DeviceID= {3} and CurrentHeap.ChannelNO=22505"
                , strTableName
                , StartTime.ToString("yyyy-MM-dd HH:mm:ss")
                , EndTime.ToString("yyyy-MM-dd HH:mm:ss")
                , ParentDevID);
            DataTable dt = null;
            //int returnC = 0;
            try
            {
                dt = db.ExecuteQuery(sql);//, pageCrrent, pageSize, out returnC);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            //pageCount = returnC;
            return dt;
        }
        private void InitData()
        {
            BindGraid();
            string mDeviceID = Request.QueryString["id"];
            int iDeviceID = Convert.ToInt32(Request.QueryString["id"]);
            DeviceOR _objDev = new DeviceDA().SelectDeviceORByID(mDeviceID);
            DeviceOREx _objDevEx = new DeviceDA().SelectDeviceORExByID(mDeviceID);

            lblName.Text = _objDev.DeviceName;
            Health = _objDevEx.HealthStatusVal;
            //switch (_objDevEx.HealthStatus)
            //{
            //    case "正常":
            //        Health = "1";
            //        break;
            //    case "故障":
            //        Health = "0";
            //        break;
            //    case "报警":
            //        Health = "2";
            //        break;
            //}
            lblType.Text = _objDevEx.TypeName;
            lblInterval.Text = _objDev.Interval;
            lblLastPollingTime.Text = _objDev.LastPollingTime.ToString();
            lblNextPollingTime.Text = _objDev.NextPollingTime.ToString();

            //lblAverageResponseTime.Text =
            //lblResponseTime.Text =

            #region 绑定 可用性
            DataPoint dp = new DataPoint();
            dp.LegendText = string.Format("{0}({1}%)", "可用", _objDev.AvailableRate);
            double[] d = { Convert.ToDouble(_objDev.AvailableRate) };
            dp.Color = Color.Green;
            dp.YValues = d;
            chtPerf.Series["Series1"].Points.Add(dp);

            dp = new DataPoint();
            dp.LegendText = string.Format("{0}({1}%)", "不可用", 100 - _objDev.AvailableRate);
            double[] dno = { Convert.ToDouble(100 - _objDev.AvailableRate) };
            dp.Color = Color.Red;
            dp.YValues = dno;
            chtPerf.Series["Series1"].Points.Add(dp);
            #endregion

            #region 绑定,曲线
            HistoryValueDA mDA = new HistoryValueDA();

            DateTime StartTime = DateTime.Now.AddHours(-1);
            DateTime EndTime = DateTime.Now;

            // 最近一小时性能
            DataTable dte = mDA.GetDeviceChanncelValue(iDeviceID, 24104, StartTime, EndTime);
            if (dte != null)
            {
                chLine.Series["Series1"].MarkerStyle = MarkerStyle.Circle;
                chLine.Series["Series1"].MarkerSize = 4;
                chLine.Series["Series1"].Points.DataBindXY(dte.Rows, "Time", dte.Rows, "MonitorValue");
            }

            // 特定URL响应时间(应答时间/ms)本视图5分钟自动最新数据
            DataTable dt = mDA.GetDeviceChanncelValue(iDeviceID, 24201, StartTime, EndTime);//应答时间/ms
            if (dt != null)
            {
                chtURL.Series["Series1"].Points.DataBindXY(dt.Rows, "Time", dt.Rows, "MonitorValue");
                chtURL.Series["Series1"].MarkerStyle = MarkerStyle.Circle;
                chtURL.Series["Series1"].MarkerSize = 4;
            }

            #endregion
        }
        private void InitData()
        {
            string mDeviceID = Request.QueryString["id"];
            int iDeviceID = Convert.ToInt32(Request.QueryString["id"]);
            //DeviceOR _objDev = new DeviceDA().SelectDeviceORByID(mDeviceID);
            PerNetPortDetailOR _Obj = new PerfNetDA().SelectNetPortDetail(mDeviceID);
            DeviceItemOREx _objDevEx = new DeviceDA().SelectDeviceItemORExByID(mDeviceID);
            ParentDevID = _objDevEx.ParentDevID;

            lblPort.Text = _objDevEx.Port;
            lblIpAddresses.Text = _objDevEx.IP;
            lblDescription.Text = _objDevEx.Describe;
            lblName.Text = _objDevEx.DeviceName;

            lblType.Text = _objDevEx.TypeName;

            Performance = _objDevEx.Performance;
            switch (_objDevEx.HealthStatus)
            {
                case "正常":
                    health = "1";
                    break;
                case "故障":
                    health = "0";
                    break;
                case "报警":
                    health = "2";
                    break;
            }

            lblPhysicalAddress.Text = _objDevEx.StationName;//这个有错

            lblCircuitID.Text = _Obj.CircuitID;
            lblSuperiorName.Text = _Obj.SuperiorName;
            lblIndex.Text = _Obj.Index;

            lblManagementState.Text = _Obj.ManagementState;
            lblOperatingStatus.Text = _Obj.OperatingStatus;

            lblReceiveBroadband.Text = _Obj.ReceiveBroadband;
            lblSendBroadband.Text = _Obj.SendBroadband;
            lblCurrentlyReceivingTraffic.Text = _Obj.CurrentlyReceivingTraffic;
            lblCurrentSendTraffic.Text = _Obj.CurrentSendTraffic;
            lblReceiveUtilization.Text = _Obj.UtilizationReceive;
            lblSendUtilization.Text = _Obj.UtilizationSend;
            lblReceivePacketsNumber.Text = _Obj.ReceiveNoS;
            lblSendPacketsNumber.Text = _Obj.SendNos;
            lblReceiveAverageSize.Text = _Obj.AverageSizeReceive;
            lblSendAverageSize.Text = _Obj.AverageSizeSend;

            #region 绑定 可用性
            if (_objDevEx != null)
            {
                DataPoint dp = new DataPoint();
                dp.LegendText = string.Format("{0}({1}%)", "可用", _objDevEx.AvailableRate);
                double[] d = { Convert.ToDouble(_objDevEx.AvailableRate) };
                dp.Color = Color.Green;
                dp.YValues = d;
                chtPerf.Series["Series1"].Points.Add(dp);

                dp = new DataPoint();
                dp.LegendText = string.Format("{0}({1}%)", "不可用", 100 - _objDevEx.AvailableRate);
                double[] dno = { Convert.ToDouble(100 - _objDevEx.AvailableRate) };
                dp.Color = Color.Red;
                dp.YValues = dno;
                chtPerf.Series["Series1"].Points.Add(dp);
            }
            #endregion

            //绑定,曲线
            HistoryValueDA mDA=new HistoryValueDA();
            #region 今天接收、发送
            DateTime StartTime= Convert.ToDateTime( string.Format("{0} 00:00:00",DateTime.Now.ToString("yyyy-MM-dd")));
            DateTime EndTime= Convert.ToDateTime(string.Format("{0} 23:59:59",DateTime.Now.ToString("yyyy-MM-dd")));

            // 流量-今天
            DataTable dt = mDA.GetDeviceChanncelValue(this.deviceID, ParentDevID, 33001, StartTime, EndTime);//接收
            if (dt != null)
            {
                chLine.Series["Series1"].Points.DataBindXY(dt.Rows, "Time", dt.Rows, "MonitorValue");//接收
            }

            dt = mDA.GetDeviceChanncelValue(this.deviceID, ParentDevID, 33002, StartTime, EndTime);//发送
            if (dt != null)
            {
                chLine.Series["Series2"].Points.DataBindXY(dt.Rows, "Time", dt.Rows, "MonitorValue");
            }

            // 错误数和丢包数-今天
            DataTable dte = mDA.GetDeviceChanncelValue(this.deviceID, ParentDevID, 37001, StartTime, EndTime);//流入错误数
            if (dte != null)
            {
                chtErrorSum.Series["Series1"].Points.DataBindXY(dte.Rows, "Time", dte.Rows, "MonitorValue");
            }

            dte = mDA.GetDeviceChanncelValue(this.deviceID, ParentDevID, 37002, StartTime, EndTime);//流出错误数
            if (dte != null)
            {
                chtErrorSum.Series["Series2"].Points.DataBindXY(dte.Rows, "Time", dte.Rows, "MonitorValue");
            }
            dte = mDA.GetDeviceChanncelValue(this.deviceID, ParentDevID, 37003, StartTime, EndTime);//流入丢包数
            if (dte != null)
            {
                chtErrorSum.Series["Series3"].Points.DataBindXY(dte.Rows, "Time", dte.Rows, "MonitorValue");
            }

            dte = mDA.GetDeviceChanncelValue(this.deviceID, ParentDevID, 37004, StartTime, EndTime);//流出丢包数
            if (dte != null)
            {
                chtErrorSum.Series["Series4"].Points.DataBindXY(dte.Rows, "Time", dte.Rows, "MonitorValue");
            }

            // 发送字数总量-今天
            DataTable dts = mDA.GetDeviceChanncelValue(this.deviceID, ParentDevID, 38001, StartTime, EndTime);//InBytes
            if (dts != null)
            {
                chtSendSum.Series["Series1"].Points.DataBindXY(dts.Rows, "Time", dts.Rows, "MonitorValue");
            }

            dts = mDA.GetDeviceChanncelValue(this.deviceID, ParentDevID, 38002, StartTime, EndTime);//OutBytes
            if (dts != null)
            {
                chtSendSum.Series["Series2"].Points.DataBindXY(dts.Rows, "Time", dts.Rows, "MonitorValue");
            }

            #endregion
        }
Example #10
0
        private void InitData()
        {
            BindGraidSystem();
            BindGraidDetail();
            BindGraidDisk();
            BindGraidPageSpace();
            BindGraidDiskStatistics();
            divNetworkPort.Visible = false;
            divServiceDetail.Visible = false;
            divEvent.Visible = false;

            string mDeviceID = Request.QueryString["id"];
            int iDeviceID = Convert.ToInt32(Request.QueryString["id"]);

            // 判断操作系统是否为Windows2000
            DeviceOREx _objDevEx = new DeviceDA().SelectDeviceORExByID(mDeviceID);
            if (_objDevEx.TypeName == "Windows2000")
            {
                BindGraidPort();
                BindGraidServiceDetail();
                BindGraidEvent();

                divNetworkPort.Visible = true;
                divServiceDetail.Visible = true;
                divEvent.Visible = true;
            }

            DeviceOR _objDev = new DeviceDA().SelectDeviceORByID(mDeviceID);
            PerfHostOR _ph = new PerfHostDA().SelectHostDetail(mDeviceID);

            state = _objDevEx.StatusVal;
            health = _objDevEx.HealthStatusVal;

            lblPerf.Text = _objDevEx.State;
            lblPerformance.Text = _objDevEx.State;
            lblDescribe.Text = _objDev.Describe;
            lblLastPollingTime.Text = _objDev.LastPollingTime.ToString();
            lblNextPollingTime.Text = _objDev.NextPollingTime.ToString();

            lblMonitorName.Text = _objDev.DeviceName;
            lblHostName.Text = _objDev.HostName;
            lblOperatingSystem.Text = _objDev.OperSystem;
            lblIP.Text = _objDev.IP;
            lblResponseTime.Text = _ph.ResponseTime;

            lblSwapMemoryUtilization.Text = _ph.SwapMemoryUtilization;
            lblSwapMemoryUtilizationMB.Text = _ph.SwapMemoryUtilizationMB;
            lblCPUMemoryUtilization.Text = _ph.CPUMemoryUtilization;
            lblPhysicalpMemoryUtilization.Text = _ph.PhysicalpMemoryUtilization;
            lblPhysicalpMemoryUtilizationMB.Text = _ph.PhysicalpMemoryUtilizationMB;
            lblFreePhysicalpMemory.Text = _ph.FreePhysicalpMemory;

            #region 绑定 可用性
            DataPoint dp = new DataPoint();
            dp.LegendText = string.Format("{0}({1}%)", "可用", _objDev.AvailableRate);
            double[] d = { Convert.ToDouble(_objDev.AvailableRate) };
            dp.Color = Color.Green;
            dp.YValues = d;
            chtPerf.Series["Series1"].Points.Add(dp);

            dp = new DataPoint();
            dp.LegendText = string.Format("{0}({1}%)", "不可用", 100 - _objDev.AvailableRate);
            double[] dno = { Convert.ToDouble(100 - _objDev.AvailableRate) };
            dp.Color = Color.Red;
            dp.YValues = dno;
            chtPerf.Series["Series1"].Points.Add(dp);
            #endregion

            #region 绑定,曲线
            HistoryValueDA mDA = new HistoryValueDA();

            DateTime StartTime = DateTime.Now.AddHours(-2);
            DateTime EndTime = DateTime.Now;

            DateTime SystemStartTime = DateTime.Now.AddHours(-1);

            // CPU及内存使用率 - 最近六小时内
            DataTable dte = mDA.GetDeviceChanncelValue(iDeviceID, 14202, StartTime, EndTime);//交换内存使用率
            if (dte != null)
            {
                chLine.Series["Series1"].Points.DataBindXY(dte.Rows, "Time", dte.Rows, "MonitorValue");
            }
            dte = mDA.GetDeviceChanncelValue(iDeviceID, 14203, StartTime, EndTime);//物理内存使用率
            if (dte != null)
            {
                chLine.Series["Series2"].Points.DataBindXY(dte.Rows, "Time", dte.Rows, "MonitorValue");
            }
            dte = mDA.GetDeviceChanncelValue(iDeviceID, 14102, StartTime, EndTime);//CPU使用率
            if (dte != null)
            {
                chLine.Series["Series3"].Points.DataBindXY(dte.Rows, "Time", dte.Rows, "MonitorValue");
            }

            // 系统负荷 - 近一小时
            DataTable dt = mDA.GetDeviceChanncelValue(iDeviceID, 13101, SystemStartTime, EndTime);//每分钟的Job数
            if (dt != null)
            {
                chSystemLoad.Series["Series1"].Points.DataBindXY(dt.Rows, "Time", dt.Rows, "MonitorValue");
            }
            dt = mDA.GetDeviceChanncelValue(iDeviceID, 13102, SystemStartTime, EndTime);//5分钟的Job数
            if (dt != null)
            {
                chSystemLoad.Series["Series2"].Points.DataBindXY(dt.Rows, "Time", dt.Rows, "MonitorValue");
            }
            dt = mDA.GetDeviceChanncelValue(iDeviceID, 13103, SystemStartTime, EndTime);//15分钟的Job数
            if (dt != null)
            {
                chSystemLoad.Series["Series3"].Points.DataBindXY(dt.Rows, "Time", dt.Rows, "MonitorValue");
            }

            #endregion
        }
Example #11
0
        // 系统负荷 - 最近一小时
        public DataTable selecSystemLoad(int DeviceID)
        {
            string strTableName = new HistoryValueDA().GetTableName(DeviceID);
            if (string.IsNullOrEmpty(strTableName))
            {
                return null;
            }

            string sql = string.Format(@"select top 1 OneJob.MonitorValue OneJob,FiveJob.MonitorValue FiveJob,FifteenJob.MonitorValue FifteenJob
            ,max1.max1job,max5.max5jon,max15.max15job from t_Device d
            left join t_TmpValue OneJob on OneJob.DeviceID= {0} and OneJob.ChannelNO=13101
            left join t_TmpValue FiveJob on FiveJob.DeviceID={0} and FiveJob.ChannelNO=13102
            left join t_TmpValue FifteenJob on FifteenJob.DeviceID= {0} and FifteenJob.ChannelNO=13103
            left join (
            select DeviceID,max(convert(float,MonitorValue)) max1job from {1}
            where ChannelNo=13101  and MonitorTime>'{2}' and MonitorTime<'{3}'
            group by DeviceID
            ) as max1 on max1.deviceid=d.DeviceID
            left join (
            select DeviceID,max(convert(float,MonitorValue)) max5jon from {1}
            where ChannelNo=13102   and MonitorTime>'{2}' and MonitorTime<'{3}'
            group by DeviceID
            ) as max5 on max5.deviceid=d.DeviceID
            left join (
            select DeviceID,max(convert(float,MonitorValue)) max15job from {1}
            where ChannelNo=13102  and MonitorTime>'{2}' and MonitorTime<'{3}'
            group by DeviceID
            ) as max15 on max15.deviceid=d.DeviceID
            where d.DeviceID={0}", DeviceID, strTableName
                     ,DateTime.Now.AddHours(-1).ToString("yyyy-MM-dd HH:mm:ss")
                     , DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            DataTable dt = null;
            try
            {
                dt = db.ExecuteQuery(sql);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return dt;
        }