Ad Widget

Collapse

Trouble executing Script media Type

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jhall
    Junior Member
    • Sep 2009
    • 2

    #1

    Trouble executing Script media Type

    I'm trying to get a very basic script run from an Action.

    I think I have everything set up correctly. I created a new media type with script which has the name as 'zabbix_script.sh'. I have my user set up with this media type as well as a Jabber media type.

    When I bring down a service (ie httpd) The action is triggered and I get a jabber with the details. I see in the zabbix_server.log the message

    Error executing [/tmp/zabbix_script.sh] [No such file or directory]

    This is where I currently have the script. I have been testing moving it around changing permissions etc. I am running zabbix on fedora 10 installed via yum. The rpm installation created a zabbix user with no login so I cannot su to zabbix to test if I can run the script under zabbix.

    The file does exist in this location.

    -rwxr-xr-x 1 zabbix 76 Sep 1 12:19 zabbix_script.sh

    Seems like this should be super simple but I cannot get it to find the script. At one point when it was in the default location for the installation (/var/lib/zabbix) the log showed a permission denied instead of not found. Then I changed the owner to zabbix and made sure it had x and started getting the error above.

    Can anyone point me in the right direction?

    Let me know of any other details I can provide to help.
    Last edited by jhall; 01-09-2009, 19:34. Reason: mistype of title
  • jhall
    Junior Member
    • Sep 2009
    • 2

    #2
    Ok nevermind. After spending hours struggling with this 2 minutes after I post I figure it out.

    The error was a little misleading.

    I had been testing running the script with a straigh >sh zabbix_script.sh

    I changed to do >./zabbix_script.sh and found that it had a bad interpreter my bash was in the wrong place. This lead to the error message I was receiving.
    Chaning the location of bash in the script fixed it. So it actually was finding/running the script all along.

    Comment

    Working...