This post is more than 5 years old

23 Posts

144600

November 29th, 2012 19:00

Derived Metric Rulette Disabled "No Trigger"

I figure I would throw this out there as I am not sure why my derived metric is not triggering even though I am selecting schedule driven and check the "Enable trigger without Data" box.  I tested the metric script without issue and cannot find a reason why this shouldn't run at the scheduled time.

2012-11-29 13:17:18.226 VERBOSE [Utility-1-thread-45363] com.quest.nitro.service.derivation.DerivationCalculation - DerivationCalculation for "Cluster_Growth_Rate_New" on 'VMWCluster' calculated by (ds = server.get("DataService")...) has rulettes disabled for the following reason(s): No trigger(1 rulettes)

-

ds = server.get("DataService") // Data Service then = null numdays = 180 while (then == null) { try { String query = "virtualMachinesPoweredOnCount from VMWCluster:name = '$scope.name' for 1 day $numdays days ago" then = min(server.QueryService.queryObservations(query)) } catch (Exception e) {} if (then >= 0){break} numdays-- } now = ds.retrieveLatestValue(scope, "virtualMachinesPoweredOnCount").getValue().max // Retrieves the current value growthRate = Math.ceil(((now - then) / numdays * 30)) // Calculate current growth rate return growthRate

23 Posts

November 30th, 2012 15:00

@John - I put the coding you suggested in the script and found the derived metric wasn't even getting a message in the log.

@Thomas - I did try it with "Enter, Exit, and Enter and Exit" to no avail

I started diving in a little more and found that my other 3 derived metrics that ran successful for months were not calculating anymore. I rebooted the server and all of the derived metrics including Cluster Growth were running successfully. It appeared to be some sort of issue with the server and not the derived metric.

132 Posts

November 29th, 2012 23:00

Does it work when set to run on a time interval, rather than on a schedule?

132 Posts

November 30th, 2012 11:00

How many clusters is this running against?

23 Posts

November 30th, 2012 11:00

Setting it to run on a time interval is something I tried as well without success.

132 Posts

November 30th, 2012 12:00

if you want, you can add Debug code as follows.  You can find the log entries in the most recent management log.

derivedMetricRulette = "derivedMetric.script.ClusterGrowthRate @ VMWCluster = " + scope?.name    // if you get an error, shows the source and scope better in the management logs

org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(derivedMetricRulette);

if (!scope) {

     log.error("scope is null")

     return null

}

ds = server.get("DataService") // Data Service

valueThen = null
numdays = 180

while (valueThen == null && numdays > 0) {

    try {
        String query = "virtualMachinesPoweredOnCount from VMWCluster:name = '$scope.name' for 1 day $numdays days ago"
        valueThen = min(server.QueryService.queryObservations(query))
    } catch (e) {
        // log.info("valueThen = min(server.QueryService.queryObservations($query)) : " + e.toString())       // comment out this line once you figure out what's wrong, will create a lot of log entries
    }
    //if (valueThen >= 0){ // code not needed
    //    break
    //}
    numdays--

}

try {
    valueNow = ds.retrieveLatestValue(scope, "virtualMachinesPoweredOnCount")?.getValue()?.max // Retrieves the latest available value, not necessarily current

    if (valueNow && valueThen && numdays > 0) {
        growthRate = Math.ceil(((valueNow - valueThen) / numdays * 30)) // Calculate current growth rate
        return growthRate
    }

} catch (e) {
    log.error("valueNow = ds.retrieveLatestValue : " + e.toString())
}
return null

23 Posts

November 30th, 2012 12:00

I only have 1 cluster in this environment

171 Posts

November 30th, 2012 12:00

Do you have it on entry or exit of the schedule?  Not that it should matter, but with both turned on it seems to generate for me.

No Events found!

Top