Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Invoking a script in a remote server and returning the exit code

Do you know if there is any component that invokes a script in a remote server?
For example, I'd like to invoke a C or PHP script in a remote Unix Server using Talend.
The script returns an exit code that indicates success (0) or failure (1).
Is this something I can do through Talend?
Thanks,
Daniel
Labels (2)
4 Replies
Anonymous
Not applicable
Author

Hi,
tSSH should do it.
HTH,
Anonymous
Not applicable
Author

Thanks for the reply. I am now using the tSSH component to run a PHP script in a remote server. The command line I've put in the component is as below.
"php /var/www/html/sample/www/test/crontest.php"
The tSSH successfully ran the script. However, I am still not sure how I can return the exit code so to know if the php script ran successfully or not.
Although I've tried "exit 0", "exit 1", or "exit -1" in the PHP script, it all led to the "Success" message box, not the "Fail" message box.
Am I missing something?



Thank you!!!!
Daniel
Anonymous
Not applicable
Author

Hello Daniel
tSSH component run actually ok even thought the exit code is 1 or 0 return by php script.
Did you try the global variable: ((Integer)globalMap.get("tSSH_1_EXIT_CODE")). Check the value of this variable when your php script run successfully or not.
tSSH--RunIf(((Integer)globalMap.get("tSSH_1_EXIT_CODE"))==1)-->tMsgBox
|
RunIf(((Integer)globalMap.get("tSSH_1_EXIT_CODE"))==0)-->tMsgBox
Best regards

shong
Anonymous
Not applicable
Author

I appreciate your help Shong. It worked perfectly.