Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Thu May 23, 2019 4:07 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: THOLD ERROR: Sending Email Failed. Error was SMTP connect()
PostPosted: Mon Apr 09, 2018 6:58 pm 
Offline

Joined: Mon Apr 09, 2018 6:52 pm
Posts: 3
Guys, good night.
I configured Cacti 1.1.37 to send mail in the settings tab - mail / reporting / dns and /thresholds but it gives an error and does not send the email notifying that the host is offline or when it came back online.
I already consulted PHPMailer but I do not know where to configure it.
Can someone help me?
My Settings:

Mail Services SMTP
Ping Mail Server Yes
From Email Address myemai[email protected]
From Name Cacti Server Monitor
Word Wrap 120
SMTP Hostname smtp.gmail.com
SMTP Port 465
SMTP Username myemail
SMTP Password ****
SMTP Security SSL
SMTP Timeout 10

Thank you.


Top
 Profile  
 
 Post subject: Re: THOLD ERROR: Sending Email Failed. Error was SMTP connec
PostPosted: Thu Apr 12, 2018 7:30 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2474
Try using the test program I posted : https://forums.cacti.net/viewtopic.php?p=272027#p272027

You'll have to rename from .txt to .php.

That will give you a lot more information about what is occurring.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: THOLD ERROR: Sending Email Failed. Error was SMTP connec
PostPosted: Wed Apr 18, 2018 8:56 pm 
Offline

Joined: Mon Apr 09, 2018 6:52 pm
Posts: 3
Good Evening,
I ran the file "test_mail.php" and showed these errors:

[email protected]:/var/www/html/include# php test_mail.php
Checking Configuration...Method: SMTP
Ping Results: Bypassed
Sending Message...2018-04-19 01:54:08 Connection: opening to ssl://smtp.gmail.com:465, timeout=10, options=array (
)
2018-04-19 01:54:09 Connection failed. Error #2: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed [/var/www/html/include/phpmailer/class.smtp.php line 298]
2018-04-19 01:54:09 Connection failed. Error #2: stream_socket_client(): Failed to enable crypto [/var/www/html/include/phpmailer/class.smtp.php line 298]
2018-04-19 01:54:09 Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Unknown error) [/var/www/html/include/phpmailer/class.smtp.php line 298]
2018-04-19 01:54:09 SMTP ERROR: Failed to connect to server: (0)
2018-04-19 01:54:09 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Result: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Thanks...


Top
 Profile  
 
 Post subject: Re: THOLD ERROR: Sending Email Failed. Error was SMTP connec
PostPosted: Thu Apr 19, 2018 2:37 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2474
So that basically means you need to enable the SSL/Crypto libraries within PHP. WIthout those, it won't be able to talk properly to gmail.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: THOLD ERROR: Sending Email Failed. Error was SMTP connec
PostPosted: Thu Apr 19, 2018 3:00 am 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2474
Actually, I take that back I reckon it's down to your ISP redirecting the SMTP traffic from gmail to their own servers.

GMail wouldn't have an invalid certificate. As long as you have openssl enabled in both the cli and apache/ngix PHP configuration files then it should work properly as is.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: THOLD ERROR: Sending Email Failed. Error was SMTP connec
PostPosted: Thu Apr 19, 2018 7:15 am 
Offline
Cacti User
User avatar

Joined: Fri Feb 10, 2017 2:45 pm
Posts: 237
Location: Long Island, New York, USA
See the fourth post in the linked thread: https://forums.cacti.net/viewtopic.php?f=21&t=58573

There it boiled down to the ISP (Verizon) not allowing mail from any server other than their own. Other ISPs may have adopted the same policy to avoid email UBE (Unsolicited Bulk Email) issues.

_________________
See the Cacti 1.x templates I use at: http://www.camerabob.com/cacti

Live: Cacti 1.2.3 @ CentOS 7-6.1810.2.el7 & PHP 5.4.16-46.e17
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Test: Cacti 1.2.3 @ CentOS 7-6.1810.2.el7 & PHP 5.4.45-17.e17.remi
Maint @ 1.2
Monitor @ 2.3.4
Thold @ 1.0.4


Top
 Profile  
 
 Post subject: Re: THOLD ERROR: Sending Email Failed. Error was SMTP connec
PostPosted: Sun Apr 22, 2018 8:59 pm 
Offline

Joined: Mon Apr 09, 2018 6:52 pm
Posts: 3
Guys, no is problem of server Gmail, I tested in server smtp of Outlook and in server smtp Yahoo, same error, See:

[email protected]:/usr/share/cacti/site/include# php test_mail.php
Checking Configuration...Method: SMTP
Ping Results: Bypassed
Sending Message...2018-04-23 01:48:29 Connection: opening to smtp.mail.yahoo.com:587, timeout=10, options=array (
)
2018-04-23 01:48:29 Connection: opened
2018-04-23 01:48:29 SERVER -> CLIENT: 220 smtp.mail.yahoo.com ESMTP ready
2018-04-23 01:48:29 CLIENT -> SERVER: EHLO CACTI-SERVER1
2018-04-23 01:48:30 SERVER -> CLIENT: 250-smtp419.mail.ir2.yahoo.com Hello CACTI-SERVER1 [177.97.253.47])
250-PIPELINING
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-SIZE 41697280
250 STARTTLS
2018-04-23 01:48:30 CLIENT -> SERVER: STARTTLS
2018-04-23 01:48:30 SERVER -> CLIENT: 220 2.0.0 Ready to start TLS
2018-04-23 01:48:31 Connection failed. Error #2: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed [/usr/share/cacti/site/include/phpmailer/class.smtp.php line 374]
2018-04-23 01:48:31 SMTP Error: Could not connect to SMTP host.
2018-04-23 01:48:31 CLIENT -> SERVER: QUIT
2018-04-23 01:48:31 Connection failed. Error #8: fwrite(): send of 6 bytes failed with errno=32 Broken pipe [/usr/share/cacti/site/include/phpmailer/class.smtp.php line 999]
2018-04-23 01:48:31 SERVER -> CLIENT: ,


What do I do to solve it?

Thank you.


Top
 Profile  
 
 Post subject: Re: THOLD ERROR: Sending Email Failed. Error was SMTP connec
PostPosted: Sun Apr 22, 2018 9:51 pm 
Offline
Cacti User
User avatar

Joined: Fri Feb 10, 2017 2:45 pm
Posts: 237
Location: Long Island, New York, USA
Does your email client work sending email with any of those mailboxes? If it does work, did you match those settings exactly?

_________________
See the Cacti 1.x templates I use at: http://www.camerabob.com/cacti

Live: Cacti 1.2.3 @ CentOS 7-6.1810.2.el7 & PHP 5.4.16-46.e17
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Test: Cacti 1.2.3 @ CentOS 7-6.1810.2.el7 & PHP 5.4.45-17.e17.remi
Maint @ 1.2
Monitor @ 2.3.4
Thold @ 1.0.4


Top
 Profile  
 
 Post subject: Re: THOLD ERROR: Sending Email Failed. Error was SMTP connec
PostPosted: Tue Apr 24, 2018 12:21 pm 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2474
It sounds like what we have already said. Your ISP is blocking the outgoing smtp connection. Contact them to verify this.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group