user2471801
user2471801

Reputation: 167

Grafana: Get the max of max for singlestat

I have been searching the web looking for an answer to this, but I cannot seem to find an answer or figure it out.

I am new to Grafana and I am trying to setup a singestat gauge. I have

16 servers (HPG6-01 to HPG6-16)

Each server has 8 cores

Each server has Nagios plugin that sends the maximum temperature across all cores. For instance Core 0-8 temperature for HPG6-01 is T = [33,34,55,45,37,38,46,33], Nagios plugin returns Max-Temp = max(T) = 55

Performance data is sent to Shinken, which has a plugin for Graphite.

I can plot the current Max-Temp in Grafana which is easy (see the line graph below). But I also want the maximum of Max-Temp across the 16 servers to be displayed as a single stat. For example,

MT = [34, 56, 60, ...] #the Max-Temp for each of the servers

singlestat = max(MT)

On the right side, we see the maximum temperature across all cores for each server HPG6-01 to HPG6-16. On the right, I want to show the maximum temperature across all servers (the max of max)

The metrics for the single stat is shown in the screenshot below:

grafana singlestat metrics

The options for the single stat is shown below:

grafana single stat options

Any ideas on how I can do that? I tried consolidateBy(max) and I get an error "Metric query returns 16 series. Single Stat Panel expects a single series." because it returns a series instead of a scalar.

Upvotes: 2

Views: 5794

Answers (1)

Matt Clark
Matt Clark

Reputation: 28629

I like to use the highestMax function for this.

highestMax(HPG6*.shinken.Core_Temp.Max-Temp, n)

This function will only show n number of series that have the highest values; for your use-case, I would just use 1, to get the absolute maximum value across all series.

This will show the series with the absolute maximum value across the selected time frame. To see the highest current value, use just that,

highestCurrent

Upvotes: 2

Related Questions