Filtering alerts using JBoss ON CLI

Solution Verified - Updated -

Issue

  • Filtering alerts using JBoss ON CLI
  • What could I do in order to get the alert name "java.lang.OutOfMemoryError" and the JBoss server name when using code below:
// set the criteria and search for the alerts
var criteria = new AlertCriteria()
criteria.addFilterResourceTypeName('JBossAS7 Standalone Server')
var alerts = AlertManager.findAlertsByCriteria(criteria)

for ( i =0; i < alerts.size(); ++i) {
    var alert = alerts.get(i);  
    var matchingalert =  alerts.contains("OutOfMemoryError");
    if (matchingalert)  {
        var al = ProxyFactory.getResource(alert.getId());     
        println("#" + alert.toString());
    }
}

Environment

  • Red Hat JBoss Operations Network (JON) 3.2.3
  • Red Hat JBoss ON Command Line Interface (CLI) 3.2.3

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.