Page 1 of 1
Deleting comments
Posted: Mon Mar 23, 2015 7:58 am
by proquibas
Hi all,
I'm trying to delete a lot of comments from diferent services by using a mysql query. It works fine and all comments dissapear, but when I configure some objecto in the nagios XI GUI and apply configuration, the comments appear again.
There is a procedure to delete definetly the comments?
Thanks.
Re: Deleting comments
Posted: Mon Mar 23, 2015 10:33 am
by jolson
What command are you running to remove the comments from mysql?
Re: Deleting comments
Posted: Tue Mar 24, 2015 12:18 am
by proquibas
Well, I'm using MySQL Workbench to run queries:
select * from nagios_comments;
Then I select the rows I want, delete it and apply changes. When I run the query again the deleted rows does not appear, but when I apply config by using the Nagios XI gui and I run the query again, the comments appear again...
Thanks!
Re: Deleting comments
Posted: Tue Mar 24, 2015 9:25 am
by tmcdonald
First of all, we *strongly* advise against using any sort of database management scripts like MySQL Workbench of PHPMyAdmin. If you do not know exactly what you are doing it can cause some serious damage to your XI environment.
I will see if the developers can weigh in on why this might be the case. As far as I know, the nagios_* tables are separate from the CCM apply config process and should not be touched by it.
Re: Deleting comments
Posted: Tue Mar 24, 2015 9:43 am
by jdalrymple
Not officially supported by us, use at your own risk:
Code: Select all
[root@localhost var]# service nagios stop
Stopping nagios: done.
[root@localhost var]# mysql -u root -pnagiosxi -e 'delete from nagios_comments' nagios
[root@localhost var]# grep -v "comment_data" retention.dat > temp
[root@localhost var]# mv temp retention.dat
mv: overwrite `retention.dat'? y
[root@localhost var]# service nagios start
Starting nagios: done.