When trying to compare a metric value with a threshold in a custom rule the following error is received:
groovy.lang.GroovyRuntimeException: Cannot compare com.quest.nitro.model.canonical.bean.SingleValueMetricSummary with value <metric value> and <threshold data type> with <threshold value>
where <metric value> is the value of the metric you are trying to compare, <threshold data type> is the data type of the value of that you are comparing the metric against, and <threshold value> is the actually threshold value itself.
,
A metric summary consists a number of value readings including current (the last value obtained), last (the previous value), and average.
Change the Groovy expression being used to obtain one of the actual metric readings instead of the summary. For example instead of:
ds.retrieveLatestValue(topSvc.getObject(FSStats.getUniqueId()),"Capacity_Used").value;
use:
ds.retrieveLatestValue(topSvc.getObject(FSStats.getUniqueId()),"Capacity_Used").value.getAvg();