one new problem...

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Post Reply
lyon66
Posts: 5
Joined: Thu Jul 04, 2019 7:18 am

one new problem...

Post by lyon66 »

2019/07/05 17:39:03 - SYSTEM STATS: Time:1.2312 Method:cmd.php Processes:1 Threads:N/A Hosts:4 HostsPerProcess:4 DataSources:6 RRDsProcessed:4
2019/07/05 17:39:03 - THOLD ERROR: Sending Email Failed. Error was The following From address failed: Cacti@localhost : MAIL FROM command failed,2ee45d1f1ab7213-3c4bd Invalid Sender
,550,SMTP server error: MAIL FROM command failed Detail: 2ee45d1f1ab7213-3c4bd Invalid Sender
SMTP code: 550SMTP server error: MAIL FROM command failed Detail: 2ee45d1f1ab7213-3c4bd Invalid Sender
SMTP code: 550

How to figure this out? Thanks a lot!

cacti 1.1.19
thold 1.0.3
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: one new problem...

Post by cigamit »

Did you go into Settings >> Alerting / Thold and configure a Sender? There are also a few places to configure under Settings >> Mail/Reporting/DNS
lyon66
Posts: 5
Joined: Thu Jul 04, 2019 7:18 am

Re: one new problem...

Post by lyon66 »

cigamit wrote:Did you go into Settings >> Alerting / Thold and configure a Sender? There are also a few places to configure under Settings >> Mail/Reporting/DNS
I've set up both places, but I still can't send alarm mail.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: one new problem...

Post by netniV »

Do you see any entries in the cacti log as to why? If there are missing details, you should see a reason there. Otherwise, are you sure its being triggered?
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
hipsterdoofus
Cacti User
Posts: 87
Joined: Fri Mar 09, 2007 12:35 pm

Re: one new problem...

Post by hipsterdoofus »

Sorry for dredging up a semi-old problem, but I did not see an answer and am experiencing the same problem. I am running Cacti 1.2.8 on CentOS. This is a just updated install. I am running thold 1.3.2. In both the main settings as well as the thold settings, the from address is set correctly and is identical to each other. When I send a test email, it sends correctly, however, if I look under clog, it says:

2020/01/03 12:10:32 - THOLD ERROR: Sending Email Failed. Error was Invalid address: (From): Cacti@localhost

So from what I can tell, it seems that thold_functions.php is not pulling the $from_email, but that doesn't make sense as I would think a lot of people would be having issues. Any suggestions?
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: one new problem...

Post by cigamit »

Relevant code is at
https://github.com/Cacti/plugin_thold/b ... .php#L5266

If it as passed a $from_email (We generally don't pass one) to the function, it will use it.

Code: Select all

function thold_mail($to_email, $from_email, $subject, $message, $filename, $headers = array()) {
If not, it will check the thold setting.

Code: Select all

		$from_email = read_config_option('thold_from_email');
If the thold setting is blank, then it tries to figure out the server name and if it not, it just appends localhost

Code: Select all

			if (isset($_SERVER['HOSTNAME'])) {
				$from_email = 'Cacti@' . $_SERVER['HOSTNAME'];
			} else {
				$from_email = 'Cacti@localhost';
			}
So long story short, make sure the "Settings >> Alerting/Thold >> From Email Address" is set

Screenshot_1.jpg
Screenshot_1.jpg (19.02 KiB) Viewed 6847 times
hipsterdoofus
Cacti User
Posts: 87
Joined: Fri Mar 09, 2007 12:35 pm

Re: one new problem...

Post by hipsterdoofus »

cigamit wrote: Fri Jan 03, 2020 1:53 pm Relevant code is at
https://github.com/Cacti/plugin_thold/b ... .php#L5266

If it as passed a $from_email (We generally don't pass one) to the function, it will use it.

Code: Select all

function thold_mail($to_email, $from_email, $subject, $message, $filename, $headers = array()) {
If not, it will check the thold setting.

Code: Select all

		$from_email = read_config_option('thold_from_email');
If the thold setting is blank, then it tries to figure out the server name and if it not, it just appends localhost

Code: Select all

			if (isset($_SERVER['HOSTNAME'])) {
				$from_email = 'Cacti@' . $_SERVER['HOSTNAME'];
			} else {
				$from_email = 'Cacti@localhost';
			}
So long story short, make sure the "Settings >> Alerting/Thold >> From Email Address" is set


Screenshot_1.jpg

Yes, that's what is strange about this. My thold from email address is set the same as the global one. Test emails from the global setting page work, but thold seems to think that the from email address is blank then?
chrome_2020-01-03_13-22-27.png
chrome_2020-01-03_13-22-27.png (4.54 KiB) Viewed 6844 times
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: one new problem...

Post by cigamit »

Ya, I would double check the mysql table "settings" first to verify it actually is set in there.

Did you also click Save on the Thold Settings page? As the value it shows actually defaults to what is set for "settings_from_email". If you don't click Save on it, then it never actually sets that though, and thold doesn't use it.

https://github.com/Cacti/plugin_thold/b ... s.php#L453
hipsterdoofus
Cacti User
Posts: 87
Joined: Fri Mar 09, 2007 12:35 pm

Re: one new problem...

Post by hipsterdoofus »

cigamit wrote: Fri Jan 03, 2020 2:33 pm Ya, I would double check the mysql table "settings" first to verify it actually is set in there.

Did you also click Save on the Thold Settings page? As the value it shows actually defaults to what is set for "settings_from_email". If you don't click Save on it, then it never actually sets that though, and thold doesn't use it.

https://github.com/Cacti/plugin_thold/b ... s.php#L453
Thank you! I believe it was my settings table that was messed up when I upgraded (or tried) to update everything. Just got a thold email.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests