Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

How to monitor PRPC agent status using query or Java API

SA-978

Summary



How can PegaRULES Process Commander agents be monitored outside of SMA and PRPC?


Resolution


 

The agent status JMX method that SMA uses is accessible to third party applications.

 

a- monitor agent status from an external application that use appropriate remote JMX protocol for your platform to call PRPC, execute the agent status mbean and interpret the XML results.
The command-line jmxterm will work as an example.

 

b- monitor agent status from an external application that calls a PRPC SOAP or HTTP service. In the public API there is an agentUtils object can provide you with access to current agent status. See step 1 of activity pzCheckSearchAgentStatus (below)

 

c- monitor agent status from an external application that calls a PRPC SOAP or HTTP service that uses the pega API method to call the agentStatus mbean methods. In the AESRemote ruleset there is an executeMbean service and activity. In the PegaAES ruleset there are activities to make a SOAP request to a node to call mbean com.pega.pegarules.management.AgentManagement operation AgentStatusAdvanced (then apply a parse-xml to interpet the results).

 

code sample for agentStatus

    com.pega.pegarules.pub.context.AgentUtils agentUtils = tools.getAgentUtils();
    com.pega.pegarules.pub.util.StringMap systemPulse = agentUtils.getQueue("Pega-RULES", 1);
    com.pega.pegarules.pub.util.StringMap systemIndexer = agentUtils.getQueue("Pega-RULES", 2);
    com.pega.pegarules.pub.util.StringMap systemWorkIndexer = agentUtils.getQueue("Pega-RULES", 5);
    agentError = systemPulse == null || !Boolean.valueOf(systemPulse.getString("IsEnabled")).booleanValue() || !"".equals(systemPulse.getString("LastExceptionData"));
    agentError = agentError || systemIndexer == null || !Boolean.valueOf(systemIndexer.getString("IsEnabled")).booleanValue() || !"".equals(systemIndexer.getString("LastExceptionData"));
    agentError = agentError || systemWorkIndexer == null || !Boolean.valueOf(systemWorkIndexer.getString("IsEnabled")).booleanValue() || !"".equals(systemWorkIndexer.getString("LastExceptionData"));

Published September 16, 2016 - Updated October 8, 2020

Was this useful?

33% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us