vROps Supermetric to Count the Number of Times a Metric Exceeded a Threshold.

Recently I was asked is vROps can report the number of times a metric exceeded a certain value. As an example:

How many times has server-xyz’s CPU usage exceeded 70% during the last week?

While this is something easy to show with a graph, it is not able to be shown at scale for hundreds or thousands of virtual machines. So I created a supermertric and some views that allow us to count.

Here is what the supermetric looks like:

sum(${this, metric=cpu|usage_average}>=70)

This metric for each data collection will return either “0” if the CPU usage is less than 70%, or it will return “1” if the CPU usage is greater than or equal to 70% For reference, when creating a supermetric, enclosing the metric in brackets signifies an “if” statement within vROps. The vROps admin guide has a list of operators that work with the “if” statement.

The next step is to simply create a view that makes use of the new metric. To set up the view use the following criteria:

  • Name and Description: Whatever you want to name it 🙂
  • Presentation =  List Type
  • Subjects = VirtualMachines
  • Data = Super Metric > name of the supermetric you created. In my example, it is called “cpuUsageCount70”. Make sure for the supermetric you change the “Transformation” dropdown to “Sum”  Also, click the “Time Settings” button and adjust the timeperiod if desired. The default will be “Last 7 Days”

That’s it. Next step is to just compare a graph of CPU usage to your newly created view if you would like. Because we just created this super metric, you do have to give it time to actually collect data.

Here is an example of the super metric view versus a graph of the CPU usage:

 

vROPs view
View of a virtual machine using a supermetric

 

 

vROPs Graph
Graph of CPU usage over one week.

Leave a Reply

Your email address will not be published. Required fields are marked *