Prevent notifications while migrating to new NagiosXI server

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
PeterDK
Posts: 25
Joined: Tue Jun 05, 2018 9:19 am

Prevent notifications while migrating to new NagiosXI server

Post by PeterDK »

Hi,

We are migrating our NagiosXI server from CentOS 6 to CentOS 7.
We followed the procedure from Nagios and creating a backup from to old environment restoring it on the new environment works fine.
The problem is, we still have to do some tweaking afterwards:
- the IP adres need to change of the server (to that of the old one), which is easier than changing all client configurations
- URL's of NagiosXI need to change
- passwords of mysql
- ...

But because the new Nagios server gets all the working settings from the old server and the Nagios service starts, it also starts sending out a huge amount of email notifications, due to the fact that not all nrpe agents / nsclients have been reconfigured to allow the new Nagios server ip etc.

Even with the notification disabled in the nagios.cfg file ('enable_notifications=0'), it still send emails when the nagios service is started.
We'd like to prevent that during the migration phase in order to be sure everything is working as expected before going in production.

What would be the best approach:
- disconnect from network: will allow the restore to finish and services to start but you can't connect to NagiosXI to do any administration and tests, but changing config files would be possible from the console.
- changing the mail settings is possible, but Nagios is faster than me changing it
- temporary blocking it on the smtp server? But I suppose mails are cached.
I've read on this thread https://support.nagios.com/forum/viewto ... ed#p183872 that the tables xi_events and xi_meta can be cleared. Would this help us as well?

Can you please advise what the best approach is for this situation?

Kind regards,
Peter
User avatar
Francesco
Posts: 124
Joined: Wed Oct 28, 2015 5:02 am
Location: /usr
Contact:

Re: Prevent notifications while migrating to new NagiosXI se

Post by Francesco »

To send email you use Sendmail or SMTP?

Admin --> Manage Email Settings

If you use Sendmail, you can work on your mail software.

For example, I'm now testing this in a pre-prod environment:
https://serverfault.com/questions/94640 ... or-testing

Ciao
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Prevent notifications while migrating to new NagiosXI se

Post by lmiltchev »

Make sure you don't have any multiple nagios processes running on the server.

Code: Select all

ps -ef | grep nagios.cfg | grep -v grep
You can disable notifications in Nagios XI globally by going to Admin > Monitoring Engine Status, and clicking on the "Disable" action button next to "Notifications" (the "x").

You may have some notifications sent already (in the mail queue), etc. However, no new notifications should be sent.
I've read on this thread https://support.nagios.com/forum/viewto ... ed#p183872 that the tables xi_events and xi_meta can be cleared. Would this help us as well?
It may, however we don't recommend modifying anything in the db directly. You can clear the tables at your own risk.
Be sure to check out our Knowledgebase for helpful articles and solutions!
PeterDK
Posts: 25
Joined: Tue Jun 05, 2018 9:19 am

Re: Prevent notifications while migrating to new NagiosXI se

Post by PeterDK »

Francesco wrote:To send email you use Sendmail or SMTP?
It's SMTP.
lmiltchev wrote:Make sure you don't have any multiple nagios processes running on the server.

Code: Select all

ps -ef | grep nagios.cfg | grep -v grep
You can disable notifications in Nagios XI globally by going to Admin > Monitoring Engine Status, and clicking on the "Disable" action button next to "Notifications" (the "x").

You may have some notifications sent already (in the mail queue), etc. However, no new notifications should be sent.

It may, however we don't recommend modifying anything in the db directly. You can clear the tables at your own risk.
Only one process was running.
And because we have to change 2 config files ("nagios.cfg" and "ndo2db.cfg" for mysql passwords) before we can connect to NagiosXI and push the "disable" button, Nagios will be much faster.

The solution we are considering is blocking outgoing traffic on port 25 on the local firewall, because that's something Nagios isn't restoring during the process. Then we have time to disable the notifications and do a cleanup first.

One thing we want to be sure of: if smtp is blocked on port 25, will it drop the notification or does Nagios cache it somewhere until available?
I'm also not a fan of clearing tables directly in the DB, but if it helps us with this, we might just go for it.

Kind Regards,
Peter
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Prevent notifications while migrating to new NagiosXI se

Post by lmiltchev »

One thing we want to be sure of: if smtp is blocked on port 25, will it drop the notification or does Nagios cache it somewhere until available?
If you are using the php mailer, the notifications will be (at least *should be*) dropped.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked