Managing eMessage Assets Through ThingWorx > Restarting the Agent Using ThingWorx Composer
Restarting the Agent Using ThingWorx Composer
Restart actions enable users to restart/reboot a remote Axeda agent from ThingWorx Composer. This action has the option to restart the complete Agent and associated Agent project components (hard restart) or to restart only the associated project components while the Agent continues running (soft restart). For example, if you download new Agent project components to an asset, you would want to run a Soft Restart action; if you upgrade the Agent on an asset, you would want to run a Hard Restart action.
Follow the steps below to restart an Axeda agent:
1. Log in to ThingWorx Composer.
2. Navigate to the Thing that represents the asset.
3. In the left navigation panel, under ENTITY INFORMATION, select Services. The Services page displays the available services for the Thing. Locate the service called RestartAgent.
4. Press the Test button to display the Test Service prompt.
5. Depending on the desired type of restart, choose one of these options:
Hard Restart — select the hardRestart check box and continue to the next step.
Soft Restart — leave the check box clear and continue to the next step.
6. Press the Execute Service button.
A message marked “ERROR” appears. It is a normal, informational message for all queued remote services. It indicates that the restart will be sent to the Axeda agent the next time it pings the eMessage Connector.
Error executing service
Unable to Invoke Service RestartAgent on SMM-600@SN001 :
SMM-600@SSN0001 is not connected.
Service invocation will be queued and invoked when the
connection is reestablished.
After the agent receives the restart message it returns a status message. If the status is non-zero then an exception (EdgeError event) is sent to the Connection Services Hub. The following examples of the Egress and Ingress messages (XML) may help to debug an error during execution of the RestartAgent service:
Egress Message for RestartAgent Service
Here is an example of the egress message that instructs the Axeda agent to perform a Hard Restart:
<EEnterpriseProxy.Rs mn="SMM-600" sn="SN0002" ow="drm-data_source" userId="installAdmin"
cmdId="SMM-600@SN000002-INVOKE-Services-RestartAgent#27#3>
<ha>1</ha>
</EEnterpriseProxy.Rs>
The difference between a hard and soft restart is the value of the element; a value of “1” indicates hard restart, and a value of “0” indicates soft restart.

Ingress Message for RestartAgent Service
After the agent receives the restart message it returns a status message. If the status is non-zero then an exception will be sent to the Connection Services Hub.
The following is an example of the message, note that the cmdId matches the one sent in the Restart Agent Egress message:
<eMessage id="91" rc="0" v="6.8.3" gwid="262" gwmn="SMM-600"
gwsn="SN0002" gwow="drm-data_source"
gwk="31c54ebc-be9d-3148-7c29-0fb07a835a03">
<D3 did="262" mn="SMM-600" sn="SN0002" ow="drm-data_source"
k="31c54ebc-be9d-3148-7c29-0fb07a835a03">
<SOAPStatus cmdI"SMM-600@SN0002-INVOKE-Services-RestartAgent#27#3 sc="0" xsc=""
t="2016-10-15T18:35:24.857z" userId="installAdmin" />
</D3>
</eMessage>

Status Message for RestartAgent Service
If the status code (sc attribute) of the SOAPStatus ingress message contains a non-zero status, indicating an error, then an EdgeError event is posted to the Connection Services Hub.
Was this helpful?