コード例 #1
0
        public ServerAttributes CollectDataforServerAttributes(DataRow ServersRow)
        {
            ServerAttributes Mobj = new ServerAttributes();

            try
            {
                int ReturnValue = VSWebBL.SecurityBL.ServersBL.Ins.GetServerIDbyServerName(ServersRow["ServerName"].ToString());
                //DEFAULTS TO BE GIVEN

                //Mobj.Enabled = EnabledCheckBox.Checked;
                //Mobj.CPUThreshold = (CPUThresholdTextBox.Text == "" ? 0 : Convert.ToInt32(CPUThresholdTextBox.Text));
                //Mobj.MemThreshold = (MemThresholdTextBox.Text == "" ? 0 : Convert.ToInt32(MemThresholdTextBox.Text));
                //Mobj.Category = CategoryTextBox.Text;
                //Mobj.OffHourInterval = (OffscanTextBox.Text == "" ? 0 : Convert.ToInt32(OffscanTextBox.Text));
                //Mobj.ScanInterval = (ScanIntvlTextBox.Text == "" ? 0 : Convert.ToInt32(ScanIntvlTextBox.Text));
                //Mobj.ResponseTime = (ResponseTextBox.Text == "" ? 0 : Convert.ToInt32(ResponseTextBox.Text));
                //Mobj.RetryInterval = (RetryTextBox.Text == "" ? 0 : Convert.ToInt32(RetryTextBox.Text));
                //Mobj.ConsFailuresBefAlert = (ConsFailuresBefAlertTextBox.Text == "" ? 0 : Convert.ToInt32(ConsFailuresBefAlertTextBox.Text));
                //Mobj.ConsOvrThresholdBefAlert = (ConsOvrThresholdBefAlertTextBox.Text == "" ? 0 : Convert.ToInt32(ConsOvrThresholdBefAlertTextBox.Text));
                Mobj.ServerId = ReturnValue;
            }
            catch (Exception ex)
            {
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                throw ex;
            }

            return(Mobj);
        }
コード例 #2
0
        /// <summary>
        /// Funkcja wywoływana przy generowaniu strony
        /// </summary>
        public void OnGet()
        {
            try
            {
                AsixRestClient asixRestClient = new AsixRestClient();

                // Odczyt z serwera REST nazw wszystkich atrybutów
                ServerAttributes serverAttributes = asixRestClient.ReadAttributeNames();
                if (!serverAttributes.readSucceeded)
                {
                    mReadError = serverAttributes.readStatusString;
                    return;
                }

                mAttributeNames = serverAttributes.mAttributeNameList;



                // Odczyt z serwera REST wartości atrybutów atrybutów zmiennej
                VariableAttributes variableAttributes = asixRestClient.ReadVariableAttributes(mVariableName, mAttributeNames);
                if (!variableAttributes.readSucceeded)
                {
                    mReadError = variableAttributes.readStatusString;
                    return;
                }

                mVariableAttributes = variableAttributes.mAttributeValueList;
            }
            catch (Exception e)
            {
                mReadError = e.Message;
            }
        }
コード例 #3
0
        public ServerAttributes CollectDataforMSServers()
        {
            ServerAttributes Mobj = new ServerAttributes();

            try
            {
                Mobj.Enabled = EnabledCheckBox.Checked;

                Mobj.CPUThreshold         = int.Parse(AdvCPUThTrackBar.Value.ToString());
                Mobj.MemThreshold         = int.Parse(AdvMemoryThTrackBar.Value.ToString());
                Mobj.Category             = CategoryTextBox.Text;
                Mobj.OffHourInterval      = (OffscanTextBox.Text == "" ? 0 : Convert.ToInt32(OffscanTextBox.Text));
                Mobj.ScanInterval         = (ScanIntvlTextBox.Text == "" ? 0 : Convert.ToInt32(ScanIntvlTextBox.Text));
                Mobj.ResponseTime         = (ResponseTextBox.Text == "" ? 0 : Convert.ToInt32(ResponseTextBox.Text));
                Mobj.RetryInterval        = (RetryTextBox.Text == "" ? 0 : Convert.ToInt32(RetryTextBox.Text));
                Mobj.ConsFailuresBefAlert = (ConsFailuresBefAlertTextBox.Text == "" ? 0 : Convert.ToInt32(ConsFailuresBefAlertTextBox.Text));

                Mobj.ServerId      = Convert.ToInt32(lblServerId.Text);
                Mobj.CredentialsId = (CredentialsComboBox.Text == "" ? 0 : Convert.ToInt32(CredentialsComboBox.Value));
            }
            catch (Exception ex)
            {
                //6/27/2014 NS added for VSPLUS-634
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                throw ex;
            }

            return(Mobj);
        }
コード例 #4
0
ファイル: ServersBL.cs プロジェクト: ImranVS/SVNGIT
        //public Object UpdateAttributesData(ServerAttributes ServerObject)
        //{
        //    return VSWebDAL.SecurityDAL.ServersDAL.Ins.UpdateAttributesData(ServerObject);

        //}

        public Object InsertWebspherAttreibuteData(ServerAttributes ServerObject)
        {
            try
            {
                return(VSWebDAL.SecurityDAL.ServersDAL.Ins.InsertWebspherAttreibuteData(ServerObject));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #5
0
ファイル: ServersBL.cs プロジェクト: ImranVS/SVNGIT
 /// <summary>
 ///  Call to Update Server Data
 /// </summary>
 /// <param name="ServerObject"></param>
 /// <returns></returns>
 public Object UpdateAttributesData(ServerAttributes ServerObject)
 {
     try
     {
         return(VSWebDAL.SecurityDAL.ServersDAL.Ins.UpdateAttributesData(ServerObject));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #6
0
        public ServerAttributes CollectDataforServerAttributes(string servername)
        {
            ServerAttributes Mobj = new ServerAttributes();

            try
            {
                int ReturnValue = VSWebBL.SecurityBL.ServersBL.Ins.GetServerIDbyServerName(servername);

                Mobj.ServerId = ReturnValue;
            }
            catch (Exception ex)
            {
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                throw ex;
            }

            return(Mobj);
        }
コード例 #7
0
        public WebSpherePropertie GetData(WebSpherePropertie DSObject)
        {
            DataTable          DominoServersDataTable = new DataTable();
            WebSpherePropertie ReturnDSObject         = new WebSpherePropertie();
            ServerAttributes   sr = new ServerAttributes();

            try
            {
                //string SqlQuery = "select *,ISNULL(RequireSSL,0) RS,ServerName as Name,IPAddress,LocationID,Description,servers.ID,Location from Servers left join dominoservers on Servers.ID=DominoServers.ServerID inner join Locations on servers.LocationID=Locations.ID where servers.ID=" + DSObject.Key + "";
                //8/7/2014 NS modified for VSPLUS-853
                string SqlQuery = "select Sr.ID,Sr.ServerName,sr.Description,S.ServerType,L.Location,Sr.LocationID,ws.ActiveThreadCount,ws.AvgThreadPool,ws.CurrentHeap,ws.DumpGenerated,ws.HungThreadCount,ws.MaxHeap,ws.Uptime,sa.ScanInterval,sa.Enabled,sa.ResponseTime,sa.RetryInterval,sa.ConsFailuresBefAlert,sa.OffHourInterval,sa.OffHourInterval,sa.CPU_Threshold,sa.MemThreshold,sr.ipaddress,sa.category,wc.CellName, wn.NodeName,ws.CellID,ws.NodeID from Servers Sr inner join ServerTypes S on Sr.ServerTypeID=S.ID inner Join WebsphereServer ws on ws.ServerName=Sr.ServerName Inner join WebsphereCell wc on wc.CellID=ws.CellID inner join WebsphereNode wn on wn.NodeID=ws.NodeID inner join Locations L on Sr.LocationID =L.ID left outer join ServerAttributes sa on sr.ID=sa.serverid  where  sr.ID='" + DSObject.ServerID + "'";
                DominoServersDataTable = objAdaptor.FetchData(SqlQuery);
                if (DominoServersDataTable.Rows.Count > 0)
                {
                    bool value;
                    //Commented by Mukund 06Jun14:Error this parameter is not taken now. Disk space is separately dealt
                    //ReturnDSObject.DiskSpaceThreshold = float.Parse(DominoServersDataTable.Rows[0]["DiskSpaceThreshold"].ToString());

                    ReturnDSObject.Category = DominoServersDataTable.Rows[0]["category"].ToString();

                    // ReturnDSObject. = DominoServersDataTable.Rows[0]["Description"].ToString();
                    //sr.Enabled = bool.Parse(DominoServersDataTable.Rows[0]["Enabled"].ToString());



                    ReturnDSObject.FailureThreshold = int.Parse(DominoServersDataTable.Rows[0]["ConsFailuresBefAlert"].ToString());

                    ReturnDSObject.ServerName           = DominoServersDataTable.Rows[0]["ServerName"].ToString();
                    ReturnDSObject.OffHoursScanInterval = int.Parse(DominoServersDataTable.Rows[0]["OffHourInterval"].ToString());

                    ReturnDSObject.ResponseThreshold = int.Parse(DominoServersDataTable.Rows[0]["ResponseTime"].ToString());
                    ReturnDSObject.RetryInterval     = int.Parse(DominoServersDataTable.Rows[0]["RetryInterval"].ToString());
                    ReturnDSObject.ScanInterval      = int.Parse(DominoServersDataTable.Rows[0]["ScanInterval"].ToString());

                    //ReturnDSObject.IPAddress = DominoServersDataTable.Rows[0]["IPAddress"].ToString();
                    //Sowjanya modified for VSPLUS-2647 ticket
                    ReturnDSObject.Memory_Threshold = int.Parse(string.IsNullOrEmpty(DominoServersDataTable.Rows[0]["MemThreshold"].ToString()) ? "0":DominoServersDataTable.Rows[0]["MemThreshold"].ToString());
                    ReturnDSObject.CPU_Threshold    = int.Parse(string.IsNullOrEmpty(DominoServersDataTable.Rows[0]["CPU_Threshold"].ToString()) ? "0" : DominoServersDataTable.Rows[0]["CPU_Threshold"].ToString());

                    ReturnDSObject.ServerID = int.Parse(DominoServersDataTable.Rows[0]["ID"].ToString());
                    ReturnDSObject.ServerID = Convert.ToInt16(DominoServersDataTable.Rows[0]["ID"].ToString());



                    ReturnDSObject.AvgThreadPool     = int.Parse(string.IsNullOrEmpty(DominoServersDataTable.Rows[0]["AvgThreadPool"].ToString()) ? "0" : DominoServersDataTable.Rows[0]["AvgThreadPool"].ToString());
                    ReturnDSObject.ActiveThreadCount = int.Parse(string.IsNullOrEmpty(DominoServersDataTable.Rows[0]["ActiveThreadCount"].ToString())?"0":DominoServersDataTable.Rows[0]["ActiveThreadCount"].ToString());
                    ReturnDSObject.CurrentHeap       = DominoServersDataTable.Rows[0]["CurrentHeap"].ToString();
                    ReturnDSObject.MaxHeap           = DominoServersDataTable.Rows[0]["MaxHeap"].ToString();
                    ReturnDSObject.Uptime            = int.Parse(string.IsNullOrEmpty(DominoServersDataTable.Rows[0]["Uptime"].ToString()) ? "0" : DominoServersDataTable.Rows[0]["Uptime"].ToString());
                    ReturnDSObject.HungThreadCount   = int.Parse(string.IsNullOrEmpty(DominoServersDataTable.Rows[0]["HungThreadCount"].ToString()) ? "0" : DominoServersDataTable.Rows[0]["HungThreadCount"].ToString());
                    ReturnDSObject.DumpGenerated     = DominoServersDataTable.Rows[0]["DumpGenerated"].ToString();

                    //ReturnDSObject.Modified_By = Convert.ToInt16(DominoServersDataTable.Rows[0]["Modified_By"].ToString());
                    //ReturnDSObject.Modified_On = DominoServersDataTable.Rows[0]["Modified_On"].ToString();
                    //8/7/2014 NS added for VSPLUS-853
                    // ReturnDSObject.CredentialsID = int.Parse(DominoServersDataTable.Rows[0]["CredentialsID"].ToString());
                }
                //else
                //{
                //    ReturnDSObject.Location = DominoServersDataTable.Rows[0]["Location"].ToString();
                //    ReturnDSObject.Name = DominoServersDataTable.Rows[0]["Name"].ToString();
                //    ReturnDSObject.IPAddress = DominoServersDataTable.Rows[0]["IPAddress"].ToString();
                //    ReturnDSObject.Description = DominoServersDataTable.Rows[0]["Description"].ToString();
                //    ReturnDSObject.ServerID = Convert.ToInt16(DominoServersDataTable.Rows[0]["ID"].ToString());
                //    ReturnDSObject.LocationID = int.Parse(DominoServersDataTable.Rows[0]["LocationID"].ToString());
                //}
            }


            //populate & return data object


            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
            }
            return(ReturnDSObject);
        }