지금 지원 담당자와 채팅
지원 담당자와 채팅

Foglight 5.9.8 - Web Component Tutorial

Using the Web Component Tutorial Tutorial 1: Drag and Drop Tutorial 2: Creating a Dashboard Tutorial 3: Adding a Drilldown Page Tutorial 4: Adding Views Tutorial 5: Using a Grid Tutorial 6: Reports Tutorial 7: Creating a Form Tutorial 8: Renderers Tutorial 9: Adding Questions and Answers Tutorial 10: Sending Messages to Other Users

Creating Categories

In this , you create a two Category Associations, CPU and Memory. Like the Domain Association you just created, these categories also require display names and canonical names.

a
In the Module Contents pane, ensure that Associations is selected in the top-left, and click .
b
In the Add Association dialog box that appears, select Category, and click OK.
A New Association tab appears in the Definition/Edit pane with the General tab open.
a
Open the Configuration tab.
b
In the row containing the Display Name property, in the Value column, click Edit , and select Set to String from the list that appears.
c
In the Edit - Display Name dialog box that appears, in the String Value box, type CPU.
d
Click Set.
a
On the Configuration tab, in the row containing the Canonical Name property, in the Value column, click Edit , and select Set to String from the list that appears.
b
In the Edit - Display Name dialog box that appears, in the String Value box, type myHostDomain.
c
Click Set.
4
On the New Association tab, in the top-left corner, click Save.
6
Follow Step 1 through Step 4 to create the Memory Association with the following property values:
Name: Memory
Display Name: Memory
Canonical Name: hostMemory

Creating Questions

In this , you create a two Question Associations, CPU Utilization and Memory Utilization. Questions are slightly different in terms of configuration. First, you associate each question with the Host domain and the appropriate category (CPU Utilization with CPU, and Memory Utilization with Memory). Next, point each question to the view that provides the answer. Finally, configure the context input. Because each of these views take a Host object as input, the question associations need to have a Host object as input to pass that information to the views.

a
In the Module Contents pane, ensure that Associations is selected in the top-left, and click .
b
In the Add Association dialog box that appears, select Question and click OK.
A New Association tab appears in the Definition/Edit pane with the General tab open.
c
Specify the name for this association. In the Name box, type CPU Utilization.
2
Add a Host context input key to the Question Association.
In this Question Association we will use the CPU Utilization view as the answer. Because this view displays the total percentage of time a host’s CPU executes system code and user programs, it takes a Host object as input. For that reason, we need to pass a Host object to this association as a context input key.
a
Open the Context tab.
c
In the newly added row, in the Key column, type Host.
d
Click the Data Type column and click the selector button () that appears.
e
In the Select Type dialog box that appears, select the Host row and click Save.
The Select Type dialog box closes and the Data Type column refreshes, showing Monitoring:Host in the newly added row.
a
Open the Configuration tab.
b
In the row containing the Question property, in the Value column, click Edit , and select Set to String from the list that appears.
c
In the Edit - Question dialog box that appears, in the String value box, type What is the CPU utilization on this host?
d
Click Set.
a
On the Configuration tab, in the row containing the Domain Canonical Name property, in the Value column, click Edit .
b
In the Edit - Domain Canonical Name dialog box that appears, navigate to the module containing the Domain Association definition, and select its Host node.
c
Click Set.
a
In the row containing the Answer View property, in the Value column, click Edit .
b
In the Edit - Answer View dialog box that appears, in the Name column, navigate to the CPU Utilization view by choosing Hosts > Host > [chart] CPU Utilization.
c
Click Set.
a
Expand the Categories property node and click to add a new category.
b
In the row containing the Association Reference property that appears, in the Value column, click Edit ,.
c
In the Edit - Category dialog box that appears, in the Name column, navigate to the module containing CPU Category Association, and select it.
d
Click Set.
7
On the New Association tab, in the top-left corner, click Save.
9
Follow Step 1 through Step 7 to create the Question Association with the following property values:
Name: Memory Utilization
Question: What are the memory utilization and available paging space on this host?
Domain Canonical Name: myHostDomain
Answer View: Hosts/Host/[chart] Host Memory Utilization
Categories: Memory

Populating the Question Viewer with Questions and Answers

Now that you have the associations required to populate the Question Viewer, you can start building the Question Viewer component that we will name Host Question Viewer. First, ensure that the viewer is a Page or Pagelet. In a typical scenario, a Question Viewer appears on a dashboard and displays questions and answers about the objects that appear on that dashboard. For that reason, there is no need to make the Question Viewer a dashboard.

Next, ensure that the Host Question Viewer has context input that satisfies the views that contain the answers. In this example, we use the Host Memory Utilization and CPU Utilization views, that both take a Host object as input. For that reason, the Host Question Viewer needs to have a Host object as a context input as well.

Finally, configure the viewer to point to the Host domain. This causes the Question Viewer to retrieve the questions associated with the domain.

In a typical environment, the Question Viewer uses a service to retrieve the related domain associations. The service is the viewer’s context input key to the Question Viewer which populates the list of domains using real data. While placing the Question Viewer on a dashboard and creating a service to populate the list of domains is possible, it requires using the Service Builder and creating a service category which is beyond the scope of this tutorial. For that reason, the final product of this tutorial is not a dashboard (without input), but a simple Page/Pagelet containing this Question Viewer which points to the domain simply by using its canonical name, myHostDomain, we specified earlier in this tutorial.

The Question Viewer you build in this contains three columns: Categories, Questions, and Question. You can customize the collection of questions by adding more questions or marking questions as favorites for future reference. You can also search the entire collection of questions for a specific question using a search box.

Categories: This column displays three default categories, and the categories you specified as the Category Associations. The default categories are All Questions, Favorites, and My Questions. The categories you specified in this tutorial, CPU and Memory, appear just below the default categories.
The All Questions category is selected by default and contains all of the questions defined in the Question Viewer, including the questions you define in the viewer component along with any questions you add at run-time using the Add button in the Questions column.
The Favorites category contains the questions you mark using the Favorites button in the Questions column.
My Questions column contains the questions you add at run-time using the Add button in the Questions column.
Note
When My Definitions is not the working module, and you add a question to My Questions, the question does not appear in this category. It can be found in All Questions.
Questions: This column contains the questions that belong to the category selected in the Categories column.
Answer: This column contains the view that represents the answer to the question selected in the Questions column. This is also known as the answer area. The answer to a question is a portlet view.
a
In the Module Contents pane, ensure that Views is selected in the top-left, and click .
b
In the Add View dialog box that appears, on the Create a Blank View tab, in the navigation tree, choose Others > Questions Viewer, and click OK.
A New View tab appears in the Definition/Edit pane with the General tab open.
c
Specify the name for this association. In the Name box, type Host Question Viewer.
2
Add a Host context input key to the Question Viewer.
The Question Viewer references questions that have the CPU Utilization and Host Memory Utilization views as answers. These views display host metrics and for that reason need a Host object as input. Therefore, the viewer needs to include the same input to satisfy the referenced views.
a
Open the Context tab.
c
In the newly added row, in the Key column, type Host.
d
Click the Data Type column and click the selector button () that appears.
e
In the Select Type dialog box that appears, select the Host row and click Save.
The Select Type dialog box closes and the Data Type column refreshes, showing Monitoring:Host in the newly added row.
The Question Viewer needs to point to the Host domain to populate it with the questions that are associated with the domain. For that purpose, we use a WCF function, List of Domain References from Canonical IDs, that retrieves a list of domain references using their canonical names. Earlier in this tutorial, we specified the canonical name of the Host domain.
a
Open the Configuration tab.
b
In the row containing the Domains property, in the Value column, Edit .
d
In the Edit - Domains dialog box that appears, in the Function box, click .
e
In the Available Functions dialog box that appears, in the Name column, in the navigation tree, choose Dashboard Development > Support > Common > List of Domain References from Canonical IDs, and click Save.
The Available Functions dialog box closes, and the Edit - Domains dialog box refreshes, showing the List of Domain References from Canonical IDs in the Function box.
f
Specify the IDs parameter.
For complete information about services in Foglight, see the Foglight User Guide.
In the row containing the Parameter {ids} entry, in the Value column, click Edit .
g
In the list that appears, select Set to Binding > List.
h
In the Edit - Parameter dialog box that appears, leave all the three check boxes cleared, and click Set.
i
In the Edit - Domains dialog box, Click under the parameters row.
j
In the Parameter row, click .
4
On the New View tab, in the top-left corner, click Save.
a
In the Definition Editor, navigate to the Host Question Viewer definitions, and click Test.
Specify the host that you want to scope on with the Question Viewer. In the Input Values dialog box that appears, in the Host box, click Edit , and select a host object from the list that appears.
b
Click Results.
Figure 2. All Questions
c
In the Question Viewer, in the Categories column, click CPU.
The Questions column refreshes, showing only the question that belongs to this category, What is the CPU Utilization on this host? The question appears selected in the Questions column, and the CPU Utilization view appears on the right, showing the CPU utilization for the selected host.
d
In the Question Viewer, in the Categories column, click Memory.
The Questions column refreshes, showing only the question that belongs to this category, What are the memory utilization and available paging space on this host? The question appears selected in the Questions column, and the Host Memory Utilization appears on the right, showing the memory utilization and available paging space for the selected host.

Building a Mini-Viewer

Question Mini-Viewers are very similar to the Question Viewers in that they also display information about a selected object using Question and Category Associations. This is a smaller view component that can appear on a dashboard to display information about a selected object.

Unlike the Question Viewer that references a domain, the initial view of the Question Mini-Viewers uses a Category Association as a filter, and can only display the questions associated with that category. In this example, we use the existing associations: the CPU category and its CPU Utilization question to display in the mini-viewer. It also allows you to see all of the questions associated with the domain in a secondary view.

Like in the previous example, we first need to ensure that the viewer is a Page or Pagelet, and that it takes a Host object as input (required by the CPU Utilization view). Next, configure the mini-viewer to point to the Host domain using its canonical name, myHostDomain.

The mini-viewer you build in this contains the CPU Utilization question. You select the question by navigating the list using the left and right facing arrows in the bottom-left. In this example, the category associated with the mini-viewer contains only one question. As an exercise, consider adding more questions to the CPU category to see how the navigation works.

a
In the Module Contents pane, ensure that Views is selected in the top-left, and click .
b
In the Add View dialog box that appears, on the Create a Blank View tab, in the navigation tree, choose Others > Questions Mini-Viewer, and click OK.
A New View tab appears in the Definition/Edit pane with the General tab open.
c
Specify the name for this association. In the Name box, type Host Mini Question Viewer.
2
Add a Host context input key to the Question Mini-Viewer.
Again, we are providing a Host object as input to satisfy the CPU Utilization view.
a
Open the Context tab.
c
In the newly added row, in the Key column, type Host.
d
Click the Data Type column and click the selector button () that appears.
e
In the Select Type dialog box that appears, select the Host row and click Save.
The Select Type dialog box closes and the Data Type column refreshes, showing Monitoring:Host in the newly added row.
3
Associate the mini-viewer with the CPU category. In this example, we want to add this question to the CPU group of questions.
a
Open the Configuration tab.
b
In the row containing the Category property, in the Value column, click Edit ,.
c
In the Edit - Category dialog box that appears, in the Name column, navigate to the module containing CPU Category Association, and select it.
d
Click Set.
Like in the previous procedure, we need to point to the Host domain using the function List of Domain References from Canonical IDs and providing Host domain’s canonical name, myHostDomain, as the function parameter in a single-entry list.
a
On the Configuration tab, in the row containing the Domains property, in the Value column, Edit .
c
In the Edit - Domains dialog box that appears, in the Function box, click Edit .
d
In the Available Functions dialog box that appears, in the Name column, in the navigation tree, choose Dashboard Development > Support > Common > List of Domain References from Canonical IDs, and click Save.
The Available Functions dialog box closes, and the Edit - Domains dialog box refreshes, showing the List of Domain References from Canonical IDs in the Function box.
e
In the row containing the Parameter {ids} entry, in the Value column, click Edit .
g
In the Edit - Parameter dialog box that appears, in the Localized String box, type myHostDomain. This is the canonical name of the Host domain we specified earlier in this tutorial.
h
Click Set to close the Edit - Parameter dialog box.
i
In the Edit - Domains dialog box, click Set to close it.
5
On the New View tab, in the top-left corner, click Save.
j
On the Host Mini tab containing the mini-viewer definition, click Test.
Specify the host that you want to scope on with the Question Viewer. In the Input Values dialog box that appears, in the Host box, click Edit and select a host object from the list that appears.
k
Click Results.
관련 문서

The document was helpful.

평가 결과 선택

I easily found the information I needed.

평가 결과 선택