DatagardensAaro
Contributor
Contributor

Alarm Script failures

I'm trying to test basic functionality of alarm triggering scripts.

I have 3 versions of a simple script containing:

echo "data" >> data.txt

Two for windows: a bat file and a cmd file. One for linux: a sh file


I run the following commands:

c:\windows\system32\cmd.exe /c c:\test.bat

c:\test.cmd

sh /root/test.sh

My windows Vcenter 5.1 reports success but the data.txt file is not created.

My linux vcenter 5.5 appliance reports:

Alarm 'Dead_Path_Alarm' on 192.168.1.19 did

not complete script: A general system error

occurred: Failed to run script: Failed to invoke

command: Stream is not initialized

My first instinct was a permission issue, so I've made the necessary adjustments, but no luck.
My second instinct was to explore various quote patterns for the command line, but I've tried every possible combination and no luck.

Help is appreciated.

Tags (1)
0 Kudos
2 Replies
sajal1
VMware Employee
VMware Employee

Hello,

I suppose you already have checked and confirmed these:

VMware KB: Alarm action to trigger a script fails to run with the error: Command exited with non-zer...

If not then please check it.

Also check the vCenter log files for any error or any other indication.

DatagardensAaro
Contributor
Contributor

Your KB article recommend checking the logs, I hadn't thought of that.  This coincidentally led me to discover on my linux appliance that I had a file named "data.txt" in my logs directory.

Perhaps the script wasn't being run from its current directory! I ended up searching the vcenter and confirmed: on windows, the file indeed was being created in C:/windows/system32 by default. On linux, it was in the logs directory.

So the missing output appears to explained by that.


I've still not found any information on the "Stream uninitialized" error, but it's not happening right now.

0 Kudos