Ad Widget

Collapse

script to email with SMTP authenticated

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rcpapi
    Junior Member
    • May 2011
    • 11

    #1

    script to email with SMTP authenticated

    Hi,
    I am trying to configure zabbix to send mail on a server that requires smtp authentication.

    Looking at the file zabbix_server.log found that when the zabbix try to send an email via script it displays the following error:
    Error executing [/etc/zabbix/scripts//zabbix_sendemail.sh] [Exec format error]

    Anyone know what can be? When I run the script from the command line works. Below is the script.
    #!/bin/bash
    export smtpemailfrom=monitoracao@dominio
    export zabbixemailto="$1"
    export zabbixsubject="$2"
    export zabbixbody="$3"
    export smtpserver="smtp.dominio"
    export smtplogin=monitoracao@dominio
    export smtppass=*****
    export smtpauth="tls=yes"
    export smtplog=/tmp/zabbix_sendmail.log

    /usr/bin/sendEmail -f $smtpemailfrom -t $zabbixemailto -u $zabbixsubject -m $zabbixbody -s $smtpserver -o $smtpauth -xu $smtplogin -xp $smtppass -l $smtplog

    Thanks,

    Raphael
  • Davidus
    Senior Member
    • Dec 2010
    • 281

    #2
    Make sure that you bash script is executable;
    where do you place this script?

    Comment

    • rcpapi
      Junior Member
      • May 2011
      • 11

      #3
      /etc/zabbiz/scripts.

      when I change the User's permission in the script, the log zabbix changes to the permission denied error, or is he looking in the right place with permission. The script is right?

      Comment

      • Davidus
        Senior Member
        • Dec 2010
        • 281

        #4
        The default directory where zabbix server is tiring to hookup scripts is
        # AlertScriptsPath=/home/zabbix/bin
        did you changed AlertScriptsPath in your zabbix_server.conf

        Make script executable for all users

        Comment

        Working...