Could not run a powershell command on a Linux tentacle

Please if you can help me with the following problem:
I am trying to execute a command “shutdown -r now” with the option power shell that is available in the process editor and it is giving me the following error:

"Failed
The deployment failed because one or more steps failed. Please see the deployment log for details.

Step 2: Run a Script Linux
The step failed: Activity Run a Script Linux on ubuntu failed with error ‘The remote script failed with exit code 255’.

ubuntu
The remote script failed with exit code 255
The action Run a Script Linux on ubuntu failed"

The tentacle is already installed and operational in linux ubuntu.

Please I would appreciate your support with this case, thank you!

Oscar González.-
OctopusServer.txt (235.6 KB)

Hi Oscar,

Thanks for reaching out! It looks like the issue is the ‘Powershell’ option being used for a Linux instance. Try running the script with the ‘Bash’ option selected - the command looks fine! Also make sure to create a new release so that the changes are picked up.

Let me know if this fixes your problem, or if there is anything more I can help with!

Regards,
Finn

Finnian thank you very much for your reply. I tell you that I have managed from power shell to send a command to my Ubuntu tentacle, and that problem is solved.

Finnian could you please help me with the following problem,
I tell you the scenario:
I have an ubuntu server 16 that I am monitoring with the Nagios application and I need that when an alarm is generated in Nagios it sends a request to the Octopus to execute a runbook (specific script) in the tentacle that would also be the ubuntu server 16.

In summary, how do I integrate the Nagios with the Octopus, how do I send a request to the Octopus from Nagios? would it be via API? or how could I do it?

Finnian please your support with this case, I am conducting some feasibility tests to work with Octopus and acquire licenses, I am interested in solving this, thank you!

Oscar González

Hi Oscar,

Glad you were able to resolve the previous issue!

While we are not experts in Nagios, I can definitely provide some assistance. The integration will depend on what Nagios is able to do when an alarm is triggered.

If you are able to run a command or script when the alarm is triggered then the Octopus CLI will be able to invoke a Runbook. I’ve attached the relevant CLI documentation, see examples at bottom of page.

If you have any further questions or issues feel free to let me know!

Regards,
Finn

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.