View Full Version : Script media failure
I'm trying to execute my first triggered script in Zabbix. Everything seems to be working fine (the trigger creates an alert), but the script does not execute. I get the following message in zabbix_suckerd.log:
Error executing [/home/zabbix/bin/touch]
The script is very simple, containing only this one line:
touch /tmp/zabbix.out
The permissions on the touch file are rwxrwxrwx.
I've simplified this as much as I can, maybe too much. What am I missing?
TIA
Nate Bell
29-03-2005, 20:46
Just a thought, but have you made your script an executable file? If not, the system won't know to run it. Type: chmod a+x touch to add the executable attribute. I gave this a try and the script works fine with the added attribute.
As a side note, you may want to rename the script to something like touch.sh so it isn't confused with the touch command. Goodluck,
Nate
welshpjw
29-03-2005, 21:00
can the "zabbix" user actuall get to that directory? Just as a test, change/move the script to /tmp/.
can the "zabbix" user actuall get to that directory? Just as a test, change/move the script to /tmp/.
If you do that. you have to change the AlertScriptsPath in server.conf. The path to media scripts defaults to /home/zabbix/bin/
hth
cooper
welshpjw
30-03-2005, 03:45
If you do that. you have to change the AlertScriptsPath in server.conf. The path to media scripts defaults to /home/zabbix/bin/
hth
cooper
It was just a quick guess. He seemed to note the perms were wide open and executable. I should have said something like: "as the user zabbix, manually see if the script works". I agree with a previous comment with regards to changing the "touch" to "touch.sh".
My next guess would be that the script needs an explicit sh-bang. As the VERY first line put something like "#!/bin/sh". Make sure to put EVERYTHING within the quotes. As a side note, you may want to explicitly provide the "/bin/touch" to check if you have a "$PATH" problem. Just some hints.
Atleast I've now learned about the AlertScriptsPath :D
My next guess would be that the script needs an explicit sh-bang. As the VERY first line put something like "#!/bin/sh".
I had that thought too.
Atleast I've now learned about the AlertScriptsPath :D
Isnt the F/OSS community a great place. I love to pick up new bits of info myself.
cooper
welshpjw
31-03-2005, 17:43
Now for the big question, did "rosa" find a "solution" yet :confused: :confused:
Rosa, please provide feedback...