on 09-10-2014 8:02 AM
Hi All,
We're planning to use "OSExecute" function and try to run some commands on SAP system.
The "OSExecute" function seems to execute the command successfully, but output of the command which was executed is not displayed correctly.
Here is the OSExecute command and output:
********
[root@AAA ~]# pwd
/root
[root@AAA ~]# /usr/sap/hostctrl/exe/sapcontrol -nr 00 -function OSExecute "pwd" 0 30
09.09.2014 23:49:07
OSExecute
OK
exitcode, pid, lines
2, 52098
[root@AAA ~]#
***********
Looking at the above command output:
1) I was thinking the "lines" column should display the output of the pwd command, which is "/root". But, "/root" is not dispalyed in command output. Not sure why?
2) I couldn't find in the SAP document(/internet) what the "exitcode" 2 indicates.
3) I believe this is not related to user privileges.
The issue seems to be only with "OSExecute" function of sapcontrol.
As an additional information, we're able to execute other functions of "sapcontrol". Please find the below command output:
*****
# /usr/sap/hostctrl/exe/sapcontrol -nr 00 -function GetProcessList
09.09.2014 23:30:57
GetProcessList
OK
name, description, dispstatus, textstatus, starttime, elapsedtime, pid
msg_server, MessageServer, GREEN, Running, 2014 09 08 23:41:27, 23:49:30, 28473
igswd_mt, IGS Watchdog, GREEN, Running, 2014 09 08 23:41:27, 23:49:30, 28475
disp+work, Dispatcher, GREEN, Running, Message Server connection ok, Dialog Queue time: 0.00 sec, 2014 09 08 23:41:27, 23:49:30, 28474
[root@AAA ~]#
*********
If you've any idea on "OSExecute" function , please let me know. Greatly appreciated.
Thanks,
Mahesh
Try to provide full path to the command.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
please check the document @ http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60e24f7b-1ba1-2b10-c0a0-e514b8556...
OSExecute <command> <async> <timeout> <protocolfile>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mahesh,
Try to add "service/protectedwebmethods = NONE OSExecute" or "service/protectedwebmethods = DEFAULT OSExecute" in instance profile and try again with sidadm and other users.
Regards,
Divyanshu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Divyanshu,
thanks for quick response.
I have updated the profile file as you suggested , but no luck.
Please find the below command and output.
******service/protectedwebmethods = NONE OSExecute**************
SIDadm> /usr/sap/hostctrl/exe/sapcontrol -nr 00 -function RestartSystem
10.09.2014 02:01:14
RestartSystem
OK
SIDadm> /usr/sap/hostctrl/exe/sapcontrol -nr 00 -function OSExecute "ls" 0 30
10.09.2014 02:01:30
OSExecute
OK
exitcode, pid, lines
2, 7638
SIDadm> cat /sapmnt/SID/profile/DEFAULT.PFL | grep service/protectedwebmethod
service/protectedwebmethods = NONE OSExecute
#service/protectedwebmethods = DEFAULT+OSExecute
***********************
*****service/protectedwebmethods = DEFAULT OSExecute **************
SIDadm> /usr/sap/hostctrl/exe/sapcontrol -nr 00 -function RestartSystem
10.09.2014 02:14:02
RestartSystem
OK
SIDadm> cat /sapmnt/SID/profile/DEFAULT.PFL | grep service/protectedwebmethod
service/protectedwebmethods = DEFAULT OSExecute
#service/protectedwebmethods = DEFAULT+OSExecute
SIDadm> /usr/sap/hostctrl/exe/sapcontrol -nr 00 -function OSExecute "pwd" 0 30
10.09.2014 02:14:36
OSExecute
OK
exitcode, pid, lines
2, 10309
SIDadm> /usr/sap/hostctrl/exe/sapcontrol -nr 00 -function OSExecute "ls" 0 30
10.09.2014 02:14:55
OSExecute
OK
exitcode, pid, lines
2, 10493
*******************
-Mahesh
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.