Ad Widget

Collapse

Blank Zabbix Email Alert

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kind
    Junior Member
    • Jul 2013
    • 2

    #1

    Blank Zabbix Email Alert

    Hi Im very new to Zabbix, I've Managed to make zabbix email alert using msmtp however whenever it sends a notification its blank doesn't have any content on it.

    please enlighten me i followed this http://dev.aperto.fr/projects/3/wiki..._notifications

    # account zabbix
    # host smtp.example.org
    # from [email protected]
    #
    # advanced account setup (authentication + TLS on Gmail)
    # ------------------------------------------------------
    # account zabbix
    # tls on
    # tls_starttls on
    # tls_trust_file /etc/ssl/certs/ca-certificates.crt
    # host smtp.gmail.com
    # port 587
    # auth on
    # from [email protected]
    # user [email protected]
    # password ***********
    #
    # (from, user and password should be replaced with real values).
    #
    # Dependencies
    # It needs msmtp utility
    # On Debian and Ubuntu:
    # apt-get install msmtp
    #
    ################################################## ##############################
    DEBUG=0
    if [ $DEBUG -gt 0 ]
    then
    exec 2>>/tmp/zext_msmtp.log
    set -x
    fi
    # Default parameters
    FROM='myemail@mydomain'
    MSMTP_ACCOUNT='zabbix'

    # Parameters (as passed by Zabbix):
    # $1 : Recipient
    # $2 : Subject
    # $3 : Message
    recipient=$1
    subject=$2
    message=$3

    date=`date --rfc-2822`

    # Replace linefeeds (LF) with CRLF and send message
    #sed 's/$/\r/' <<EOF | msmtp zabbix $MSMTP_ACCOUNT $recipient
    #From: <$FROM>
    #To: <>
    #Subject: $subject
    #Date: $date
    #$message
    #EOF

    sed 's/$/\r/' <<EOF | msmtp --account zabbix myemail@mydomain
    From: zabbixmonitoring
    To: everyone
    Subject:
    $Message

    EOF


    TIA!
  • mesika
    Junior Member
    • Jul 2013
    • 1

    #2
    It seems that you're using capital M for the variable name.
    Try to change it into $message instead of $Message.

    Comment

    • kind
      Junior Member
      • Jul 2013
      • 2

      #3
      @mesika

      Thanks it did work lol... THANKS! however the message notification shows like this?

      1. System uptime (Zabbix server:system.uptime): 00:19:49 2. *UNKNOWN* (*UNKNOWN*:*UNKNOWN*): *UNKNOWN* 3. *UNKNOWN* (*UNKNOWN*:*UNKNOWN*): *UNKNOWN*

      1. Status of Port Gi0/09 (TESTROUTER:IfOperStatus.10109): 1 2. *UNKNOWN* (*UNKNOWN*:*UNKNOWN*): *UNKNOWN* 3. *UNKNOWN* (*UNKNOWN*:*UNKNOWN*): *UNKNOWN*

      Im missing something right?

      Comment

      Working...