Disabling Alerts CLI Example in JBoss ON doesn't work

Solution Verified - Updated -

Issue

  • The example CLI script that disables alerts errors on execution:
org.rhq.enterprise.client.script.CLIScriptException: org.rhq.scripting.javascript.engine.util.ExtendedScriptException: org.mozilla.javascript.EvaluatorException: Can't find method org.rhq.core.domain.criteria.AlertDefinitionCriteria.addFilterPriority(string). (<Unknown source>#2) in <Unknown source> at line number 2
        at org.rhq.enterprise.client.commands.ScriptCommand.executeScriptFile(ScriptCommand.java:291)
        at org.rhq.enterprise.client.commands.ScriptCommand.execute(ScriptCommand.java:93)
        at org.rhq.enterprise.client.ClientMain$StartupConfiguration.process(ClientMain.java:163)
        at org.rhq.enterprise.client.ClientMain.run(ClientMain.java:188)
        at org.rhq.enterprise.client.ClientMain.main(ClientMain.java:172)
Caused by: org.rhq.scripting.javascript.engine.util.ExtendedScriptException: org.mozilla.javascript.EvaluatorException: Can't find method org.rhq.core.domain.criteria.AlertDefinitionCriteria.addFilterPriority(string). (<Unknown source>#2) in <Unknown source> at line number 2

Environment

  • Red Hat JBoss Operations Network (ON) 3.3
  • ON CommandLine Interface (CLI) 3.3
  • script example taken from documentation:
var criteria = new AlertDefinitionCriteria()
criteria.addFilterPriority('Low')

//search for the alert definitions
alertdefs = AlertDefinitionManager.findAlertDefinitionsByCriteria(criteria)

//get the data from the results
alertdef = alertdefs.get(0);

println("  alert: " + alertdef.id );

//disable the matching alerts, based on ID
AlertDefinitionManager.disableAlertDefinitions([alertdef.id]);

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.