Ad Widget

Collapse

Script media failure

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rosa
    Junior Member
    • Jan 2005
    • 1

    #1

    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
    Senior Member
    • Feb 2005
    • 141

    #2
    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

    Comment

    • welshpjw
      Member
      • Mar 2005
      • 50

      #3
      can the "zabbix" user actuall get to that directory? Just as a test, change/move the script to /tmp/.

      Comment

      • cooper
        Senior Member
        • Sep 2004
        • 110

        #4
        Originally posted by welshpjw
        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

        Comment

        • welshpjw
          Member
          • Mar 2005
          • 50

          #5
          Originally posted by cooper
          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

          Comment

          • cooper
            Senior Member
            • Sep 2004
            • 110

            #6
            Originally posted by welshpjw
            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.
            Originally posted by welshpjw
            Atleast I've now learned about the AlertScriptsPath
            Isnt the F/OSS community a great place. I love to pick up new bits of info myself.

            cooper

            Comment

            • welshpjw
              Member
              • Mar 2005
              • 50

              #7
              Now for the big question, did "rosa" find a "solution" yet

              Rosa, please provide feedback...

              Comment

              Working...