Page 2 of 2

Re: down hosts clean up

Posted: Wed May 12, 2021 4:23 pm
by exp-user1
Hi,

I sent you the backup in PM. please check and let me know.

Thanks.

Re: down hosts clean up

Posted: Thu May 13, 2021 10:21 am
by gsmith
Hi

The file was not attached to the PM. Please resend.

Thanks

Re: down hosts clean up

Posted: Fri May 14, 2021 4:01 pm
by gsmith
Hi,

We are going to delete those "phantom" entries out of the database.

First we need to take a System Backup to preserve the current state of the databases.

Go to the Admin page, pick "Local Backup Archives" from the left-hand menu under 'System Backups' and then hit
the "Create Backup" button.
Image7.jpg
Next on a command line on the server:

Code: Select all

mysql -u root -p nagios
<enter password when prompted, default = 'nagiosxi'>
delete from nagios_hoststatus where status_update_time < (SELECT STR_TO_DATE('2021-02-25 00:00:01','%Y-%m-%d %H:%i:%s'));
commit;
Thanks

Re: down hosts clean up

Posted: Mon May 17, 2021 11:09 am
by exp-user1
Hi,

could you please explain what exactly this delete statement will do?
I see that some host with OK status are included in this delete.

thanks.

Re: down hosts clean up

Posted: Mon May 17, 2021 2:00 pm
by gsmith
Hi,

I amended the statement

Code: Select all

mysql -u root -p nagios
<enter password when prompted, default = 'nagiosxi'>
delete from nagios_hoststatus where status_update_time < (SELECT STR_TO_DATE('2021-02-25 00:00:01','%Y-%m-%d %H:%i:%s'))
AND output like 'CRITICAL%';
commit;
Now it will delete every entry that hasn't been updated since 24 FEB and a status like 'CRITICAL....."

Seems like we will have some with STATUS = OK and not updated since 24 FEB, but we can examine them after
you run the delete.

Thanks

Re: down hosts clean up

Posted: Tue May 18, 2021 1:09 pm
by exp-user1
Hi,

Sounds good now. I will keep monitoring.

Thanks.

Re: down hosts clean up

Posted: Tue May 18, 2021 1:12 pm
by gsmith
Hi,

Great! I am going to lock this thread for now. But
please reach out if you have more issues.

Thanks