Need curl command to display queued agents using linux script from AEM | Community
Skip to main content
Level 2
October 10, 2024
Solved

Need curl command to display queued agents using linux script from AEM

  • October 10, 2024
  • 2 replies
  • 1258 views

I need curl command to display list of queued agents in AEM author and publisher using Linux scripting. If someone have idea please share.

 

Thank you.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by EstebanBustamante

Hi EstebanBustamante,

 

I reviewed above comments and i am able to check the status using below command for single agent.

http://aemHost:port/etc/replication/agents.author/publish/jcr:content.queue.json?agent=publish

But my expectation is to check dynamic for all the queued agents list 

present under publisher location(/etc/replication/agents.publish).

 

Note: I have large no.of agents under publisher.


To clarify, you cannot achieve this with a single request. Instead, you need to follow a series of steps. As I mentioned in my previous answer, first, you should query all the available agents. Then, use the dynamically retrieved agents to gather their details. With that information, you can refine and produce whatever output or formatted response you need. You’ll need to incorporate these steps into a Bash script and use curl as necessary to implement your desired outcome.

 

I hope this helps!

2 replies

EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
October 10, 2024
 

Hi,

 

Could you elaborate on what you are trying to achieve? Are you looking to see which agents are full or empty? Is this specifically related to replication agents?

One way to accomplish this is to build your own service (servlet) that returns the information you need in the desired format, which you can then invoke from your Linux script. In the servlet, you have access to the Agent Interface, allowing you to check aspects like the queue: Agent Interface Documentation. Depending on your requirements, you can also use other OOTB Java APIs to build your service.

 

Servlet reference:

https://medium.com/@toimrank/aem-sling-servlet-ca9e5926a384 

https://www.youtube.com/watch?v=ZAlR0nPdpSI&ab_channel=AEMGEEKS

 

Hope this helps

Esteban Bustamante
Level 2
October 10, 2024

Thank for the response.

 

But i have the requirement to display the queued or blocked agents names and count using Linux scripting for the AEM author and publisher. So I am expecting curl command to get all blocked agents list from server.

 

And i need to know we can archive or not for this in Linux scripting.

EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
October 11, 2024

Yes, you can use the following URLs to achieve what you need:

 

  1. These will give you the list of agents: http://aemHost:port/etc/replication/agents.author.2.json and http://aemHost:port/etc/replication/agents.publish.2.json. These endpoints will provide all the agents, and from here, you will need to filter out which ones are "enabled."

  2. You can build new requests based on the results from step 1, following this format: http://aemHost:port/etc/replication/agentLocation/nameOfTheAgent/jcr:content.queue.json?agent=nameOfTheAgent, where agentLocation is either agents.author or agents.publish, and nameOfTheAgent is the name of the agent.

    For example: http://aemHost:port/etc/replication/agents.author/publish/jcr:content.queue.json?agent=publish.

  3. Based on the above request, you can count and check the status of the agents to see if they are blocked or queued.

Hope this helps

 

 

 

 

Esteban Bustamante
narendiran_ravi
Level 6
October 10, 2024
Level 2
October 14, 2024

Hi Narendiran,

Thanks for your response.

Yes. i have already viewed the article and mentioned only shingle agent status check.

But my expectation is to check dynamic for all the queued agents list 

present under publisher location(/etc/replication/agents.publish).