[SOLVED] No email sent when a threshold is reached

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Post Reply
mikygee
Cacti User
Posts: 88
Joined: Thu Jul 30, 2009 3:13 am

[SOLVED] No email sent when a threshold is reached

Post by mikygee »

Hello,

I'm trying to get email sent when a value reach a certain number. In my case it's the number of nat sessions (let's say 10000).
I'm probably missing one step because emails are never sent.

Settings:
1) It's installed and enabled in Plugin Management
2) In Utilities > User Management I selected Send Test Email for my user
3) I installed settings and I receive an email when I select "send a test email" in Configuration > Settings > Mail/DNS
I think Settings is working just fine

Thold:
4) It's installed and enabled in Plugin Management
5) In Utilities > User Management I selected Configure Threshold Templates, Configure Thresholds, Manage Notification Lists, View Thresholds for my user
6) I created a list in Management > Notification Lists a list called "Test" and specified on mail address
7) I created one threshold alarm called "FW1 Sessions", Threshold Enabled is enabled, Threshold Type=High/Low Values, Re-Alert Cycle=1 minute, Warning High Threshold=9990, High Threshold=10000, for both of them Breach Duration=1mn, Warning Notification List and Alert Notification List and set with the list name "Test"
8.) If I select Management > Thresholds after some time i see that the line is red

Code: Select all

FW1 Sessions 	High/Low 	10000 	2000 	1 Minute 		Every Minute 	14826 	yes 	Enabled
Email is never received in my mailbox
9) When i look at /var/log/maillog I see when the test email is sent with Configuration > Settings > Mail/DNS / Send Test Email but nothing when Thold should send the email
10) In the logs I see messages such as

Code: Select all

12/04/2011 11:41:07 AM - Threshold Breached ID: 1 DataTemplate: FW1 Sessions - 5 Minute Sessions DataSource: 5min_sessions Type: High/Low Enabled: on Current: 14826 High: 10000 Low: 2000 Trigger: 1 Minute Warning High: 9990 Warning Low: 3000 Warning Trigger: 1 Minute SentTo: myemail@isp.com
12/04/2011 11:41:07 AM - THOLD: Sending email to 'myemail@isp.com'
12/04/2011 11:41:06 AM - THOLD: Preparing to send email
12/04/2011 11:41:06 AM - THOLD: Alerting is necessary
I looks that Thold is at least trying to send the email but I don't know why it's never sent
Last edited by mikygee on Sun Dec 04, 2011 1:37 pm, edited 1 time in total.
Some info about my system
- Cacti: 0.8.8g / OpenBSD 6.6
- Third Party: Nginx 1.16.1 / PHP 7.3.10 / MariaDB 10.3.18v1 / NET-SNMP version 5.8p2 / RRDTool 1.7.2
- Plugins: Weathermap 0.97c / Settings 0.71 / Thold 0.5 / Flowview 1.1 / Realtime 0.5.2 / Predict 1.0
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: No email sent when a threshold is reached

Post by TheWitness »

What version of thold? Also, check the syslog and maillog on the Cacti server. Could be spam as well.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
mikygee
Cacti User
Posts: 88
Joined: Thu Jul 30, 2009 3:13 am

Re: No email sent when a threshold is reached

Post by mikygee »

Hello,

Thank you for your answer.

I use cacti 0.8.7h and weathermap 0.97a

I don't send anything on the syslog
Settings > Cacti Settings > Log File Destination = Logfile Only
Do you mean that I should set this to Logfile and Syslog/Eventlog ?

What do you mean by maillog on the Cacti server ?
In step 9) I checked /var/log/maillog

I did more tests and found out in Configuration > Settings > Mail/DNS that when Mail Services is set to:
- PHP Mail() function => it doesn't work
- Sendmail => it doesn't work
- SMTP => it works

When I posted my first message I was using PHP Mail() function and the test message works but Thold doesn't.
From the begining I had configured in php.ini

Code: Select all

sendmail_path = "/bin/sendmail -t"
Could you also explain me what is the difference between Sendmail and SMTP.

Thank you
Some info about my system
- Cacti: 0.8.8g / OpenBSD 6.6
- Third Party: Nginx 1.16.1 / PHP 7.3.10 / MariaDB 10.3.18v1 / NET-SNMP version 5.8p2 / RRDTool 1.7.2
- Plugins: Weathermap 0.97c / Settings 0.71 / Thold 0.5 / Flowview 1.1 / Realtime 0.5.2 / Predict 1.0
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: No email sent when a threshold is reached

Post by TheWitness »

SMTP is a low level PHP Emulation level for 'sendmail'. It bypasses the os entirely. Yes, by log, I mean the mail and syslog for send errors. So, is the problem fixed?
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
mikygee
Cacti User
Posts: 88
Joined: Thu Jul 30, 2009 3:13 am

Re: No email sent when a threshold is reached

Post by mikygee »

Hello again,

I solved my problem just after writing my last message.
Writing the message helped my to find the solution.

I use two different php.ini. One is used by Apache, one by the poller.
When I pressed "send a test email" in Configuration > Settings > Mail/DNS, the Apache php.ini was used and that one was properly configured.
When the poller tried to send an email, the other php.ini was used and I didn't configured it to send emails.

Why I have two php.ini ? It's because I run Cacti on my OpenBSD OS with Apache chrooted. I will improve the installation when I'll upgrade my OpenBSD but I'll probably keep two different php.ini.

Thank you for reading my messages and sorry for the question, I searched a lot before writting. The most difficult with installing Thold, is not the plugin itself but the system configuration that is around it.

Have a nice day
Some info about my system
- Cacti: 0.8.8g / OpenBSD 6.6
- Third Party: Nginx 1.16.1 / PHP 7.3.10 / MariaDB 10.3.18v1 / NET-SNMP version 5.8p2 / RRDTool 1.7.2
- Plugins: Weathermap 0.97c / Settings 0.71 / Thold 0.5 / Flowview 1.1 / Realtime 0.5.2 / Predict 1.0
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests