Can we edit config files manually in Nagiosxi

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
sagarjatti
Posts: 25
Joined: Fri Nov 02, 2012 8:25 am

Can we edit config files manually in Nagiosxi

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Can we edit config files manually in Nagiosxi

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
sagarjatti
Posts: 25
Joined: Fri Nov 02, 2012 8:25 am

Re: Can we edit config files manually in Nagiosxi

Post 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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Can we edit config files manually in Nagiosxi

Post 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.
Former Nagios employee
toodaly
Posts: 63
Joined: Wed Jun 19, 2013 3:39 pm

Re: Can we edit config files manually in Nagiosxi

Post 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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Can we edit config files manually in Nagiosxi

Post 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.
Former Nagios employee
toodaly
Posts: 63
Joined: Wed Jun 19, 2013 3:39 pm

Re: Can we edit config files manually in Nagiosxi

Post 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.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Can we edit config files manually in Nagiosxi

Post by ssax »

Great, is it ok if we mark this as resolved and lock the topic?
Locked