Page 1 of 2
Migrating Nagios XI host to CentOS 7
Posted: Thu Oct 10, 2019 9:08 am
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.
Re: Migrating Nagios XI host to CentOS 7
Posted: Thu Oct 10, 2019 11:37 am
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.
Re: Migrating Nagios XI host to CentOS 7
Posted: Thu Oct 10, 2019 11:41 am
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?
Re: Migrating Nagios XI host to CentOS 7
Posted: Thu Oct 10, 2019 11:45 am
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
Re: Migrating Nagios XI host to CentOS 7
Posted: Thu Oct 10, 2019 1:27 pm
by rferebee
I don't see /var/spool/mqueue is that bad?
Re: Migrating Nagios XI host to CentOS 7
Posted: Thu Oct 10, 2019 1:33 pm
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
Re: Migrating Nagios XI host to CentOS 7
Posted: Thu Oct 10, 2019 2:49 pm
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
Re: Migrating Nagios XI host to CentOS 7
Posted: Thu Oct 10, 2019 3:05 pm
by rferebee
Ok, that worked, but the host is still showing 9770 requests when I run the: mailq command
Re: Migrating Nagios XI host to CentOS 7
Posted: Thu Oct 10, 2019 3:32 pm
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.
Re: Migrating Nagios XI host to CentOS 7
Posted: Thu Oct 10, 2019 4:00 pm
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.