System Tracker - OMIS 675
Lab Objective: Now that you’ve built a CMDB database, and an interface to enter your data, you need to build an interface to monitor, and update, system states. Your interface will eventually act as an expert system informing the helpdesk analyst what steps to perform based on changes in the system state.
25 pts. Due 4/2
Requirements
1. Servers need to have the option of being grouped and displayed by their role. For example, show me all the servers that are used for running EMAIL. See Figure 1.
Figure 1: Example of displaying servers by Role
2. Must display at least display the following information on that server. See Figure 1
a. ID, Name
b. What application it’s running
c. What it’s role (e.g. DB, Test, Dev, App) for that application is.
d. Support Team, contact information of Primary contact (EMPLID1)
e. Status
f. Impact, and Acceptable Down Hours
3. Provide the ability to update the server status. See Figure 2.
Figure 2: Formview to change server status, and provide a timestamp
4. Provide a timestamp when the server status is changed. See Figure 2.
5. Change the coloring of the server record based on the status (Red for Down, Yellow for Warning, Green for Up). See Figure 1.
21. Select your Gridview, Change your properties viewer to display Events by clicking on the lightning bolt
22. Double-click in the RowDataBound field. This will take you to the Code-Behind to create a sub to apply logic to trigger your GridView binds to its data source. Paste the following code in the sub.
If e.Row.RowType = DataControlRowType.DataRow Then
Dim ss = e.Row.DataItem
If Trim(ss("STATUS")) = "DOWN" Then
e.Row.BackColor = Drawing.Color.OrangeRed
e.Row.ForeColor = Drawing.Color.Black
ElseIf Trim(ss("STATUS")) = "WARNING" Then
e.Row.BackColor = Drawing.Color.Yellow
e.Row.ForeColor = Drawing.Color.Black
Else
e.Row.BackColor = Drawing.Color.LightGreen
e.Row.ForeColor = Drawing.Color.Black
End If
End If
23. The highlighted text STATUS represents the name of the column that holds the server status.
24. While you’re in the code-behind file go to the very top of the page and add the following line
Imports System.Data.SqlClient
25. Save, and test on the web. Assuming all of your servers were UP when you created them, you might have to change the status on a couple of your servers from your CMDB interface to see if the highlighting is working.
Dim conn As SqlConnection
Dim cmd1 As SqlCommand
Dim ddl2 As DropDownList = Me.FormView1.FindControl("ddlStatus")
Dim cmdString1 As String = "Update Servers SET Status_Change = '" & Date.Now & "', STATUS = '" & ddl2.SelectedItem.Value & "' WHERE Servers.ID = " & FormView1.SelectedValue & ""
conn = New SqlConnection("Data Source=yourserverName\INSTANCENAME;Initial Catalog=yourdatabaseName; User ID=sa; Password=yourSApassword")
‘'the previous command is should be on one line. Replace the info in green with your database information.
cmd1 = New SqlCommand(cmdString1, conn)
conn.Open()
cmd1.ExecuteNonQuery()
conn.Close()