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.
Can we edit config files manually in Nagiosxi
-
sagarjatti
- Posts: 25
- Joined: Fri Nov 02, 2012 8:25 am
Re: Can we edit config files manually in Nagiosxi
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.
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.
"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
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.
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
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.
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
Re: Can we edit config files manually in Nagiosxi
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.
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
There is no table tbl_service in the postgres database.toodaly wrote:Using psql, I can see the column "active" in tbl_service is currently set to 1.
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
Re: Can we edit config files manually in Nagiosxi
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
Great, is it ok if we mark this as resolved and lock the topic?