Looking for a way to check activemq connection via REST.
Dx NetOps Performance Management any version
All the information desired is within the ../rest/dcms/ page of the DA. It is expensive in large environments, so you don't want to run it 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><DCHostName></HostName>
<CollectorState>RUNNING</CollectorState>
<DistributedItemRepositoryInfo version="1.0.0">
<Status>OK</Status>
</DistributedItemRepositoryInfo>
</DataCollectionMgrInfo>
</DataCollectionMgrInfoList>
And this output is if the DC is down.
<DataCollectionMgrInfoList>
<DataCollectionMgrInfo version="1.0.0">
<ID>5323</ID>
<HostName><DCHostName></HostName>
<CollectorState>CONTACT_LOST</CollectorState>
<DistributedItemRepositoryInfo version="1.0.0">
<Status>NOT_CONNECTED</Status>
</DistributedItemRepositoryInfo>
</DataCollectionMgrInfo>
</DataCollectionMgrInfoList>
If you wish to use the command line you can put the body above in a text file and run a curl command. The 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://<hostname>:8581/rest/dcms/filtered/ -d @"/tmp/payload.txt" > dc_status.txt