cacti failed to send email notifications.

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

Moderators: Moderators, Developers

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

cacti failed to send email notifications.

#1 Post by romstation » Mon Jul 23, 2018 12:27 pm

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: 275
Joined: Fri Feb 10, 2017 2:45 pm
Location: Long Island, New York, USA
Contact:

Re: cacti failed to send email notifications.

#2 Post by camerabob » Tue Jul 24, 2018 8:38 am

Help others help you better. Please post the version of Cacti and the underlying OS it is running on.
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.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

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

netniV
Cacti Guru User
Posts: 2666
Joined: Sun Aug 27, 2017 12:05 am

Re: cacti failed to send email notifications.

#3 Post by netniV » Tue Jul 24, 2018 10:41 am

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.

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

Re: cacti failed to send email notifications.

#4 Post by romstation » Wed Jul 25, 2018 2:24 pm

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: 2666
Joined: Sun Aug 27, 2017 12:05 am

Re: cacti failed to send email notifications.

#5 Post by netniV » Thu Jul 26, 2018 3:16 am

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.

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

Re: cacti failed to send email notifications.

#6 Post by romstation » Thu Jul 26, 2018 4:17 am

Here is the result of a test email.
Attachments
cacti.png
cacti.png (10.87 KiB) Viewed 789 times

netniV
Cacti Guru User
Posts: 2666
Joined: Sun Aug 27, 2017 12:05 am

Re: cacti failed to send email notifications.

#7 Post by netniV » Thu Jul 26, 2018 5:59 am

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.

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

Re: cacti failed to send email notifications.

#8 Post by romstation » Thu Jul 26, 2018 6:21 am

Thanks for your help. I'll update my cacti version.

User avatar
camerabob
Cacti User
Posts: 275
Joined: Fri Feb 10, 2017 2:45 pm
Location: Long Island, New York, USA
Contact:

Re: cacti failed to send email notifications.

#9 Post by camerabob » Thu Jul 26, 2018 8:19 am

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.
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.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

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

netniV
Cacti Guru User
Posts: 2666
Joined: Sun Aug 27, 2017 12:05 am

Re: cacti failed to send email notifications.

#10 Post by netniV » Thu Jul 26, 2018 8:20 am

I recall that being fixed in later versions. Check the CHANGELOG on release 1.1.38.

User avatar
camerabob
Cacti User
Posts: 275
Joined: Fri Feb 10, 2017 2:45 pm
Location: Long Island, New York, USA
Contact:

Re: cacti failed to send email notifications.

#11 Post by camerabob » Thu Jul 26, 2018 1:48 pm

The OP is/was on version 1.1.19.
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.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4

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

netniV
Cacti Guru User
Posts: 2666
Joined: Sun Aug 27, 2017 12:05 am

Re: cacti failed to send email notifications.

#12 Post by netniV » Thu Jul 26, 2018 5:23 pm

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.

Post Reply