Ad Widget

Collapse

Zabix send mail only for specific erro

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mcielavs
    Junior Member
    • Oct 2015
    • 5

    #1

    Zabix send mail only for specific erro

    Hello.
    I need to configure Zabbix sends e-mail only for specific errors that come from the event log .
    Trigger collects all data from the log aplications .
    I need to be sent by e-mail only after the field " source"
    Click image for larger version

Name:	zabbix.png
Views:	1
Size:	5.5 KB
ID:	317361

    Ideas how to do it?

    Thanks!
  • asmaa
    Junior Member
    • Aug 2015
    • 4

    #2
    I installed ssmtp and used mail command (after install mailutils on my server) to send emails using simple script

    I used the following URLs to install ssmtp and add the script on my alertscript path




    I used this script

    #!/bin/sh
    export zabbixemailto="$1"
    export zabbixsubject="$2"
    export zabbixbody="$3"
    echo "$zabbixbody" > /tmp/mymailinput
    mail --subject="$zabbixsubject" $zabbixemailto < /tmp/mymailinput
    rm /tmp/mymailinput

    then save it as zabbix-alerts.sh in my alertscript path

    then added this script as my media type

    then create the user that will receive emails and used this media type then configured the action and the emails send automatically

    if you want to receive special email for special error when you create the action , select the condition tab and select trigger value = problem (then add) and select the template (that is the source of trigger) by template = name (then add)

    Comment

    Working...