Metric Configuration Files (XML)

A lot of the widgets are edited through the GUI with the objects and metrics we want displayed, but some require a metric configuration file to define what metrics the widget should display.

Metric configuration files can create a custom set of metrics for the customization of supported widgets with meaningful data.

Metric configuration files store the metric attribute keys in XML format.

These widgets support customization using metric configuration files:

  • Scoreboard
  • Metric Chart
  • Property List
  • Rolling View Chart
  • Sparkline Chart
  • Topology Graph

To keep this simple, we will configure four metrics to be displayed, which are:

  • CPU usage for the cluster in %
  • CPU demand for the cluster
  • Memory ballooning
  • CPU usage for the cluster in MHz

Perform the following steps to create a metric configuration file:

  1. Open a text editor, add the following code, and save it as an XML file; in this case we will call it clusterexample.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 

<AdapterKinds> 
   <AdapterKind adapterKindKey="VMWARE"> 
      <ResourceKind resourceKindKey="ClusterComputeResource"> 
        <Metric attrkey="cpu|capacity_usagepct_average" label="CPU" unit="%" yellow="50" orange="75" red="90" /> 
   <Metric attrkey="cpu|demandPct" label="CPU Demand" unit="%" yellow="50" orange="75" red="90" /> 
   <Metric attrkey="cpu|usagemhz_average" label="CPU Usage" unit="GHz" yellow="8" orange="16" red="20" /> 
   <Metric attrkey="mem|vmmemctl_average" label="Balloon Mem" unit="GB" yellow="100" orange="150" red="200" /> 
      </ResourceKind> 
   </AdapterKind> 
</AdapterKinds>
  1. Using WinSCP or another similar product, upload this file to the following location on the vRealize Operations 6.0 virtual appliance:
/usr/lib/vmware-vcops/tomcat-web-app/webapps/vcops-web-ent/WEB-INF/classes/resources/reskndmetrics 

In this location, you will notice some built in sample XML files.

  1. Alternatively, you can create the XML file from the vRealize Operations user interface. To do so, navigate to Administration | Configuration, and then Metric Configuration.
  2. Now let's go back to our dashboard creation and edit the Scoreboard widget. Under Metric Configuration choose the clusterexmaple.xml file that we just created from the drop-down list. Click Save to save the configuration.
  3. We have now completed the new dashboard; click Save on the bottom right to save the dashboard. We can go back and edit this dashboard whenever we need to. This new dashboard will now be available on the home page, this is shown in the following screenshot:

For the Scoreboard widget we have used an XML file so the widget will display the metrics we would like to see when an object is selected in another widget. How can we get the correct metric and adapter names to be used in this file?

Glad you asked. The simplest way to get the correct information we need for that XML file is to create a non-interactive dashboard with the widget we require with all the information we want to display for our interactive one.

For example, let's quickly create a temp dashboard with only one scoreboard widget and populate it with what we want by manually selecting the objects and metrics with self-provider set to yes:

  1. Create another dashboard and drag and drop a single scoreboard widget. Edit the scoreboard widget and configure it with all the information we would like. Search for an object in the middle pane and select the widgets we want in the right pane.
  2. Configure the box label and Measurement Unit. A thing to note here is that we have selected memory balloon metric as shown in the following screenshot, but we have given it a label of GB. This is because of a new feature in 6.0 it will automatically upscale the metrics when shown on a scoreboard, this also goes for datastore GB to TB, CPU MHz to GHz, and network throughput from KBps to MBps. Typically in 5.x we would create super metrics to make this happen.

The downside to this is that the badge color still has to be set in the metrics base format.

  1. Save this dashboard once we have the metrics we want. Locate it under our dashboard list and select it, click on the little cog, and select Export Dashboards as shown in the following screenshot.
  2. This will automatically download a file called Dashboard<Date>.json.

Open this file in a text editor and have a look through it and we will see all the information we require to write our XML interaction file.

First off is our resourceKindKey and adapterKindKey, as shown in the following screenshot. These are pretty self-explanatory, resourceKind being Cluster resource, and adapter is the adapter that's collecting the metrics, in this case the inbuilt vCenter one called VMWARE.

Next are our resources, as we can see from the following screenshot we have metricKey, which is the most important one as well as the color settings, unit, and the label:

There it is, how we can get the information we require for XML files:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<AdapterKinds> 
   <AdapterKind adapterKindKey="VMWARE">      <ResourceKind resourceKindKey="ClusterComputeResource">        <Metric attrkey="cpu|capacity_usagepct_average" label="CPU" unit="%" yellow="50" orange="75" red="90" />   <Metric attrkey="cpu|demandPct" label="CPU Demand" unit="%" yellow="50" orange="75" red="90" />   <Metric attrkey="cpu|usagemhz_average" label="CPU Usage" unit="GHz" yellow="8" orange="16" red="20" />   <Metric attrkey="mem|vmmemctl_average" label="Balloon Mem" unit="GB" yellow="100" orange="150" red="200" /> 
      </ResourceKind> 
   </AdapterKind> 
</AdapterKinds> 
Any widget with the setting Metric Configuration available can use the XML files you create. The XML format is as per the preceding code. An XML file can also have multiple Adapter kinds as there could be different adapter metrics that you require.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.133.96