I'm trying to create a function that takes a ruleId and returns all of the alarms(not just the current ones) in the past week for that rule. When I try to test it I get the following error:
the value returned by the Script: "Static value of type: "com.quest.nitro.service.alarm.AlarmImpl"" is not assignable to the Script output type: "foglight-5:Alarm"
This is the code I'm using for the function.
package system._customdashboards.scripts; // This script comes with no support, expressed or implied. import com.quest.nitro.service.alarm.*; import com.quest.nitro.service.sl.interfaces.alarm.*; import groovy.time.*; topSvc = server.get("TopologyService"); almSvc = server.get("AlarmService"); rulSvc = server.get("RuleService"); use (TimeCategory) { dateEnd = new Date(); dateStart = dateEnd - 1.week; alarms = almSvc.getAlarms(dateStart, dateEnd); } return alarms.findAll{it.getRuleID() == AlarmCountInput.ruleID};
I have the Output Data type set to Monitoring:Alarm. I this the wrong type? Is there some way to convert com.quest.nitro.service.alarm.AlarmImpl to foglight-5:Alarm?