- Scoreboards: These give a clear display of a metric value and can be configured to change colour from green to orange through to red on values you defines to provide a really quick way of highlighting an areas of concern, I.e you are outside an agreed SLA metric can show as Red
- Metric Charts: Which graph out the value of metric over a defined period, even highlighting the dynamic threshold that vR Ops has determined I.e will you quickly monitor performance over time.
Dashboards: Creating the Base XML File
To create the XML file you need to know the exact name of the metric, which can often be different from the display name. This blog will detail how to create the XML file and discover the metric name through the use of a couple of simple API calls in a browser.
The first step is to create XML File in vRealize Operations.
- Within the Web UI it is found under Content | Manage Metric Config
- Highlight the ReskandMetric folder
- Then click on the Green + symbol and it will prompt you to create a new configuration file. Name it appropriately, it is important to ensure it ends with the .xml suffix.
- Once the file is created, open the ReskandMetric folder and locate the XML file just created. Copy the XML file below into the right hand pane as an initial template. Once it has been completed ensure that you click on Save in the bottom right corner to save the changes made. It will be amended later, but below for now we have detailed the sections of the file with descriptions.
<?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?>
<AdapterKinds>
<AdapterKind adapterKindKey=”VMWARE”> (defined by the adapter the metric is collected from this is the standard vcenter one)
<ResourceKind resourceKindKey=”HostSystem”> (defined as the object type you want to get the metrics from)
<Metric attrkey=”@”( This is the metrics you want to report on ) label=”@” (label used to display free text), unit=”@” (The metric measurement report can be used to convert KB metric to display in GB), yellow.orange,red, values when in a scoreboard widget the object changes colour, value is dependent on metric collected and your own SLAs>
</ResourceKind>
</AdapterKind >
</AdapterKinds >
Find the AdapterKind and ResourceKind Values
To obtain the Adapterkind and ResourceKind values then a couple of simple API commands in your favorite browser will help you locate the values required.
- Open up a browser and use the the following URL
https://fqdnvrops/suite-api/api/adapterkinds
- It will prompt for a login account, use a local admin account. All the adapters will be listed, in this instance we are looking for vCenter
- Then under the adapter-kind value the ResourceKind values are listed for this object.
Find the Metric Attribute key Values
In this example we will look for the CPU Usage of a host system.
- First we need to find the display name. In vRealize Operations, browse through the Environment section to the relevant object in this case a host system.
- Under the Troubleshooting Tab | All Metrics, then find the relevant metric, in this case CPU Usage.
- Then back to the browser and we need to find the statkey value for CPU Usage. Use the following URL
https://vropsfqdn/suite-api/api/adapterkinds/VMWARE/resourcekinds/hostsystem/statkeys
- Which break downs as adapterkind VMWARE which we discovered in stage 1
- Then as we are looking for a metric value of a host system then the resourcekind is hostsystem
- Then do a search for the UI Metric Name in this case CPU|Usage
- You will see the <ops:key> value is the true metric key used in the XML file
- The <ops:unit> value shows the unit the metric is measured on
Update the XML File with the metric values
- In the vRealize Operations UI we will update the XML file with the discovered value. In the vRealize Operations UI, under Content | Manage Metric Config. Open the ReskandMetric folder, find the XML file created earlier and click on the Pencil Icon to edit the file and amend as below
<?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?>
<AdapterKinds>
<AdapterKind adapterKindKey=”VMWARE”>
<ResourceKind resourceKindKey=”HostSystem”>
<Metric attrkey=”cpu|usage_average” label=”Usage Avg” unit=”%” yellow=”50″ orange=”60″ red=”80″ />
</ResourceKind>
</AdapterKind>
</AdapterKinds>
- Once the editing has been completed, save the file
Create a Dashboard using the XML File
The final step is to use the created XML file in a new dashboard
To create and edit the new dashboard
- Under Content in the vRealize Operations choose Dashboards
- Select the Green plus to create a new dashboard.
- Give the dashboard a useful name
- Under Widget List select the Object List, by dragging it into the right hand window. Then click on the small pencil icon to filter the object
- Filter by host object (under Object Type). It is worth editing the Title, setting Refresh Content to On, and Mode is Self, save the changes to the Object List.
- Then add the Metric Chart to the dashboard, and edit the chart via the pencil icon
- Edit the name and define the metric file in the Metric Configuration option
- Add a Scoreboard Widget to the dashboard and edit via the pencil icon
- Select the XML file as the Metric Configuration value, it can be formated as required with the options to the right, I normally show the sparkline and use the new Visual Theme, and set the round decimals to 0.
- Select the Widget interaction, so the Metric Chart and Scoreboard widgets are updated with values from the Object list and the CPU Usage is updated on the metric chart & scoreboard when one host is selected from the Object list. (In the example below you see the Scoreboard Widget scorecard for CPU Usage has taken the label “Usage Avg” and the color from the XML file).
Finally you have a dashboard that can be used to display the exact metrics you want in a number of different formats by adding a number of metric values to your XML file. The XML can also contain multiple Adapterkind and ResourceKinds to show a wider range of data.
A couple of takeaways
- If your file contains multiple Adapterkind and ResourceKind values and you have the source data filtered it will only show the relevant metrics for the filtered object.
- Finally, if the metric is measured in kilobytes by altering the metric value in the XML file to gigabytes then dashboard metrics will be displayed in gigabytes.