Zabbix doesn't run custom alert script

I'm running Debian 8 and Zabbix 3.4 and made a custom alert script, which runs fine when I run in terminal from /usr/lib/zabbix/alertscripts:

./sms.sh

This send a SMS via Nexmo.

In my zabbix_server.conf I have:

AlertScriptsPath=/usr/lib/zabbix/alertscripts

I've created a custom media type following https://www.zabbix.com/documentation/3.4/manual/config/notifications/media/script

But the script is not being called.

My permissions for the script is:

ls -alh
total 12K
drwxr-xr-x 2 root root 4.0K Jun 27 12:26 .
drwxr-xr-x 4 root root 4.0K Jun  6 11:12 ..
-rwxr-xr-x 1 root root  181 Jun 27 12:37 sms.sh

I've tried to grep for "sms" and "nexmo" in the /var/log/ directory to see if any errors occurred. Nothing.

I'm ending my script with

exit 0

How to debug?


Solution 1:

Configure:

DebugLevel=5

and restart&check zabbix server logs. Good test will be also to run your sms.sh script under zabbix user.