|We moved this page to our Documentation Portal. You can find the latest updates here.|
How can I test and debug recipes?
On Unix systems, simply copy the content of the recipe script into the file located on remote machine, make it executable (chmod +x script_file) and run it.
For linux/Unix based VMs also check:
On Windows systems, copy the recipe script to destination machine. Connect to the machine via SSH from the onapp user on the Control Panel server:
ssh SvcCOPSSH@xxx.xxx.xxx.xxx for 3.x based templates
ssh Administrator@xxx.xxx.xxx.xxx for 4.x based template
You will be taken to a terminal.
cmd /Q /C "CALL script_file"
cmd /C "CALL CScript.exe script_file //Nologo"
cmd /C "CALL %windir%\System32\
WindowsPowerShell\v1.0\powershell -InputFormat None -NonInteractive -NoLogo Set-ExecutionPolicy Unrestricted"
cmd /C "CALL %windir%\System32\WindowsPowerShell\v1.0\powershell -InputFormat None -NonInteractive -NoLogo -File script_file"
Try to run your scripts this way before creating a recipe. This will ensure they are working via SSH and that you have enough permissions to perform the desired actions.
When running a recipe, you can also gather useful output with the following command, whilst the recipe is in progress from your Control Panel server:
tail -f /onapp/interface/log/onapp.err