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
@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.
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
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
jingo5star
23 Posts
433
1
Posted 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.