Ad Widget

Collapse

Zabbix gmail notification with postfix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Thyagaraj
    Junior Member
    • Aug 2010
    • 12

    #1

    Zabbix gmail notification with postfix

    How to perfectly configure zabbix gmail notification with postfix(relay to gmail)
    Actually this setup is working on my local machine but when I try to implement this on my real servers, email notification is failed and I could see the following error in audit

    Cannot connect to SMTP server [localhost] [gethost() failed for address 'localhost' [Success]]

    my /var/log/mail.log message

    Aug 26 00:14:31 station1 postfix/smtpd[9385]: connect from localhost.localdomain[127.0.0.1]
    Aug 26 00:14:31 station1 postfix/smtpd[9385]: disconnect from localhost.localdomain[127.0.0.1]
    Aug 26 00:15:31 station1 postfix/smtpd[9385]: connect from localhost.localdomain[127.0.0.1]
    Aug 26 00:15:31 station1 postfix/smtpd[9385]: disconnect from localhost.localdomain[127.0.0.1]


    Thanks all!
  • mercy
    Junior Member
    • Mar 2006
    • 14

    #2
    Smtp server is runnig correctly?

    try
    Code:
    telnet localhost 25
    helo yourdomain
    mail from: <>
    rcpt to: <[email protected]>
    data
    Enter message here
    .
    exit

    Comment

    • Thyagaraj
      Junior Member
      • Aug 2010
      • 12

      #3
      When I use telnet command on ubuntu, I'm getting following error:

      -bash: /usr/bin/telnet: No such file or directory

      Regarding this I posted in ubuntu forum and i'm asked to remove telnetd and install only telnet client(telnet). I did as it is said but no change with same problem as above.

      Comment

      • mattsmith
        Member
        Zabbix Certified Specialist
        • Aug 2010
        • 33

        #4
        This is a link that i used last week, we use postfix to relay mails to google on our ec2 servers.



        Hope this helps
        Matt

        Comment

        • Thyagaraj
          Junior Member
          • Aug 2010
          • 12

          #5
          Now my smtp is working fine(checked telnet localhost 25) and I could send mail from command line like this 'mail -s "hello" [email protected]. But i'm getting the same above posted error in the Audit>Actions.
          This is my media settings and this is the same settings which is working on my local machine

          Media
          Description:
          Type E-mail
          SMTP server: localhost
          SMTP helo: localhost
          SMTP email: root@localhost

          Comment

          • Thyagaraj
            Junior Member
            • Aug 2010
            • 12

            #6
            Zabbix E-mail notification error(audit->actions):

            Cannot connect to SMTP server [localhost] [gethost() failed for address 'localhost' [Success]]

            Comment

            • walterheck
              Senior Member
              • Jul 2009
              • 153

              #7
              You probably need to customise the helo name to a domain that is accepted by postfix. The actual hostname of the machine usually works. Besides that, it's better to change the SMTP email address to some address in your domain, like [email protected]
              Free and Open Source Zabbix Templates Repository | Hosted Zabbix @ Tribily (http://tribily.com)

              Comment

              • Thyagaraj
                Junior Member
                • Aug 2010
                • 12

                #8
                Is there any way so that I force zabbix to send email immediately?.

                Comment

                • Thyagaraj
                  Junior Member
                  • Aug 2010
                  • 12

                  #9
                  Here are my settings.


                  /etc/hosts:

                  127.0.0.1 localhost.localdomain localhost
                  <my-ip-here> station1.lab.mycompany.com station1



                  /etc/zabbix/zabbix_agentd.conf:

                  # Default:
                  # Server=

                  Server=127.0.0.1

                  ### Option: Hostname
                  # Unique, case sensitive hostname.
                  # Required for active checks and must match hostname as configured on the server.
                  #
                  # Default:
                  # Hostname=system.uname

                  Hostname=Zabbix server

                  ### Option: ListenPort
                  # Agent will listen on this port for connections from the server.
                  #
                  # Mandatory: no
                  # Range: 1024-32767
                  # Default:
                  # ListenPort=10050



                  /etc/zabbix/zabbix_agent.conf:

                  # This is a config file for zabbix_agent
                  # To get more information about Zabbix visit http://www.zabbix.com

                  ### Option: Server
                  # IP address of Zabbix server
                  # Connections from other hosts will be denied
                  # If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally.
                  #
                  # Mandatory: yes
                  # Default:
                  # Server=

                  Server=127.0.0.1

                  ### Option: Timeout
                  # Spend no more than Timeout seconds on processing
                  #
                  # Mandatory: no
                  # Range: 1-30
                  # Default:
                  # Timeout=3




                  Hostname:
                  root@station1:~#hostname
                  station1.lab.mycompany.com

                  Comment

                  • Thyagaraj
                    Junior Member
                    • Aug 2010
                    • 12

                    #10
                    Please anyone put an end to this issue.

                    Comment

                    Working...