Ad Widget

Collapse

Problems with an alert script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rcarlos007
    Junior Member
    • Jan 2015
    • 1

    #1

    Problems with an alert script

    Hi there !

    I have made all the steps to configure zabbix to execute an alert script (message.sh) when a "trigger" has been "triggered", but the script doesn't work.

    message.sh ( located at /usr/lib/zabbix/alertscripts/ )
    Code:
    #!/bin/bash
    to=$1
    subject=$2
    body=$3
    echo $to >> data.txt
    echo $subject >> data.txt
    echo $body >> data.txt
    echo "hello world" >> data.txt
    And when i see in the log action section, the message is marked as sent, or executed. But, when a type: cat data.txt the file is empty.

    What i'am doing wrong?
    Last edited by rcarlos007; 08-01-2015, 02:16.
  • kjetil_maland
    Junior Member
    • Sep 2014
    • 11

    #2
    Could be access rights to the file for the zabbix process.

    check owner and group access.

    And for testing purposes setting chmod 7777 on the file. if that solves the issue you know it is the access that is causing your problem.

    Comment

    Working...