Alert does not invoke custome event

I have create a alert where it get triggered when my host get disconnected and this alert has assigned to a alert profile and which is assigned my host

I can see that the alert event gets triggered in the automate > logs but it do not execute the ruby script and the events are also intermittently triggered .

The alert event works perfectly fine with vm ie I added a script in automation domain and added logs which works perfectly as i can see log getting printed in the automation logs but it does not work for hosts
Any way to debug the same

Unfortunately debugging this kind of thing generally involves trawling through the logs.

This chapter in the automate book goes though event processing in (admittedly) painful detail, right through to generating an alert. It might give you some hints as to what text to search for in the logs to see how far the event processing gets.

You can merge evm.log and automation.log to see the lines output into both files by the same worker PID, something like:

cat evm.log automation.log | cut -d " " -f 3- | awk '/^\[/ {print $0}' | sort -t ':' -k1 -k2n -k3n | grep “#<my_pid>”

Your event/alert processing workers would be the generic and priority workers, and you can find their PIDs using rake evm:status from the command line. Of course the task is made more complex where you have multiple appliances in your zone as any of the appliances could potentially process each step of the alert handling.

Hope this helps,