Пример #1
0
 private void BindGraidEvent()
 {
     int PageCount = 0;
     DataTable dt = new PerfHostDA().selecEvent(pgEvent.PageIndex, pgEvent.PageSize, out PageCount, Request.QueryString["id"]);
     gvEvent.DataSource = dt;
     gvEvent.DataBind();
     this.pgEvent.RecordCount = PageCount;
 }
Пример #2
0
 private void BindGraidDiskStatistics()
 {
     int PageCount = 0;
     DataTable dt = new PerfHostDA().selecDiskStatistics(pgDiskStatistics.PageIndex, pgDiskStatistics.PageSize, out PageCount, Request.QueryString["id"]);
     gvDiskStatistics.DataSource = dt;
     gvDiskStatistics.DataBind();
     this.pgDiskStatistics.RecordCount = PageCount;
 }
Пример #3
0
 private void BindGraidDetail()
 {
     int PageCount = 0;
     DataTable dt = new PerfHostDA().selecProcessDetail(pgProcessDetail.PageIndex, pgProcessDetail.PageSize, out PageCount, Request.QueryString["id"]);
     gvProcessDetail.DataSource = dt;
     gvProcessDetail.DataBind();
     this.pgProcessDetail.RecordCount = PageCount;
 }
Пример #4
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
        }
Пример #5
0
 //private void PageChanged(object sender, EventArgs e)
 //{
 //    BindGraidSystem();
 //}
 private void BindGraidSystem()
 {
     DataTable dt = new PerfHostDA().selecSystemLoad(Convert.ToInt32(Request.QueryString["id"]));
     gvSystemLoad.DataSource = dt;
     gvSystemLoad.DataBind();
     //this.pg.RecordCount = PageCount;
 }