Welcome to Pandora FMS Community!

Find answers, ask questions, and connect with our community around the world.

Welcome to Pandora FMS Community Forums Community support Advanced troubleshooting Attemtping to get gmail email server working with pandora

  • Attemtping to get gmail email server working with pandora

    Posted by opike on August 3, 2011 at 23:00

    I had originally opened a thread for this issue back in January:
    http://openideas.info/smf/index.php/topic,2438.0.html
    but it’s been over 120 days since a reply has been made on that thread so the forum software suggested I open a new thread.  I was getting by with a different mail server since January but I no longer have access to that server so now I’m back to trying to use the gmail smtp server, with which I’m still having issues.

    Regardless of what configuration I try, I get the following error message in /var/log/pandora/pandora_server.log:
    2011-08-03 10:49:23 ubuntu [V1] [ERROR] Sending email to [email protected] with subject [PANDORA] Alert from agent ubuntu on module perl ping hpdekstop

    Here is how I think the mail server settings should be set up in pandora_server.conf:

    mta_address smtp.gmail.com
    
    # mta_port: MTA port (default 25)
    mta_port 587
    
    # mta_user MTA User (if needed for auth, FQD or simple user, depending on your server)
    mta_user hastapasta99
    
    # mta_pass MTA Pass (if needed for auth)
    mta_pass xxxxxxxx
    
    # mta_auth MTA Auth system (if needed, support: LOGIN, PLAIN, CRAM-MD5, DIGEST-MD)
    mta_auth LOGIN

    I tried all of the Auth system options but I still get the same error.

    I have a java program that successfully uses the same gmail server for sending emails. Here’s part of the java code:

    String username = "hastapasta99";
    String password = "xxxxxxx";
    
    Properties props = new Properties();
    props.put("mail.smtp.port","587");
    props.put("mail.smtp.host", "smtp.gmail.com");
    props.put("mail.smtp.auth", "true");
    props.put("mail.smtp.starttls.enable", "true");
    props.put("mail.debug", "false");
    	  	
    /*
     * Setting these timeout values since sending mail sometimes hangs.
    */
    props.put("mail.smtp.timeout", 60000);
    props.put("mail.smtp.connectiontimeout", 60000);
    
    
    //Session session = Session.getInstance(props);
    Session session = Session.getInstance(props,new MyPasswordAuthenticator(username, password));

    I’m able to successfully telnet to smtp.gmail.com on port 587 from the box running pandora server so it’s not a network connection or firewall issue (I have the firewall completely disabled).

    I’m using pandora FMS version 3.2 on ubuntu.

    sfks replied 11 years, 7 months ago 12 Members · 12 Replies
  • 12 Replies
  • tpalacios

    Member
    August 4, 2011 at 14:34
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Greetings.

    I had originally opened a thread for this issue back in January:
    http://openideas.info/smf/index.php/topic,2438.0.html
    but it’s been over 120 days since a reply has been made on that thread so the forum software suggested I open a new thread.

    My deepest regrets for that awful delay then. 😉

    This kind of threads are starting to get on my nerves (not cause of you :P) because you’re not the first one, and I doubt you’ll be the last one who reports about this “external mta problem”.

    This is because I’m having a bad time trying to find out where’s the problem in your case, because our team has already installed some Pandoras in our clients’ machines using external mta configurations in pandora_server.conf without any problems.

    I’ll keep searching about it and will get back to you ASAP.

  • alumbreras

    Member
    August 5, 2011 at 16:54
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hi opike

    you can try to create a new action implemented in java that the work of these .jar is to send an email alert. you can pass the subject and the body of the email by parameter in the jar.

    sorry for my english ;), i hope that you understand me.

  • cwmoser

    Member
    August 20, 2011 at 14:28
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    How do you enable SSL or TLS in Pandora?
    All I can find that Pandora supports are LOGIN, PLAIN, CRAM-MD5, and DIGEST-MD.

    SSL or TLS is required to use gmail.

    Carl

  • gbr

    Member
    September 5, 2011 at 17:44
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hello,

    This is how I have configured PandoraFMS to work with gmail (on Ubuntu):

    Modify Pandora config file.
    You can do this by executing the command:
    sudo nano /etc/pandora/pandora_server.conf

    Setup the mail settings:
    Because we have installed a local SMTP server, we only need to set up the connection to this mail server:

    # mta_address: External Mailer (MTA) IP Address to be used by Pandora FMS internal email capabilities
    mta_address localhost

    # mta_port: MTA port (default 25)
    #mta_port

    # mta_user MTA User (if needed for auth, FQD or simple user, depending on your server)
    #mta_user

    # mta_pass MTA Pass (if needed for auth)
    #mta_pass

    # mta_auth MTA Auth system (if needed, support: LOGIN, PLAIN, CRAM-MD5, DIGEST-MD)
    #mta_auth

    # mta_from Email address that sends the mail, by default is pandora@localhost
    #          probably you need to change it to avoid problems with your antispam
    mta_from Network Monitor Administrator

    Configure local mailserver EXIM4

    http://wiki.debian.org/GmailAndExim4

    Apply a filter, so the mails come from [email protected]
    Create a file by executing the command:
    sudo nano /etc/exim4/filter_reply_to
    with the following content:
    # Exim filter

    # Rewrite my reply to for any mail sent to [email protected]

    if
            $header_from: contains “Network Monitor Administrator”
    then
            headers remove “Reply-To”
            headers add “Reply-To: [email protected]
            headers add “From: [email protected]
    endif

    # Forward any mail sent to root

    if
            $header_to: contains “root”
    then
            headers remove “Reply-To”
            headers add “Reply-To: [email protected]
            headers remove “To”
            headers add “To: [email protected]
            deliver “[email protected]
    endif

    Adjust also the exim4 config file:
    sudo nano /etc/exim4/exim4.conf.template
    Add here the line
    system_filter = /etc/exim4/filter_reply_to
    And restart now the mail service:
    sudo service exim4 restart

    If you have problems with sending mails, you can check the logs:
    sudo tail /var/log/mail.log

    Greetings,

    Geert

  • manu

    Member
    September 9, 2011 at 12:47
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Hi,

    What happens if you run: echo “body test” | mail -s “test” [email protected]

    Do you get the email?

  • rich-anderson

    Member
    October 11, 2011 at 23:48
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Thank you.  Following the gmail instructions for our local MTA fixed an issue we were having.

  • fadosani

    Member
    October 18, 2011 at 15:43
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    seems to be a very valuable information. thanks to all

  • Chuck

    Member
    November 13, 2012 at 03:04
    1 Karma
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    If I am understanding this tread, Pandora does not support TLS for SMTP without third party intervention.

    Is this correct? If so are there plans to correct this issue?

    I like the system but email alerts are the heart of my effort.

  • Sancho

    Administrator
    January 30, 2013 at 05:04
    2285 Karma points
    Community awards: bulb Bright ideas
    Community rank: tentacle_master_icon Tentacle Master
    Like it
    Up
    0
    Down
    Drop it
    ::

    If I am understanding this tread, Pandora does not support TLS for SMTP without third party intervention.

    Is this correct? If so are there plans to correct this issue?

    I like the system but email alerts are the heart of my effort.

    Pandora supports any kind of SMTP auth since 4.0, in 3.2.1 depends on sendmail library of your system, since 4.0 comes with its own library to avoid that problem. If doesnt work, just check your setup in pandora_server.conf.

  • sfks

    Member
    June 13, 2013 at 16:41
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Pandora supports any kind of SMTP auth since 4.0, in 3.2.1 depends on sendmail library of your system, since 4.0 comes with its own library to avoid that problem. If doesnt work, just check your setup in pandora_server.conf.

    Dear Sancho,

    I’m using Pandora FMS 4.0.3, trying to configure mta through gmail (not with postfix), with no luck.

    If it supports any kind of SMTP auth, would you please give us a configuration example for gmail smtp server?

    I’ve tried:

    mta_address smtp.gmail.com
    mta_port 587
    mta_user [email protected]
    mta_pass XXXX
    mta_auth LOGIN
    mta_from Pandora FMS 
    
    mta_address smtp.gmail.com
    mta_port 587
    mta_user [email protected]
    mta_pass XXXX
    mta_auth SSL
    mta_from Pandora FMS 
    
    mta_address smtp.gmail.com
    mta_port 587
    mta_user [email protected]
    mta_pass XXXX
    mta_auth TLS
    mta_from Pandora FMS 
    

    And I always receive this in the log file:

    2013-06-13 12:27:43 vmPandora [V1] [ERROR] Sending email to [email protected] with subject …..

    Two days around this issue, and nothing. Please help me.

    Thanks in advance.

  • Mario

    Administrator
    June 13, 2013 at 17:26
    1150 Karma points
    Community rank: tentacle_master_icon Tentacle Master
  • sfks

    Member
    June 14, 2013 at 11:15
    0 Karma points
    Community rank: tentacle-noob-1 Tentacle noob
    Like it
    Up
    0
    Down
    Drop it
    ::

    Check this link:
    http://www.openideas.info/wiki/index.php?title=Pandora:Configuration_emails_alerts

    Thank you Mario. I had already checked before. It explains how to do it, but using postfix.

    If, as Sancho says, Pandora is capable to send mails through any kind of smtp server, I would like to know how to make it work with gmail smtp server. Using gmail or google apps is pretty usual in many organizations, and it would be great to have an example, since I can’t find any working and tested configuration of pandora_server.conf for this scenario, and, obviously, I could not find out by myself how to make it work.

    Thanks in advance.

    Regards,