Decide on the central host from where to execute the script. You only need a single host to manage channels on multiple systems. I selected the host "a4h-vm1" which happens to be the central instance host of one of my SAP systems.
Decide on where to save your script. I used the location /usr/sap/scripts on the above single host
#!/bin/bash
HOST=$1
PORT=$2
PASS=$3
PARTY=$4
SERVICE=$5
COMMAND="curl -u \"pidemo:$PASS\" \"http://$HOST:$PORT//AdapterFramework/ChannelAdminServlet?party=$PARTY&service=$SERVICE&channel=*&action=STOP\""
eval $COMMAND
Note the use of channel=* which means we will stop all channels for chosen party and service.
On the same host as above, create the file pi_channel_stop_all.conf
# cd /usr/sap/hostctrl/exe/operations.d
# vim pi_channel_stop_all.conf
Username: root
Name: pi_channel_stop_all
Description: Stop all channels
Command: /usr/sap/scripts/pi_channel_stop_all.sh $[PARAM-HOST:#required] $[PARAM-PORT:#required] $[PARAM-PASS:#required] $[PARAM-PARTY:#required] $[
PARAM-SERVICE:#required]
ResultConverter: flat
Platform: Unix
4. Click on the newly created provider definition.
5. Go to Parameters tab and click on “Add Parameter”. Add the below 5 parameters of Type string for all except PORT which is integer. Select Mandatory for all. Also mark the parameter PASS as secure.
2. Click on the newly created custom operation
3. Click on constraints. This is an optional step. We want to restrict the operation to be selectable from a single host. This does not mean the operation occurs on this host. The host in the URL is the one that determines where it will be executed.
4. Click Add Constraint and then fill out the constraint details
First let's check that channel are running. Go to a browser and add the URL with action STATUS
http://<host or IP>:<PORT>//AdapterFramework/ChannelAdminServlet?party=Party_VAN&service=VAN_Provider&channel=*&action=STATUS
Now lets stop all the channels from LaMa:
3. On the next screen fill in the parameters as needed. Example below:
4. Click Execute on the next screen
http://<host or IP>:<PORT>//AdapterFramework/ChannelAdminServlet?party=Party_VAN&service=VAN_Provider&channel=*&action=STATUS
Enter the following to stop a specific channel
Provider Type: HTTP POST
Name: pi_channel_stop_party_van
URL: http://<host>:<port>//AdapterFramework/ChannelAdminServlet?party=Party_VAN&service=VAN_Provider&chan...
Username: <username>
Password: <your password>
Operation Uses: Host
Save Provider
1. Go to Automation Studio -> Custom Operations -> Create
2. Click on the newly created custom operation
3. Click on constraints. This is an optional step. We want to restrict the operation to be selectable from a single host. This does not mean the operation occurs on this host. The host in the URL is the one that determines where it will be executed.
4. Click Add Constraint and then fill out the constraint details
First let's check that the channel is running. Go to a browser and add the URL with action STATUS
http://<host or IP>:<PORT>//AdapterFramework/ChannelAdminServlet?party=Party_VAN&service=VAN_Provider&channel=1_ReceiveBulkOrdersFromVAN_AS2_Sender&action=STATUS
OUTPUT:
<ChannelAdminResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xx:xx/AdapterFramework/channelAdmin/ChannelAdmin.xsd">
<Channels>
<Channel>
<Party>Party_VAN</Party>
<Service>VAN_Provider</Service>
<ChannelName>1_ReceiveBulkOrdersFromVAN_AS2_Sender</ChannelName>
<ChannelID>4b51da227b253e08865cc70b6554066a</ChannelID>
<AdapterType>AS2</AdapterType>
<Direction>INBOUND</Direction>
<ActivationState>STARTED</ActivationState>
<ChannelState>OK</ChannelState>
<Control>WEBSERVICE</Control>
</Channel>
</Channels>
</ChannelAdminResult>
Now lets stop the channel from LaMa:
3. Click Execute on the next screen
http://<host or IP>:<PORT>//AdapterFramework/ChannelAdminServlet?party=Party_VAN&service=VAN_Provider&channel=1_ReceiveBulkOrdersFromVAN_AS2_Sender&action=STATUS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
23 | |
11 | |
10 | |
8 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 |