Check activemq connection via REST

book

Article ID: 140749

calendar_today

Updated On:

Products

CA Infrastructure Management CA Performance Management - Usage and Administration CA Performance Management - Data Polling

Issue/Introduction

Looking for a way to Check activemq connection via REST. 

 

 

 

Environment

Release : 3.7

Component : IM Polling

Resolution

all the information is on the /rest/dcms/ page of the DA. It is expensive in large environments, so you don't want to run it like every minute. The output is much larger then what you are getting now so I created a filter.


If you do a POST to:


<DA_SYSTEM>:8581/rest/dcms/filtered/

Of this body
<FilterSelect xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="filter.xsd">
<Select use="exclude" isa="exclude">
<DataCollectionMgrInfo use="exclude">
<CollectorState use="include"/>
<HostName use="include"/>
</DataCollectionMgrInfo>
<DistributedItemRepositoryInfo use="exclude">
<Status use="include"/>
</DistributedItemRepositoryInfo>
</Select>
</FilterSelect>

You will get this output if a DC is up:

<DataCollectionMgrInfoList>
<DataCollectionMgrInfo version="1.0.0">
<ID>5323</ID>
<HostName>lvntest001466.bpc.broadcom.net</HostName>
<CollectorState>RUNNING</CollectorState>
<DistributedItemRepositoryInfo version="1.0.0">
<Status>OK</Status>
</DistributedItemRepositoryInfo>
</DataCollectionMgrInfo>
</DataCollectionMgrInfoList>


And this output if the DC is down.

<DataCollectionMgrInfoList>
<DataCollectionMgrInfo version="1.0.0">
<ID>5323</ID>
<HostName>lvntest001466.bpc.broadcom.net</HostName>
<CollectorState>CONTACT_LOST</CollectorState>
<DistributedItemRepositoryInfo version="1.0.0">
<Status>NOT_CONNECTED</Status>
</DistributedItemRepositoryInfo>
</DataCollectionMgrInfo>
</DataCollectionMgrInfoList>




Ff you wish to use the command line you can put the body above in a text file and run a curl command. Example below uses payload.txt as the rest body and dc_status.txt as the output file.

curl -v -X POST -H "Content-Type: application/xml" http://lvntest001441.bpc.broadcom.net:8581/rest/dcms/filtered/ -d @"/tmp/payload.txt" > dc_status.txt