# Plain Agent Use Case Example

# Monitor WLOC Services and Resources

Now that the service is deployed, we can use the WLOC Administration Console to monitor how well the service is meeting its service level agreement, and to see which resource pools are hosting services.

To gather monitoring data, the WLOC Controller either actively polls the monitored object or passively listens for changes to a monitored object, depending on the type of data that it is gathering.

The Monitoring tab of the WLOC Administration Console contains a dashboard that enables you to construct graphs to chart metrics of services. Specifically, you can:

- Create views to organize charts according to your needs. For example, you can define one view that contains a set of charts to monitor your environment at a high-level. You can then define additional views to access more specific details, such as CPU usage on a specific set of JVMs.
- Develop custom metrics that are defined as functions of monitorable resource attributes.
- Set preferences to customize charts and graphs as desired.

The tasks described in this topic include:

- Create a View
- Browse the Resources Pane

## Create a View

To create a view:

1. Click the Monitoring tab in the WLOC navigation bar.

The Views tab is selected by default. Because we have not created any views yet, only the Default view is listed.

2. In the text box, enter the name of the view that you want to create and click Add.

In this example, we will create a view named HeapFree which will show the current free heap metrics for the MS_1 JVM. The view name is added to the list.

3. Click the HeapFree view name to make it the active view.

4. Add monitoring charts to a view by selecting resources to monitor using standard metrics available from the Resources pane and dragging it to the Charts and Views pane. For instructions on browsing the Resources pane and adding charts to a view, see Browse the Resources Pane.

## Browse the Resources Pane

When you select the Resources tab, it displays a list of the resources that you can monitor. Using this pane, you can monitor the CPU and memory usage for the services, resource pools, and JVMs. You can also monitor the metrics for the installed Smart Packs, as well as values of one or more MBean attributes, over time, for each of the MBean Servers.

You can expand and collapse the list of monitorable resources using the + and - next to each type in the Resources pane.

To browse the Resources pane and add a chart to the HeapFree view:

1. Select the Resources tab.
2. Expand the list of resources in the Resources pane to view the monitorable types for each resource.

3. Scroll down to view the available MBean Servers.and expand MBean Server MS_1.

A list of the available MBeans types for MS_1 is displayed.

4. Expand the JRockitRuntimeMBean type in the list.
5. Expand the MS_1 MBean instance.

A list of the monitorable MBean attributes for MS_1 is displayed.

6. Scroll down the list of MBean attributes and select the HeapFreeCurrent attribute. Drag the attribute to the Charts and Views pane to add it to the current view.The metric chart illustrating the current free heap utilization, over time, is added to the HeapFree view.

The HeapFree view is saved automatically.