Page 1 of 1

Can we edit config files manually in Nagiosxi

Posted: Mon Jul 13, 2015 5:22 am
by sagarjatti
Hi Team,

I have lot of service config files with having notes & notes_url parameter with having some URL associated with it. Now i have to change one word from the URL in all config files how can i edit all service config files in one shot instead of making changes one-by-one in GUI.

Re: Can we edit config files manually in Nagiosxi

Posted: Mon Jul 13, 2015 9:54 am
by abrist
You cannot manually edit the config files generated by the CCM in XI as any edits you make will just be overwritten on the next apply configuration. You can make this sweeping change in one of two ways:
1. Write a custom query to alter the url in the nagiosql database.
2. Alter the config files and try to re-import copies of them.

Re: Can we edit config files manually in Nagiosxi

Posted: Thu Jul 23, 2015 6:38 am
by sagarjatti
Hi,

I am trying to make changes in Database directly for table nagios_services to change URL under notes column. When i apply config changes from GUI it overwrites the changes done in Database level.

All URL's are defined under service definition for each service check.

Re: Can we edit config files manually in Nagiosxi

Posted: Thu Jul 23, 2015 9:06 am
by tmcdonald
You need to use the nagiosql database, not the nagios one. And the table would be tbl_service instead of nagios_services.

One thing I do need to point out is that direct database manipulation can cause serious damage to your system if done incorrectly, so officially we cannot recommend doing so even if it is possible. Any damage caused would be outside the scope of what we can help fix.

Re: Can we edit config files manually in Nagiosxi

Posted: Mon Aug 31, 2015 5:09 pm
by toodaly
I plan to do this in a test environment. What would be an example sql command if I wanted to deactivate a service ("CPU Util") for host ("Linux_Host_A")?
Using psql, I can see the column "active" in tbl_service is currently set to 1.

I would also like to do this with deactivating a host.

Thanks.

Re: Can we edit config files manually in Nagiosxi

Posted: Mon Aug 31, 2015 5:16 pm
by tmcdonald
toodaly wrote:Using psql, I can see the column "active" in tbl_service is currently set to 1.
There is no table tbl_service in the postgres database.

This is one of the reasons we can't support direct DB modification. Without a complete understanding of the databases, tables, columns, and how they all interact, you risk damaging your system. Even in a test environment, where damage is not a problem, this is not something we are keen on documenting since we don't officially support it (and documenting it will look an awful lot like an endorsement/recommendation).

We have the Bulk Modifications tool under the CCM menu for making mass changes. There's a 60-day trial available for it, and if you like what it offers it might be worth bringing up to your purchasing department. Aside from that, you are more than welcome to edit the DB directly but from an official standpoint we need to step back from that.

Re: Can we edit config files manually in Nagiosxi

Posted: Tue Sep 01, 2015 3:11 pm
by toodaly
You're correct. It should be mysql, my mistake. I was able to modify the field I needed. I'll take a look at the Bulk Modifications tool as well. Thanks.

Re: Can we edit config files manually in Nagiosxi

Posted: Tue Sep 01, 2015 3:18 pm
by ssax
Great, is it ok if we mark this as resolved and lock the topic?