Prevent previous alerts from sending when server turned on

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mrjsokol
Posts: 109
Joined: Thu Apr 16, 2020 10:27 am

Prevent previous alerts from sending when server turned on

Post by mrjsokol »

Good morning all,

We had started to use our XI server again and getting ghost emails from previous down alerts that either A) The client is no longer in the configuration or B) The host is reporting down and its currently up. We suspect these are emails that should have been generated and should have been sent out but didnt due to other issues with XI. Is there a way to clear this, if there is a cache producing these emails as we have already received 200 emails prior to shutting down the email server again.
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Prevent previous alerts from sending when server turned

Post by vtrac »

Hi,
Please try the below command (NOTE: this is a ONE line command):

Code: Select all

echo "truncate table xi_events; truncate table xi_meta; truncate table xi_eventqueue;" | mysql -pnagiosxi nagiosxi

Regards,
Vinh
mrjsokol
Posts: 109
Joined: Thu Apr 16, 2020 10:27 am

Re: Prevent previous alerts from sending when server turned

Post by mrjsokol »

Good afternoon,

We are getting the following error:

No database selected.
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Prevent previous alerts from sending when server turned

Post by vtrac »

Hi,
Please try this (added -u root).
NOTE: this is a ONE line, so make sure you copy all:

echo "truncate table xi_events; truncate table xi_meta; truncate table xi_eventqueue;" | mysql -uroot -pnagiosxi nagiosxi


Regards,
Vinh
mrjsokol
Posts: 109
Joined: Thu Apr 16, 2020 10:27 am

Re: Prevent previous alerts from sending when server turned

Post by mrjsokol »

Just to update posting,

We were able to run command but waiting on team to turn on smtp server to confirm that this resolved the massive amount of previous non sent alert emails from being sent.
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Prevent previous alerts from sending when server turned

Post by vtrac »

OK ... just let us know!!

Regards,
Vinh
mrjsokol
Posts: 109
Joined: Thu Apr 16, 2020 10:27 am

Re: Prevent previous alerts from sending when server turned

Post by mrjsokol »

Good evening,

We have enabled the smtp server and verified that the server is operational from the smtp server itself but it seems that nagios is not communicating properly with the server to send the emails. I have tried so far the following troubleshooting steps and will continue to look further into the logs and enable debugging.

- Tried switching email addresses for the account
- updated existing email address and saved to account again
- used a different user account
- Used multiple machines for testing
- Changed the contact for a machine as a test to have the direct contact of the account I was using
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Prevent previous alerts from sending when server turned

Post by dchurch »

What do you mean by "not communicating properly with the server"? Where do you see that? Please include any error messages you see.

What happens if you send a test email from Admin => Email Settings? Any error messages there? Does the message arrive in your inbox?

Is Nagios XI set up to use an SMTP server, or sendmail?
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
mrjsokol
Posts: 109
Joined: Thu Apr 16, 2020 10:27 am

Re: Prevent previous alerts from sending when server turned

Post by mrjsokol »

Good morning,

When enabling debugging using the following guide:
https://support.nagios.com/kb/article/p ... g-820.html

We received the error that it could not connect, to find out that our connection information was provided incorrectly.

We have not seen the flood of emails come in after turning it back on after using the truncate statement listed above.

This thread can be locked.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Prevent previous alerts from sending when server turned

Post by scottwilkerson »

mrjsokol wrote:Good morning,

When enabling debugging using the following guide:
https://support.nagios.com/kb/article/p ... g-820.html

We received the error that it could not connect, to find out that our connection information was provided incorrectly.

We have not seen the flood of emails come in after turning it back on after using the truncate statement listed above.

This thread can be locked.
Closing case
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked