cacti failed to send email notifications.

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
romstation
Posts: 7
Joined: Thu Jun 21, 2018 12:36 pm

cacti failed to send email notifications.

Post by romstation »

Hello everyone,

I have an issue with my cacti server. Since one week, it can't send email notifications. I got this message in the logs:

- CMDPHP PHP ERROR NOTICE Backtrace: (/settings.php: 110 email_test)(/lib/functions.php: 3912 send_mail)(/lib/functions.php: 3480 mailer)(/lib/functions.php: 3783 send)(/include/phpmailer/class.phpmailer.php: 1213 postSend)(/include/phpmailer/class.phpmailer.php: 1335 smtpSend)(/include/phpmailer/class.phpmailer.php: 1540 smtpConnect)(/include/phpmailer/class.phpmailer.php: 1700 quit)(/include/phpmailer/class.smtp.php: 827 sendCommand)(/include/phpmailer/class.smtp.php: 885 client_send)(/include/phpmailer/class.smtp.php: 992 fwrite)(CactiErrorHandler)(/lib/functions.php: 4431 cacti_debug_backtrace)

- ERROR PHP NOTICE: fwrite(): send of 6 bytes failed with errno=32 Broken pipe in file: /usr/share/cacti/include/phpmailer/class.smtp.php on line: 992


-----------------------------------
I tried this configuration in the function.php file.

$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);

But no changes.

Can someone help me please ???
User avatar
camerabob
Cacti User
Posts: 386
Joined: Fri Feb 10, 2017 2:45 pm
Location: Long Island, New York, USA
Contact:

Re: cacti failed to send email notifications.

Post by camerabob »

Help others help you better. Please post the version of Cacti and the underlying OS it is running on.
Prod: Cacti 1.2.15 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Temp: Cacti 1.2.3 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Router Configs @ 1.3.4
Syslog Monitoring @ 2.1
Thold @ 1.2.4
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: cacti failed to send email notifications.

Post by netniV »

I would check that you are able to connect to the SMTP server in question. It tells you that there is a connectivity issue when attempting to connect to it. If you are using a local SMTP service make sure it's running. If you are going through a firewall, make sure it's allowed.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
romstation
Posts: 7
Joined: Thu Jun 21, 2018 12:36 pm

Re: cacti failed to send email notifications.

Post by romstation »

camerabob wrote:Help others help you better. Please post the version of Cacti and the underlying OS it is running on.
I'm using cacti 1.1.19 running on CentOS release 6.9
netniV wrote:I would check that you are able to connect to the SMTP server in question. It tells you that there is a connectivity issue when attempting to connect to it. If you are using a local SMTP service make sure it's running. If you are going through a firewall, make sure it's allowed.
I checked the connectivity with the mail server and it's ok. You can see below the result.

-----------------------------------------------------------------------------------------------------
[My server~]# telnet 172.21.55.12 25
Trying 172.21.55.12...
Connected to 172.21.55.12.
Escape character is '^]'.
220 webmail.mydomain.com Microsoft ESMTP MAIL Service ready at Wed, 25 Jul 2018 19:40:56 +0100
-----------------------------------------------------------------------------------------------------

Their is no firewall between my cacti server and the mail server.

The smtp service is running.

---------------------------------------------------------------------------------------------
[My server ~]# netstat -an | grep 25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 96 172.24.4.32:22 172.24.6.190:55259 ESTABLISHED
tcp 0 0 ::1:25 :::* LISTEN
---------------------------------------------------------------------------------------------

I successfully send an email from the cli, but cacti can't send me email notifications.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: cacti failed to send email notifications.

Post by netniV »

Have you used the Send a Test Email option within the settings? Can you post the results?

Also, as you are using an older version of Cacti, you may benefit from an upgrade as there have been some changes to the mailing code to handle things like TLS, etc.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
romstation
Posts: 7
Joined: Thu Jun 21, 2018 12:36 pm

Re: cacti failed to send email notifications.

Post by romstation »

Here is the result of a test email.
Attachments
cacti.png
cacti.png (10.87 KiB) Viewed 6938 times
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: cacti failed to send email notifications.

Post by netniV »

Hmm, my advise would be to update your version of Cacti. As I said before, we changed various functions relating to sending SMTP mails and even introduced a CLI program that would allow you to get more information on what is happened during the test.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
romstation
Posts: 7
Joined: Thu Jun 21, 2018 12:36 pm

Re: cacti failed to send email notifications.

Post by romstation »

Thanks for your help. I'll update my cacti version.
User avatar
camerabob
Cacti User
Posts: 386
Joined: Fri Feb 10, 2017 2:45 pm
Location: Long Island, New York, USA
Contact:

Re: cacti failed to send email notifications.

Post by camerabob »

I discovered in version 1.1.36 that the test function failed while notifications still went through. This occurred on one of my two servers, both with the same exact version.
Prod: Cacti 1.2.15 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Temp: Cacti 1.2.3 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Router Configs @ 1.3.4
Syslog Monitoring @ 2.1
Thold @ 1.2.4
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: cacti failed to send email notifications.

Post by netniV »

I recall that being fixed in later versions. Check the CHANGELOG on release 1.1.38.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
User avatar
camerabob
Cacti User
Posts: 386
Joined: Fri Feb 10, 2017 2:45 pm
Location: Long Island, New York, USA
Contact:

Re: cacti failed to send email notifications.

Post by camerabob »

The OP is/was on version 1.1.19.
Prod: Cacti 1.2.15 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

Temp: Cacti 1.2.3 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Router Configs @ 1.3.4
Syslog Monitoring @ 2.1
Thold @ 1.2.4
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: cacti failed to send email notifications.

Post by netniV »

Yes, but I was explaining to you that the bug you mentioned was subsequently fixed. I'm sure in a release before 1.2 but I know it definitely works for me and there's a cli package. My recommendation was to upgrade.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
aalberssen
Posts: 1
Joined: Wed Sep 23, 2020 8:07 pm

Re: cacti failed to send email notifications.

Post by aalberssen »

I have the latest version 2020 and mail system no working, I have tried most of the posted solutions online and nothing... :( i love cacti but... Is running on windows server.....
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests