Ad Widget

Collapse

Zabbix 3.2 Not running a Script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Beveridge
    Member
    • Sep 2016
    • 30

    #1

    Zabbix 3.2 Not running a Script

    First of all, I am very much new to linux and zabbix, so I apologize in advance.

    We have tried a slack integration and I cannot seem to get it to work

    If I run this script manually, it works like a charm. I just cannot get Zabbix to call it.

    We have followed this page https://github.com/ericoc/zabbix-slack-alertscript

    I turned the debug level to 5 in /etc/zabbix/zabbix_server.conf and restarted the zabbix server service to make it work

    I then did a tail | grep on /var/log/zabbix/zabbix_server.log and nothing is showing up for the script name. Not sure if that is the right log to look at.

    The name of the script is slack.sh
    The perms are currently 777 (were 755 initially) on the file
    the directory the script is in is /usr/lib/zabbix/alertscripts (also have it in /usr/local/share/zabbix/alertscripts in case)
    Zabbix conf file points the alertscript directory to /usr/lib/zabbix/alertscripts

    When my colleague initially created the zabbix server, zabbix was a nologin system account, it is now bin/bash as I read that the account that runs the zabbix-server.service needs to be able to run the script, but still no dice.

    So my questions are

    1) am I looking at the right log?

    2) is my alert set up properly. Below are screen shots of my settings





    Odds are there is something fairly obvious here, again sorry for the newbie questions
    Last edited by Beveridge; 18-10-2016, 22:25.
  • nobodysu
    Member
    • Sep 2016
    • 84

    #2
    Is it even running? Add something like
    echo `date` "$1" >> /tmp/zabbix-slack-alertscript.log
    echo `date` "$2" >> /tmp/zabbix-slack-alertscript.log
    to the script.

    Replace curl binary with its full path
    which curl
    returns it.

    Thats all I can think of, can't see the images.

    Comment

    • paul92
      Junior Member
      • Oct 2016
      • 8

      #3
      I also had problems with the scripts....
      I´ve tried a lot of different scripts with phyton, ssmtp and some other but not even one worked properly...
      if you want to get email notifications i would recommend you to set up the email notification via gmail. It´s really easy! if you don´t know how just ask i can help =)

      Comment

      • Beveridge
        Member
        • Sep 2016
        • 30

        #4
        mail notifications work great. But since slack is our main form of communication it has been requested an obscene amount of times

        Comment

        • Beveridge
          Member
          • Sep 2016
          • 30

          #5
          Thank you @nobodysu I added the echo to the file and verified that is is not launching the script when the alerts are triggered (no log file is created). I ran the script manually and it creates it.

          Sorry for my unix noobness, but I did not understand

          "Replace curl binary with its full path which curl returns it."

          The only curl thing i saw in the script was

          curl -m 5 --data-urlencode "${payload}" $url -A 'zabbix-slack-alertscript / https://github.com/ericoc/zabbix-slack-alertscript'

          And I am not sure what I am suppose to full path

          Comment

          • nobodysu
            Member
            • Sep 2016
            • 84

            #6
            please provide output of commands:
            Code:
            which curl
            and
            Code:
            echo $PATH
            And you didn't specify the OS server is running on. Is it installed from packages or by compiling? Also I can't see the images, only small thumbnails.

            Comment

            • burn1024
              Member
              • Jun 2012
              • 52

              #7
              does it work when executed manualy from zabbix account as described in guthub readme?

              Comment

              • Beveridge
                Member
                • Sep 2016
                • 30

                #8
                Yes we were. The main issue was Zabbix wasn't running the script. We got it working, but before I post the solution I want to recreate it. Thank you for all who assisted on this thread

                Comment

                • andrewkendall
                  Junior Member
                  • Feb 2016
                  • 2

                  #9
                  Originally posted by Beveridge
                  Yes we were. The main issue was Zabbix wasn't running the script. We got it working, but before I post the solution I want to recreate it. Thank you for all who assisted on this thread
                  I'm using the same script and it has also stopped working since upgrading to 3.2. What was your solution?

                  Comment

                  • sugaretto
                    Junior Member
                    • Sep 2018
                    • 4

                    #10
                    Hi, so which was the solution of your issue?

                    Comment

                    Working...