on 01-05-2011 10:54 AM
I hope this is the right place to post this.
I've been trying to use the sapcontrol (webservices protocol GSOAP_HTTP) interface to perform an OSExecute webmethod, but am getting some strange responses.
I'm sending the required authentication with the command and receive a repsonse saying the the command has run (response code 0) and the PID of the run command. However the output of the command is never returned or written to a protocol file if specified in the command line.
I've also checked by running commands such as "touch /tmp/me" and the command never seems to actually run on the remote system. Very strange!
All other webmethods appear to work as expected (GetEnvironment etc...)
Version: 700, patch 95, changelist 886306, optu, linuxintel
Update:
ctbadm@ivml2005:/usr/sap/> sapcontrol -nr 00 -host 127.0.0.1 -user ctbadm sap123 -prot GSOAP_HTTP -function OSExecute ls 60 0
05.01.2011 15:43:59
OSExecute
OK
exitcode, pid, lines
0, 26005
Edited by: ChrisRiley on Jan 5, 2011 3:46 PM
Hello Chris,
please use the full path to the OS command which you start with "OSExecute", so not only "touch" or "ls" but full path to these commands. Will it work? For me the command "sapcontrol -nr 02 -function OSExecute ls 0 30" does not work, but if I execute "sapcontrol -nr 02 -function OSExecute "/bin/ls" 0 30" it works.
Regards,
Alwina
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chris,
You had any luck with OSExecute?
We are seeing the similar issue with OSExecute.
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Mahesh,
you do have to execute the command as follows:
sidadm> sapcontrol -prot NI_HTTP -host hostname.domain -nr <instance> -user sidadm password -function OSExecute "/bin/pwd" 0 30
Functions like "GetVersionInfo" work without "-user ...". For executing an os-command this is needed, otherwise you get an error like:
date time
OSExecute
FAIL: HTTP error, HTTP/1.1 401 Unauthorized
You can check access to functions with:
sidadm> sapcontrol -prot NI_HTTP -host hostname.domain -nr <instance> -function AccessCheck function
My problem is:
how do I create a protocol for osexecute command?
I get an error when using this command:
sidadm> sapcontrol -prot NI_HTTP -host hostname.domain -nr <instance> -user sidadm password -function OSExecute "/bin/pwd" 0 30 protocol="/home/sidadm/test"
date time
OSExecute
FAIL: Cannot create protocol file
Even if I want to create the protocol in /home/sapadm (user which executes the sapcontrol commands), this does not work.
Any idea?
Regards,
Julia
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.