Migrating Nagios XI host to CentOS 7

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
rferebee
Posts: 733
Joined: Wed Jul 11, 2018 11:37 am

Migrating Nagios XI host to CentOS 7

Post by rferebee »

Good morning,

I will be migrating my XI host to CentOS 7 this morning, but I'm running into a problem whenever I light up the new server.

Despite having notifications disabled in both the config file /usr/local/nagios/etc/nagios.cfg and in the GUI the new server is sending out dozens of "false positive" notifications. I assume they are cached somewhere?

My question, is there a way to clear out the notification cache on my new server so it won't send out anything during the transition period? I only want notifications to resume once the environment has stabilized and all of the hosts/services have checked-in.

Thank you.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Migrating Nagios XI host to CentOS 7

Post by benjaminsmith »

Hello @rferebee,

Make sure you have the notification turned off.
disable_notifications.png
You should be able to view the mail queue with the following command, and can clear out the /var/spool/mqueue/ directory to remove message from this queue.

Code: Select all

mailq
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
rferebee
Posts: 733
Joined: Wed Jul 11, 2018 11:37 am

Re: Migrating Nagios XI host to CentOS 7

Post by rferebee »

So, I was reading another thread and it mentioned the xi_events table.

Do the notifications have anything to do with that table?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Migrating Nagios XI host to CentOS 7

Post by scottwilkerson »

Yes, if you had queued events they would still send

You can run the following to clear them all

Code: Select all

echo "truncate table xi_events; truncate table xi_meta; truncate table xi_eventqueue;" | mysql -u root -pnagiosxi
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
rferebee
Posts: 733
Joined: Wed Jul 11, 2018 11:37 am

Re: Migrating Nagios XI host to CentOS 7

Post by rferebee »

I don't see /var/spool/mqueue is that bad?
rferebee
Posts: 733
Joined: Wed Jul 11, 2018 11:37 am

Re: Migrating Nagios XI host to CentOS 7

Post by rferebee »

scottwilkerson wrote:Yes, if you had queued events they would still send

You can run the following to clear them all

Code: Select all

echo "truncate table xi_events; truncate table xi_meta; truncate table xi_eventqueue;" | mysql -u root -pnagiosxi
I tried running this command, but it's giving me the following error:

Code: Select all

ERROR 1046 (3D000) at line 1: No database selected
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Migrating Nagios XI host to CentOS 7

Post by benjaminsmith »

Hello @rferebee,

Looks like the db got cut off, run this:

Code: Select all

echo "truncate table xi_events; truncate table xi_meta; truncate table xi_eventqueue;" | mysql -uroot -pnagiosxi nagiosxi
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
rferebee
Posts: 733
Joined: Wed Jul 11, 2018 11:37 am

Re: Migrating Nagios XI host to CentOS 7

Post by rferebee »

Ok, that worked, but the host is still showing 9770 requests when I run the: mailq command
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Migrating Nagios XI host to CentOS 7

Post by benjaminsmith »

Hi @rferebee,

I believe you are using Cent 7? If so, likely using the postfix MTA. Run the following and let me know if that clears the queue.

Code: Select all

postfix flush
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
rferebee
Posts: 733
Joined: Wed Jul 11, 2018 11:37 am

Re: Migrating Nagios XI host to CentOS 7

Post by rferebee »

I don't think sendmail is actually installed on this new CentOS 7 host. Which is probably why it's not behaving like it typically would.

The location where the sendmail configuration files should be /etc/mail doesn't exist on the new host. What's more confusing for me though is trying to figure out how the host is sending out notifications if sendmail isn't installed.

The postfix flush command didn't do anything. The queue just keeps growing. It's up to over 11k now.
Locked