Ad Widget

Collapse

Can't send email alert

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gbernardes
    Junior Member
    • Mar 2011
    • 22

    #1

    Can't send email alert

    I would like to create an action to send me an email when a host became unavailable.
    In a first try, I configured the default zabbix send mail option, but it didn´t work.
    And I saw within Google, Zabbix does not provide SMTP with authentication - please tell me if I am wrong with that.

    Then I tried to create a shell script to send the email.

    Running the following command using zabbix linux user ( su zabbix ) I can send the e-mail.
    #sh /etc/zabbix/scripts/scriptmail.sh "[email protected]" "Subject" "Mail body"
    Now dumpping the .sh file:
    #!/bin/bash
    echo "$3" > /etc/zabbix/scripts/tmp
    mail -s "$2" "$1" < /etc/zabbix/scripts/tmp

    At zabbix_server.conf file, I removed the comments from the following lines and now it´s just like this:
    AlertScriptsPath=/etc/zabbix/scripts/
    ExternalScripts=/etc/zabbix/scripts/

    I have added the script as media at the following path:

    Administration->Media Types->Create Media Type, selected Type:script and
    at Scriptname I put scriptmail.sh
    ( and then I also tried to fill Scriptname field using /etc/zabbix/script/scriptmail.sh instead of scriptmail.sh)

    So I defined a link from the script to 'admin' user and then created an action that calls up the script when the trigger is started.

    But, when the trigger is started up, nothing happens! No mail is sent!

    Is there anybody here to point me a clue? Or am I making something wrong?

    Attached files contains some screenshots of my current zabbix configurtion.
    Attached Files
  • gbernardes
    Junior Member
    • Mar 2011
    • 22

    #2
    Hi, I discovered something here: that my zabbix does not send any email because it´s not generating any notification. What am I doing wrong?
    Attached Files

    Comment

    • untergeek
      Senior Member
      Zabbix Certified Specialist
      • Jun 2009
      • 512

      #3
      Wow! This is my lucky day! I've given this response once already!

      Add a condition to your Action:

      Trigger value = PROBLEM

      That is needed or it would trigger on ANY status.

      Comment

      Working...