VMware Cloud Community
linnadl
Contributor
Contributor

Run script as Alarm Action - doesn't work

Hi all,

I hope you can assist me with an issue I'm having.

I have uploaded a script to my vCenter Server(VCSA 6.0) that I want to run when an alarm triggers. I have no problem running the script from the vCenter terminal - it works. However when I run the script from the alarm I get an error message in the events log i vSphere Client:

"Host did not complete a script: A general system error occurred: Failed to run script: Failed to invoke command: Stream is not initialized".

The script is located in /bin and the command I'm adding to the alarm is /root/bin/script.sh

If I add /script.sh or /bin/script.sh to the alarm the error message is the same.

Note: if I add #!/bin/bash to the top of my script the error message changes to:

"A general system error occurred: Failed to run script: Command exited with non-zero status 127"

/root/bin is in $PATH and the script has execution permissions for all users (755).

Have you seen this issue before or do you have any suggestions for me?

Thank you all!

Tags (1)
0 Kudos
0 Replies