Ad Widget

Collapse

Media script is logged sent but not executed!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shahinism
    Junior Member
    • Mar 2016
    • 1

    #1

    Media script is logged sent but not executed!

    I have this script as a media script:
    Code:
    #!/bin/bash
    URL="${1}${2}"
    echo $URL
    
    echo $URL > /var/log/selfhealer.log
    echo "FINE" >> /var/log/selfhealer.log
    
    CMD="curl ${URL}"
    ssh [email protected] '${CMD}'
    Whenever an event happens that requires an action to this media type, it'll be logged as "sent/ok" in event's data, but none of those echos to selfhealer.log file will not happen and I can't get the result of that ssh command.

    I've even added an "exit 1" command at the top of this script, but zabbix still reports it `sent` and completely ok! I've tried to use a wrong script name in media type definition, and zabbix understood it and reported it correctly for "no such file or directory".

    It seems zabbix is finding the script and it's path, but it is not executing it... The script's permission is 777 here.
    Last edited by shahinism; 30-03-2016, 11:35.
  • tsoomo
    Junior Member
    • Aug 2016
    • 2

    #2
    Same here

    I've faced this problem on my ZABBIX. Also I wrote following simple script and
    Code:
    #!/bin/bash
    
    /bin/echo "PRINT ME" >> /root/tes.sh.txt
    this one is also not doing anything.

    Comment

    • GPegel
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2015
      • 113

      #3
      Try to execute this in bash:

      Code:
      $ setfacl -R -m u:zabbix:r-x /var/log/
      I tried to monitor some logfiles on my Zabbix server and I needed to execute this command to get the data available for Zabbix.

      Comment

      Working...