Reg. sapcontrol's OSExecute function
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@AAA ~]# /usr/sap/hostctrl/exe/sapcontrol -nr 00 -function OSExecute "pwd" 0 30
exitcode, pid, lines
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
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
If you've any idea on "OSExecute" function , please let me know. Greatly appreciated.
Thank you, Roman. That works.